March 2015
Intermediate to advanced
236 pages
5h 26m
English
Our unit tests should provide lasting and trustworthy documentation on the capabilities of the classes we build. Tests provide opportunities to explain things that the code itself can’t do as easily. In a sense, tests can supplant a lot of the comments you might otherwise feel compelled to write.
The more you combine cases into a single test, the more generic and meaningless the test name becomes. A test named matches doesn’t tell anyone squat about what it demonstrates.
As you move toward more-granular tests, each focused on a distinct behavior, you have the opportunity to impart more meaning in each of your test names. Instead of suggesting what context you’re going to test, ...
Read now
Unlock full access