February 2013
Intermediate to advanced
258 pages
7h 26m
English
More than once I’ve concluded a journey of reading and debugging code to find the cause for an undesirable system behavior at almost the same place I started looking. A particularly annoying detail overlooked in such a bug-hunt is the contents of a test. The first thing I tend to do when digging into code is to run all the tests to tell me what’s working and what’s not. Sometimes I make the mistake of trusting what the tests’ names tell me they’re testing. Sometimes it turns out that those tests are testing something completely different.
This is related to having a good structure—if a test’s name misrepresents what it tests, it’s akin to driving with all the road signs turned the wrong way. ...