Closed Brett208 closed 3 years ago
As for test driven development, yes, generally your write the tests first and verify the code fails, then fix the code. It's a way of verifying the test code actually works and tests what you think it's testing.
With that said, I usually commit the fix first, and then commit the new tests second. That way I avoid committing broken code where unit tests don't pass.
Guess if I was doing this correctly according to test driven development, I should have written the unit test first to verify it would fail and then write the corrective test...