6.4. Shallow promises

We recently had elections where I live. Leading up to the vote, you could see politicians debating and interviewing on pretty much all of the national TV channels. You’ve probably heard enough politician jokes to have formed the same perception that politicians tend to make shallow promises that they don’t end up keeping—always for good reasons, but still.

Programmers can be like that, too. Every now and then when you’re browsing test code, your senses start hurting like you were Spider-man because you’re looking at a test that promises much more than it delivers. This is a problem for the obvious reason of programmers being misled by an untrustworthy test.

There’s more than one way to perpetrate this test smell, so we’ll ...

Get Effective Unit Testing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.