How John started to like TDD (instead of hating it) (Testcon, October'25)

icougil 13 views 124 slides Oct 22, 2025
Slide 1
Slide 1 of 124
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124

About This Presentation

Let me share a story about how John (a developer like any other) started to understand (and enjoy) writing Tests before the Production code.

We've all felt an inevitable "tedium" when writing tests, haven't we? If it's boring, if it's complicated or unnecessary? Isn't ...


Slide Content

How John started to like TDD (instead of hating it) October, 2025

Who am I? Nacho Cougil Principal Software Engineer at Dynatrace TDD & clean code fan Started to write in Java before Y2K Founder of the Barcelona Java Users Group ( BarcelonaJUG ) & co-founder of the Barcelona Developers Conference ( DevBcn ) former Java and JVM Barcelona Conference Java Champion Father, former mountain marathon runner πŸ˜… @ icougil icougil.bsky.social https://mastodon.social/@icougil This presentation

3

4

5

6 And at some point … 6

Lack of testing 7

Long-lived branches 8

Make others wait (until your work is done) The task XXX is not finished β€œIs because <write here your excuse argument>” β€œWe were waiting to do Y… based on what you have to finish with Z” β€œOur feature was based on your implementation around X” 9

New requests came in 10 Sometimes were… Interesting Incompatible Incomprehensible Not mature enough … Too late

11 Complexity

Many things to take into account 12 Remember that… β€œWhen you have to do X … you must have a record in the Database with Y” β€œActivate this flag in Z before running A” β€œRemember to write into Kafka B after doing C” β€œFor testing D we need a license for E” β€œF is incompatible with the version G” …

13 Adapt to changes

Invalid documentation 14 Outdated Incorrect Missing…

15 Limited time

16 Building tests was boring

At the end… many reasons 17 Lack of testing Long-lived branches Make others wait New requests came in Complexity Many things to take into account Adapt to changes Invalid documentation Limited time Building tests was boring

18

19

20

21 Same problems again !?

22

Questions came to his mind 23 β€œThere are surely practices to improve” β€œThere must be practices that should help minimizing the risks” To share/deliver things faster and with small chunks To not having to keep many things in your mind To adapt to changes easily Have a better documentation Enjoy writing tests

Learn from others 24 Started attending meetups… Someone mentioned many practices and concepts that he didn’t kn o w or he couldn’t practice Feedback-loop Simple design Small releases Pair-programming Refactoring Test D r iven Development (TDD)

Started to grew 25 Listening more Reading more books Practicing P ersonal projects Katas Writing less β€œsmart ” code οƒ  more β€œ easy to read ” code, easy to test code

Tried to applied at work… 26 Katas VS real projects Deadlines & commitments Initial time investment Learning curve Maintenance challenges Legacy projects Code does not do what you expect Lack of documentation Non-testable designed solution Different ways of developing Complexity

Tried to applied at work… 27 Couldn’t make it … ended up causing frustration

Until one day… 28

29

30 1 2 3 Specify what you would like to implement Develop what the tests describes. No more no less TDD Anything we can leave better? Red Green Refactor

31 But, generalizing… INPUT PROCESS OUTPUT

32 But, generalizing…

33

34 But, generalizing… INPUT PROCESS OUTPUT

35 But, how can we use TDD in a real-case scenario ?

Build a solution that retrieves the amount of resources (CPU usage, memory consumption, etc) being used by different services /endpoints A process must periodically check the resources being used from different services We’ll act as we're Java/backend developers πŸ˜‰ (using Spring Boot) to build an API 36 Let’s see an example πŸ™‚

37 ... Service 1 https://service1... DB Sync Resource Usages Process U sage resources Service 2 https://service2... List Resource Usages GET / resourceUsages POST / resourceUsages / sync:execute API πŸ™‚

38 https://github.com/icougil/resource_usage

From the DB to the external endpoint ( from the DB οƒ  business logic οƒ  endpoint ) From the process that connects to the services, to the DB and endpoint ( internal process οƒ  to the DB / business logic οƒ  endpoint ) From the external endpoint that triggers the process, to the DB ( endpoint οƒ  business logic οƒ  DB ) 39 Approaches

From the DB to the external endpoint ( from the DB οƒ  business logic οƒ  endpoint ) From the process that connects to the services, to the DB and endpoint ( internal process οƒ  to the DB / business logic οƒ  endpoint ) From the external endpoint that triggers the process, to the DB ( endpoint οƒ  business logic οƒ  DB ) 40 Approaches

41 1. From the DB to the external endpoint Business layer Use cases (Services) Presentation layer Controllers Repositories Data access Storage DB

42 1. From the DB to the external endpoint Time

43 Change DB model Change database structure 1. From the DB to the external endpoint Time

44 Implement save usage resources in a repository Change DB model Implement the repository to save the resource usage (guessing how … πŸ€” ) Change database structure 1. From the DB to the external endpoint Time Questions araised πŸ€” I s it working as expected? no tests at all Will we have to change something? signatures will change?

45 Implement save usage resources in a repository Change DB model Business logic: list of usage resources to save Implement the repository to save the resource usage (guessing how … πŸ€” ) Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) 1. From the DB to the external endpoint Time Questions πŸ€” I s it working as expected? Will we have to change something? Questions πŸ€”

