18.1. Principles of Test DesignIn this chapter, we draw on three main principles of test design.
Because a test is for communicating ideas, it needs to
A set of tests needs to be comprehensive. Because a test will change as the business and the software requirements change, it needs to
Because a test is automated, it
See [MSA03] for a good introduction to test automation in the context of agile software development. In the following sections, we discuss various approaches to the design of Fit tests. We also discuss various poor test designs, called smells, and what we can do about them. The idea of smells as a sign of trouble is a wonderful metaphor coined by Massimo Arnoldi and made popular by Martin Fowler et al. in [Fow99]. Smells are "indications that there is trouble that can be solved by refactoring" [Fow99, p. 75]. For our purposes, a refactoring of a Fit test or table is a change to the contents or structure of that table to improve the expressiveness or some other characteristic of that test. As we see throughout this chapter, some smells are major and need to be dealt with as soon as possible. Other smells are minor and are simply an indication that something may need to be reconsidered. |