31
Should you follow TDD?

Red : It involves writing a function to test a feature which you’re going to add in the project/app. It’ll fail onbviously and you get a red error message.
Green : Next up, we add the functionality/feature to the app in-order to pass the test and you get a green success message.
Refactor : Now we need to look at the code and refactor it to ensure it’s well-written, and easy to read/understand.
You repeat the same process over and over again until you have added all the required functionality.
Utility Functions : If I’ve a function which has a certain set of inputs or ouputs, and of a certain complexity. I prefer setting up a test for it.
Well defined UI : If I’m trying to achieve certain UI goals in my app, I prefer setting up a test for it.
Fixing a bug : This also helps me in replicating the issue so that I can understand the problem better.
When you’re learning about new features and implementation (aka exploratory coding), I wouldn’t follow this cycle.
It is waste of your precious time if you’re testing the implementation details.