46 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Change DB model Business logic: list of usage resources to save Implement the repository to save the resource usage (guessing how … πŸ€” ) Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) 1. From the DB to the external endpoint Time Questions πŸ€” Questions πŸ€”

47 Questions πŸ€” I s it working as expected? Will we have to change something? How we will handle errors?

48 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Implement the repository to save the resource usage (guessing how … πŸ€” ) Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) Implement the endpoint that triggers the synchronization for all services 1. From the DB to the external endpoint Time Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Questions πŸ€” Questions πŸ€” Questions πŸ€”

49 Questions πŸ€” I s it working as expected? Will we have to change something? (But at least, we can start triggering something manually πŸ™‚)

50 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Tests for the repository Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Implement the repository to save the resource usage (guessing how … πŸ€” ) Test if the method we created for saving data works as expected Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) Implement the endpoint that triggers the synchronization for all services 1. From the DB to the external endpoint Time Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Questions πŸ€” Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜…

51 Finally !! πŸ™‚ We are verifying something is working as expected !

52 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Tests for the repository Tests for the business logic Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Implement the repository to save the resource usage (guessing how … πŸ€” ) Test if the method we created for saving data works as expected Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) Implement the endpoint that triggers the synchronization for all services Tests for retrieving all the information for all the services. Tests when something goes wrong (and probably add logic around it? πŸ€”) 1. From the DB to the external endpoint Time Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Questions πŸ€” Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ…

53 Finally !! πŸ™‚ We are verifying the business logic is working as expected !

54 Questions araised πŸ€” What we should do here? Should we return an error and change the methods / Endpoint?

55 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Tests for the repository Tests for the business logic Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Implement the repository to save the resource usage (guessing how … πŸ€” ) Test if the method we created for saving data works as expected Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) Implement the endpoint that triggers the synchronization for all services Tests for retrieving all the information for all the services. Tests when something goes wrong (and probably add logic around it? πŸ€”) 1. From the DB to the external endpoint Time Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Questions πŸ€” Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Tests for the endpoint & Acceptance test Verifying βœ…, but changes ? πŸ€” Create Acceptance test to verify that the entire workflow works as expected. Define/implement the behavior when something goes wrong.

56 Finally we closed the loop ! πŸ” πŸ™‚ Created the acceptance test for the happy path

57 Verifying some of the wrong scenarios πŸ™‚ What about the wrong scenarios? πŸ€”

58 Wait, πŸ€” let’s try now with a few more services… πŸ’₯πŸ€¦β€β™‚οΈ

59 πŸ’₯πŸ€¦β€β™‚οΈ Wait !? We found the overall solution does not work πŸ’₯πŸ›‘ !? : we're forcing our clients to wait ⏳ for the overall process ?! οƒ  timeouts πŸ’₯πŸ›‘ (going to all the services and check their resource consumption) Redesign β€Ό We will need to think about how to implement to handle them πŸ€”. Found issues οƒ  The final solution is not working !? πŸ’₯πŸ›‘ We will need to change our internal business logic πŸ€” ‼️

