Chapter 5 exercises: better testing