2 ms·
TDD has nothing to do with Testing and everything to do with Development. It is a development methodology (test driven), not a testing methodology. It is a me
by njharman 6y ago
TDD has nothing to do with Testing and everything to do with Development. It is a development methodology (test driven), not a testing methodology.
It is a means to focus development and structure code into isolated "units". And it facilitates wholesale, brutal refactoring and deletion of code because it provides confidence that; tests pass (external interface remains consistent), tests fail (you need to fix your refactor or update external interface), your tests are poor / incomplete.
By writing tests firstish, you make it real hard/noticeable/laborious to write YANGI, sprawling, or over engineered code. If your tests are hard to write, it means your code is interconnected, doing too much, not layered properly, etc. Too many people don't realize this and struggle with tests / spend way too much time writing equally complex tests. When they should realize all this pain is the same pain that will occur when you try to fix/expand/maintain your code. Fix your code! not the test.