Vous subissez les régressions à chaque livraison ? Vous ne voyez pas l’intérêt des tests unitaires car ils ne servent qu’à tester des additions ? Si c’est le cas, suivez David dans la quête du Test Driven Development. Nous rencontrerons pléthore d'ennemies contre lesquels nous aurons à combattre : bugs, complexité, code statique, couplage fort. Ils essaieront de nous barrer la route, mais heureusement, nous pourrons compter sur nos alliés jUnit, Mockito, refactoring et injection/dépendance
144. Singleton ?
1 public class ProductService {
2
3 private static ProductService instance = new ProductService();
4
5 private ProductService() {
6
7 }
8
9 public static ProductService getInstance() {
10 return instance;
11 }
12 }
145. Singleton ?
1 public class ProductService {
2
3 private static ProductService instance = new ProductService();
4
5 private ProductService() {
6 CRÉATION DE L’INSTANCE
7 }
8 AU CHARGEMENT DE LA CLASS
9 public static ProductService getInstance() {
10 return instance;
11 }
12 }
158. Intégration continue
O N
K S
R
O Y
W M
[INFO] ---------------------------------------------
E
IN
[INFO] BUILD FAILURE
CH
[INFO] ---------------------------------------------
MA