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: