3.1. Introducing the behavior-testing paradigm

Let’s start with a full example of software testing. Imagine you work as a developer for a software company that creates programs for fire-control systems, as shown in figure 3.1.

Figure 3.1. A fire-monitoring system controlling multiple detectors

The processing unit is connected to multiple fire sensors and polls them continuously for abnormal readings. When a fire is discovered, the alarm sounds. If the fire starts spreading and another detector is triggered, the fire brigade is automatically called. Here are the complete requirements of the system:

  • If all sensors report nothing strange, the system ...

Get Java Testing with Spock now with O’Reilly online learning.

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