Dependencies on Hardware and OS

Let’s see how we can design and test the light-scheduling portion of a home automation system. The component that handles light scheduling is called the LightScheduler, shown in context in Figure 15, Initial light scheduler design. The LightScheduler has transitive dependencies on the hardware and the operating system (OS). If left unbroken, these dependencies mean that the light scheduler will be testable only in the target hardware.

The design works like this. The client of the LightScheduler is in the AdminConsole subsystem. The AdminConsole instructs the LightScheduler to turn on and off the lights at specific times during the week. Every minute, the LightScheduler is pinged through an OS callback from ...

Get Test Driven Development for Embedded C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.