Chapter 16Behavior Smells

Smells in This Chapter

      Assertion Roulette 224

      Erratic Test 228

      Fragile Test 239

      Frequent Debugging 248

      Manual Intervention 250

      Slow Tests 253

Assertion Roulette

It is hard to tell which of several assertions within the same test method caused a test failure.

Symptoms

A test fails. Upon examining the output of the Test Runner (page 377), we cannot determine exactly which assertion failed.

Impact

When a test fails during an automated Integration Build [SCM], it may be hard to tell exactly which assertion failed. If the problem cannot be reproduced on a developer's machine (as may be the case if the problem is caused by environmental issues or Resource Optimism; see Erratic Test on page ...

Get xUnit Test Patterns: Refactoring Test Code now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.