Chapter 7. Test-driving the unpredictable

Horses are predictably unpredictable.

Loretta Gage, the oldest student at Colorado State University’s College of Veterinary Medicine

So far, we’ve dealt with data-access code, web components, and regular business logic. The common denominator for what we’ve seen so far is that this type of code executes somewhat detached from the underlying platform and, most notably, executes in a predictable manner. Not all code is like that. In this chapter, we’ll drop the gloves and go knuckle-to-knuckle against specific domains of programming in Java, which involve unpredictable functionality and are typically somewhat more complex to work with in a test-first manner:

  • Time-dependent functionality
  • Multithreaded ...

Get Test Driven: Practical TDD and Acceptance TDD for Java Developers now with the O’Reilly learning platform.

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