60 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Tests for the repository Tests for the business logic Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Implement the repository to save the resource usage (guessing how … πŸ€” ) Test if the method we created for saving data works as expected Change database structure Implement part of the business logic by saving a list of usage resources (guessing how … πŸ€”) Implement the endpoint that triggers the synchronization for all services Tests for retrieving all the information for all the services. Tests when something goes wrong (and probably add logic around it? πŸ€”) 1. From the DB to the external endpoint Time Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Questions πŸ€” Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Verifying βœ…, but changes ? πŸ€” Verifying βœ…, closed the loop πŸ” C hanges πŸ€” Not working πŸ’₯πŸ›‘ οƒ  redesign ‼️ Create Acceptance test to verify that the entire workflow works as expected. Define/implement the behavior when something goes wrong. Tests for the endpoint & Acceptance test

61 1. From the DB to the external endpoint Time Questions πŸ€” Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Verifying βœ…, but changes ? πŸ€” Verifying βœ…, closed the loop πŸ” C hanges πŸ€” Not working πŸ’₯πŸ›‘ οƒ  redesign ‼️ Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Tests for the repository Tests for the business logic Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Tests for the endpoint & Acceptance test

1. From the DB to the external endpoint 62 It looks like we progressed from the very beginning… Simple process: we knew what we should do next (normally) We could share changes with the team ( git commit and push ) but with uncertainty ❓( no tests ). Doubts πŸ€” to know if we were building things correctly ( building but not testing )

1. From the DB to the external endpoint 63 But we couldn’t πŸ€” … check if the solution was working… until the end β€ΌοΈπŸ›‘ οƒ  it wasn’t working πŸ’₯ οƒ  redesign ‼️ share ↩️ anything until the end πŸ˜… (even with internal users) trigger the code ▢️ as our clients will behave react to changes πŸ” ( feedback-loop ) see any progress πŸ“Ά until the end of the time (having developed the entire solution)

64 1. From the DB to the external endpoint 2. From the Business logic to the DB and external endpoint 3. From the external endpoint to the DB Process +/- easy to follow, but with doubts ❓ Solution working Until the end of the time ❌ Share/push code β“βŒ (no tests) Trigger the code ❌ React to changes ( feedback-loop ) ❌ See the progress No progress until the end of the time ❌ Risks of redesign High πŸ”Ί Summary

From the DB to the external endpoint ( from the DB οƒ  business logic οƒ  endpoint ) From the process that connects to the services, to the DB and endpoint ( internal process οƒ  to the DB / business logic οƒ  endpoint ) From the external endpoint that triggers the process, to the DB ( endpoint οƒ  business logic οƒ  DB ) 65 Approaches

66 Business layer Use cases (Services) Presentation layer Controllers Repositories Data access Storage DB 2. From the process that connects to the services, to the DB and endpoint

67 Time 2. From the process that connects to the services, to the DB and endpoint

68 Business logic: find all the services and connect to all of them, asking for their resource usage Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Time 2. From the process that connects to the services, to the DB and endpoint

69 Questions πŸ€” What should we do here? How can we continue? In which way? Should we create the methods we need … and putting this β€œon hold” ? How should we handle the errors? Will it work as expected?

70 Business logic: list of usage resources to save Business logic: find all the services and connect to all of them, asking for their resource usage Implement part of the business logic by saving a list of usage resources Retrieve the list of existing services and for each one, connect to it and ask for their resource usage 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” What should we do here? How can we continue? Should we create the methods we need … and putting this β€œon hold” ? Will it work as expected?

71 Business logic: list of usage resources to save Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Implement part of the business logic by saving a list of usage resources Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Implement the repository to save the resource usage Time 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓

72 Questions πŸ€” How can we trigger it? Will it work as expected?

73 Business logic: list of usage resources to save Change DB model Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Implement part of the business logic by saving a list of usage resources Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Implement the repository to save the resource usage Time Change database structure Questions πŸ€” 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓

74 Business logic: list of usage resources to save Change DB model Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Controller: implement the endpoint that triggers the sync between all services Implement part of the business logic by saving a list of usage resources Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Implement the repository to save the resource usage Implement the endpoint that triggers the synchronization for all services Time Change database structure Questions πŸ€” 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓ Questions πŸ€”

75 Questions πŸ€” I s it working as expected? Will we have to change something? (But at least, we can start triggering something manually πŸ™‚)

76 Business logic: list of usage resources to save Change DB model Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Controller: implement the endpoint that triggers the sync between all services Implement part of the business logic by saving a list of usage resources Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Implement the repository to save the resource usage Implement the endpoint that triggers the synchronization for all services Time Change database structure Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓ This scenario looks familiar … πŸ€”

