DEV Community


Discussion on: Solve this simple problem with TDD

delbetu profile image
M Bellucci Author

You raise a good point when saying that starting with a list of tests is not TDD.
To clarify those tests are not run all together from the beginning.
When I start coding all of them are commented out and during the TDD cycle I just decide which of them uncomment.
Starting with a list of tests is done by J.B.Rainsberger
on his course introduction to TDD

In the other hand maybe restricting to an initial list of test is not a good way to lead to a solution.
I tried writing the test that makes more sense for the current tdd-cycle and then I reached a solution (updated this in the description).

your solution seems to be a valid one I didn't try it.
Thanks for taking the time to read and solve this problem.