“It’s A Bug Hunt”
Armor Plate Your Unit Tests
Unit Testing serves many purposes, but fundamentally it's about bugs: finding them, fixing them, keeping them out of your code base.
This talk is a detailed discussion of how to write unit tests that are good *tests*; that is, unit test cases that are complete, accurate, and thorough. We can think of unit tests as our laboratory equipment for carefully examining our code and measuring a particular property (existence of bugs) with care and precision; or we can think of them as bug-hunting gear that that keeps us safe when we have to venture into the dark and dangerous parts of our code base.
Over the past several decades, the software community has learned, usually the hard way, many principles and best practices for unit testing, but these are documented across a wide variety of books, blogs, and talks. This talk will discuss, summarize, and try to simplify what we have learned about making our unit tests effective at finding bugs, describing them, and removing the little critters from our code base.
We will look at examples, consider test organization, and get into the nitty-gritty of edge and corner cases. We will also look at a case study of a famously ill-fated debugging expedition, with the goal of learning from their mistakes -- better than learning from your own! -- and, incidentally, (re)introducing some important cultural memes that no bug-hunters should be without.
Dave Steffen
Dave Steffen completed his Ph.D. in theoretical physics at Colorado State University in 2003, and promptly changed course for a career in software engineering. He has worked primarily in defense and aerospace, and is currently a Principal Engineer at SciTec Inc.'s Boulder office. For reasons unknown, he has turned out to be the expert, champion, and occasional street-corner evangelist for unit testing at most of the companies he has ever worked at.