77 Implement save usage resources in a repository Business logic: find all the services and connect to all of them, asking for their resource usage Tests for the repository Tests for the business logic Change DB model Business logic: list of usage resources to save Controller: implement the endpoint that triggers the sync between all services Implement the repository to save the resource usage (guessing how … πŸ€” ) Test if the method we created for saving data works as expected Change database structure Implement part of the business logic by saving a list of usage resources (guessing how… πŸ€”) Implement the endpoint that triggers the synchronization for all services Tests for retrieving all the information for all the services. Tests when something goes wrong (and probably add logic around it? πŸ€”) 1. From the DB to the external endpoint Time Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Questions πŸ€” Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Verifying βœ…, but changes ? πŸ€” Verifying βœ…, closed the loop πŸ” C hanges πŸ€” Not working πŸ’₯πŸ›‘ οƒ  redesign ‼️ Create Acceptance test to verify that the entire workflow works as expected. Define/implement the behavior when something goes wrong. Tests for the endpoint & Acceptance test

78 Business logic: list of usage resources to save Change DB model Tests for the repository Tests for the business logic Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Controller: implement the endpoint that triggers the sync between all services Implement part of the business logic by saving a list of usage resources Test if the method we created for saving data works as expected Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Implement the repository to save the resource usage Implement the endpoint that triggers the synchronization for all services Tests for retrieving all the information for all the services. Tests when something goes wrong (and probably add logic around it? πŸ€”) Time Change database structure Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Verifying βœ…, but changes ? πŸ€” Verifying βœ…, closed the loop πŸ” C hanges πŸ€” Not working πŸ’₯πŸ›‘ οƒ  redesign ‼️ Create Acceptance test to verify that the entire workflow works as expected. Define/implement the behavior when something goes wrong. Tests for the endpoint & Acceptance test 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓

79 Business logic: list of usage resources to save Change DB model Tests for the repository Tests for the business logic Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Controller: implement the endpoint that triggers the sync between all services Implement part of the business logic by saving a list of usage resources Test if the method we created for saving data works as expected Retrieve the list of existing services and for each one, connect to it and ask for their resource usage Implement the repository to save the resource usage Implement the endpoint that triggers the synchronization for all services Tests for retrieving all the information for all the services. Tests when something goes wrong (and probably add logic around it? πŸ€”) Time Change database structure Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Verifying βœ…, but changes ? πŸ€” Verifying βœ…, closed the loop πŸ” C hanges πŸ€” Not working πŸ’₯πŸ›‘ οƒ  redesign ‼️ Create Acceptance test to verify that the entire workflow works as expected. Define/implement the behavior when something goes wrong. Tests for the endpoint & Acceptance test 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓

80 Business logic: list of usage resources to save Change DB model Tests for the repository Tests for the business logic Business logic: find all the services and connect to all of them, asking for their resource usage Implement save usage resources in a repository Controller: implement the endpoint that triggers the sync between all services Time Questions πŸ€” Questions πŸ€” Questions πŸ€”, but πŸ˜… Verifying βœ… Verifying βœ…, but changes ? πŸ€” Verifying βœ…, closed the loop πŸ” C hanges πŸ€” Not working πŸ’₯πŸ›‘ οƒ  redesign ‼️ Tests for the endpoint & Acceptance test 2. From the process that connects to the services, to the DB and endpoint Questions πŸ€” / β€œstandby” ❓ Questions πŸ€” / β€œstandby” ❓

2. From the process that connects to the services, to the DB and endpoint 81 It seems that starting from the business layer was not a good idea … Process not clear πŸ€”: we didn’t know what we should do next ( continue with data access layer or the external endpoint ? ) Commits in red πŸ”΄ ? (build failure) Couldn’t share changes with the team ( git commit, no push ) (even worst than the previous approach) Doubts πŸ€” to know if we were building things correctly ( building but not testing )

2. From the process that connects to the services, to the DB and endpoint 82 We couldn’t πŸ€” … check if the solution was working… until the end β€ΌοΈπŸ›‘ οƒ  it wasn’t working πŸ’₯ οƒ  redesign ‼️ share ↩️ anything until the end πŸ˜… (even less than with the previous approach: more code dependency) trigger the code ▢️ as our clients will behave react to changes πŸ” ( feedback-loop ) see any progress πŸ“Ά until the end of the time (having developed the entire solution)

