Assertion Roulette doesn’t mean that multiple assertions are bad. When I coach teams or individual developers in test-driven development (TDD) or unit testing, I frequently encounter a particular notion: Multiple assertions are bad. A test must have only one assertion. That idea is rarely helpful. Let’s examine a realistic code example and subsequently try to understand the origins of the notion. Outside-in TDD Consider a REST API that enables you to make and cancel restaurant reservations.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Mark
Contact Mark, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack