Skip to Content
Effective Unit Testing
book

Effective Unit Testing

by Lasse Koskela
February 2013
Intermediate to advanced content levelIntermediate to advanced
258 pages
7h 26m
English
Manning Publications
Content preview from Effective Unit Testing

2.3. It’s not good if it’s testing the wrong things

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. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Art of Unit Testing, Second Edition

The Art of Unit Testing, Second Edition

Roy Osherove
Testing with JUnit

Testing with JUnit

Leonard Przybylski, Frank Appel

Publisher Resources

ISBN: 9781935182573Publisher SupportOtherPublisher WebsiteErrata PageSupplemental ContentPurchase Link