83 1. From the DB to the external endpoint 2. From the Business logic to the DB and external endpoint Process +/- easy to follow, but with doubts ❓ Not clear ❌ Solution working Until the end of the time ❌ Until the end of the time ❌ Share/push code β“βŒ (no tests) ❌ Trigger the code ❌ ❌ React to changes ( feedback-loop ) ❌ ❌ See the progress No progress until the end of the time ❌ (even less than option 1.) ❌ Risks of redesign High πŸ”Ί High πŸ”Ί Summary

From the DB to the external endpoint ( from the DB οƒ  business logic οƒ  endpoint ) From the process that connects to the services, to the DB and endpoint ( internal process οƒ  to the DB / business logic οƒ  endpoint ) From the external endpoint that triggers the process, to the DB ( endpoint οƒ  business logic οƒ  DB ) 84 Approaches

85 Business layer Use cases (Services) Presentation layer Controllers Repositories Data access Storage DB 3. From the external endpoint that triggers the process to the DB

86 Time 3. From the external endpoint that triggers the process to the DB

87 Test for the Acceptance tests Emergent / simple design Create the Acceptance test. Design the solution we expect to build. Time 3. From the external endpoint that triggers the process to the DB

88

89

90

91

92

93

94 Test for the Acceptance tests Emergent / simple design Create the Acceptance test. Design the solution we expect to build. Time Create the controller/endpoint Implement the minimum to solve the test Solve the Acceptance test Designing πŸ§‘β€πŸŽ¨ and building 3. From the external endpoint that triggers the process to the DB

95

96

97

98

99 Test for the Acceptance tests Emergent / simple design Create the Acceptance test. Design the solution we expect to build. Time Create the controller/endpoint Implement the minimum to solve the test Solve the Acceptance test Designing πŸ§‘β€πŸŽ¨ and building Change DB model Verifying βœ… & sharing ↩️ Test for the Business logic: list of usage resources to save Create Use Case skeleton Design how to retrieve the list of existing services and for each one, connect to it and ask for their resource usage. Create test for it 3. From the external endpoint that triggers the process to the DB

100

101

102

103

104

105

106

107

108 Test for the Acceptance tests Emergent / simple design Create the Acceptance test. Design the solution we expect to build. Time Create the controller/endpoint Implement the minimum to solve the test Solve the Acceptance test Designing πŸ§‘β€πŸŽ¨ and building Change DB model Verifying βœ… & sharing ↩️ Test for the Business logic: list of usage resources to save Create Use Case skeleton Design how to retrieve the list of existing services and for each one, connect to it and ask for their resource usage. Create test for it Designing πŸ§‘β€πŸŽ¨ , building & sharing ↩️ Created the Use Case/Service. Identified more dependencies. Created the task that will do the work in the background Implement the Business Logic (background task) Implement the background task 3. From the external endpoint that triggers the process to the DB

109

110 Test for the Acceptance tests Emergent / simple design Create the Acceptance test. Design the solution we expect to build. Time Create the controller/endpoint Implement the minimum to solve the test Solve the Acceptance test Designing πŸ§‘β€πŸŽ¨ and building Change DB model Verifying βœ… & sharing ↩️ Test for the Business logic: list of usage resources to save Create Use Case skeleton Design how to retrieve the list of existing services and for each one, connect to it and ask for their resource usage. Create test for it Designing πŸ§‘β€πŸŽ¨ , building & sharing ↩️ Created the Use Case/Service. Identified more dependencies. Created the task that will do the work in the background Implement the Business Logic (background task) Implement the background task Building, verifying βœ… & sharing ↩️ Re-run the acceptance test Implement the IT test and the Repository Run the Acceptance test again and adapt the endpoint that must trigger the Use Case. 3. From the external endpoint that triggers the process to the DB

111

112

113

114

115 Test for the Acceptance tests Emergent / simple design Create the Acceptance test. Design the solution we expect to build. Time Create the controller/endpoint Implement the minimum to solve the test Solve the Acceptance test Designing πŸ§‘β€πŸŽ¨ and building Change DB model Verifying βœ… & sharing ↩️ Test for the Business logic: list of usage resources to save Create Use Case skeleton Design how to retrieve the list of existing services and for each one, connect to it and ask for their resource usage. Create test for it Designing πŸ§‘β€πŸŽ¨ , building & sharing ↩️ Created the Use Case/Service. Identified more dependencies. Created the task that will do the work in the background Implement the Business Logic (background task) Implement the background task Building, verifying βœ… & sharing ↩️ Re-run the acceptance test Implement the IT test and the Repository Build the integration test for the Repository. Implement the repository Run the Acceptance test again and adapt the endpoint that must trigger the Use Case. Verifying βœ… , building & sharing ↩️ Implement the behavior when something goes wrong. Tests for the error scenarios 3. From the external endpoint that triggers the process to the DB

