3 ms·
Unit tests are a tool for understanding. Their value does not come from targeting coverage and formal correctness. At the end of the day, we have to convince o
by michaelfeathers 13y ago
Unit tests are a tool for understanding. Their value does not come from targeting coverage and formal correctness.
At the end of the day, we have to convince ourselves that our code works. We can do that by looking at it and seeing what it does, and by writing tests to demonstrate that we are not lying to ourselves about what we've reasoned.
Write tests for things that you are curious about or don't understand - those are thing things that need to be tested.