DEV Community

Discussion on: What are your thoughts on testing and TDD?

Collapse
jaedle profile image
jaedle • Edited on

I kindly disagree: The tests should not affect the implementation.

I use TDD all the time (on my job and 90% of my hobby projects) and the most I think I like about it:
the structure of the test can be completely decoupled from the structure of the implementation:
Maybe the test has 2 classes, but the implementation has 1, 2 or even 15. I always test the outside behavior of the module, never private details.

Thread Thread
lifelongthinker profile image
Sebastian

I think we actually agree, and there is just a misunderstanding. I absolutely agree with what you say there.

Let me rephrase: The test should be used to guide you during your implementation phase (exploring the solution domain, especially the refactoring part).

Of course, tests and implementation should be decoupled.