116 We already designed (time ago) how we will handle them πŸ™‚ What about the wrong scenarios?

117 Verifying some of the wrong scenarios πŸ™‚

118 Create the controller/endpoint Implement the minimum to solve the test Implement the Business Logic (background task) Re-run the acceptance test Implement the IT test and the Repository Test for the Acceptance tests Emergent / simple design Test for the Business logic: list of usage resources to save Create Use Case skeleton Solve the Acceptance test Implement the background task Create the Acceptance test. Design the solution we expect to build. Time Change DB model Building, verifying βœ… & sharing ↩️ Implement the behavior when something goes wrong. Tests for the error scenarios Designing πŸ§‘β€πŸŽ¨ and building Verifying βœ… & sharing ↩️ Designing πŸ§‘β€πŸŽ¨ , building & sharing ↩️ Design how to retrieve the list of existing services and for each one, connect to it and ask for their resource usage. Create test for it Created the Use Case/Service. Identified more dependencies. Created the task that will do the work in the background Building, verifying βœ… & sharing ↩️ Build the integration test for the Repository. Implement the repository Run the Acceptance test again and adapt the endpoint that must trigger the Use Case. Verifying βœ… , building & sharing ↩️ 3. From the external endpoint that triggers the process to the DB

119 Create the controller/endpoint Implement the minimum to solve the test Implement the Business Logic (background task) Re-run the acceptance test Implement the IT test and the Repository Test for the Acceptance tests Emergent / simple design Test for the Business logic: list of usage resources to save Create Use Case skeleton Time Building, verifying βœ… & sharing ↩️ Tests for the error scenarios Designing πŸ§‘β€πŸŽ¨ and building Verifying βœ… & sharing ↩️ Designing πŸ§‘β€πŸŽ¨ , building & sharing ↩️ Building, verifying βœ… & sharing ↩️ Verifying βœ… , building & sharing ↩️ 3. From the external endpoint that triggers the process to the DB

120 Starting from the external layer to the DB was a good idea πŸ‘ Easy process πŸ™‚: we knew what we should do next ( run the tests and moving down to the next internal layer ) commits in red πŸ”΄ ( until we have our feature finished βœ… ) We could always share changes with the team ( git commit & push ↩️ ) No doubts to know if we were building things correctly ( designing –thanks to tests- οƒ  building βœ… ) 3. From the external endpoint that triggers the process to the DB

121 We could check if the solution was working… from the very beginning ( we were designing since min 0 ) share ↩️ everything from the beginning the end πŸ™‚ ( no dependencies ) trigger the code ▢️ as our clients will behave react to changes immediately πŸ” ( feedback-loop ) see progress πŸ“Ά all the time 3. From the external endpoint that triggers the process to the DB

122 1. From the DB to the external endpoint 2. From the Business logic to the DB and external endpoint 3. From the external endpoint to the DB Process +/- easy to follow, but with doubts ❓ Not clear ❌ Easy to follow πŸ‘ Solution working Until the end of the time ❌ Until the end of the time ❌ From the very beginning πŸ‘ Share/push code β“βŒ (no tests) ❌ Always (even with commits in πŸ”΄) Trigger the code ❌ ❌ βœ… React to changes ( feedback-loop ) ❌ ❌ βœ… See the progress No progress until the end of the time ❌ (even less than option 1.) ❌ βœ… Risks of redesign High πŸ”Ί High πŸ”Ί Low πŸ”» Summary

Immediate / fast feedback loop 123 We’d like to react super fast πŸƒ to changes! If we have a problem, it is better to identify it as soon as we can We can trigger/activate things (as our clients will do) !

124 No unnecessary code Our tests serves as a guide/reference As we specify what we want to build… Less things are implemented because β€œ what if” We will build only what we specify Ensure that every step we take is in the right direction (no step is done without knowing it is mandatory)