Yesterday, I was fighting a pretty nasty bug, all the unit tests passed
I knew there was a corner case not covered by the unit tests but what was it?
Reviewing my assumptions, the key: hw was not exactly sync
Need to test for data 1/
Now, I just needed to modify the code to make that test pass and not make the rest of the tests fail
The best part, i could work with very small and manageable arrays (instead of the 2GB array) 2/
Let's see why this worked:
1) there were 35 unit tests that tested the "happy path" and some corner cases
2) I could confidently modify the code and know I would be alerted if I broke existing code
3/
As usual, the real benefit of tests is found once you already have several unit tests, so, take the leap of faith and start creating some
4/
And that is why I love Test Driven Development
Thanks for following along :)
5/5