DEV Community


Discussion on: When do you write your tests?

rashidi profile image
Rashidi Zin

I often practice TDD when doing bug fixing. I would add a new test that simulates the filed bug with an expectation that it will fail.

I will then proceed to provide the fixes and once done I will rerun the test and this time expecting it to pass. Occasionally I would do the same in implementing new features provided there's a clear requirement of it.