4 ms·
They serve a couple of purposes. 1. That the code you have written or are using behaves in a way you expect, for the inputs you expect. 2. As the code changes
by tjpick 16y ago
They serve a couple of purposes.
1. That the code you have written or are using behaves in a way you expect, for the inputs you expect.
2. As the code changes over time, a regression test suite helps ensure that assumptions from an earlier point in time still hold true.
- briandoll 16y ago3. That the design of the API makes sense to the user of that new code. If you practice TDD (Test Driven Development), you first write the test(s), then code to make those tests pass. You're much less likely to end up with SomeClass.some_reference.a_really_bad_name(with,lots,of,required,arguments) when you first think of the caller, rather than of the method itself.