DEV Community

Discussion on: My personal take on TDD

Collapse
 
joelnet profile image
JavaScript Joel

I have run into a similar experience. There is code I write that I consider "exploratory code". You don't really know the API's that you will be calling or how to even solve the problem. You need to write some code and see how things react. To see if what you are doing is even possible. In this situation, I don't know what my test should look like.

I have also found that after writing my code, I will refactor it a bit. This tends to changes in the tests.

When I have done test first, I found myself deleting and rewriting a lot of unit tests after the code is complete. Sometimes entire classes and their tests were removed.