DEV Community

Discussion on: Solve this simple problem with TDD

 
delbetu profile image
M Bellucci

Reading again all of your answer so you are describing an algorithm which possibly solves the problem and you identify two sub problem that can be tested individually,

This is a valid technique for solving a problem but is totally the opposite of tdd

Because in tdd you don’t know the solution in advance, as you resolve every micro test with the minimum amount of code to satisfy the test you discover the algorithm.
So you don’t know the algorithm in advance.