Firedancer - Test Driven Development for Device Drivers
Technologies like microdrivers have simplified the development of device drivers by providing protection against system crashes and allowing the use of programming tools such as debuggers. However, newer software engineering techniques like Test Driven Development are still not available for developing device drivers because of the stateful nature of most devices. Additionally, hardware/software codesing often causes a "chicken-and-egg" problem, because driver testing is not possible without a device and vice versa. With Firedancer we show how Test Driven Development for PCI device drivers works by extending a virtualization software (KVM/Qemu).
Firedancer is a lightweight extension for QEMU/KVM which makes it easy to rapidly prototype and deploy virtual PCI devices. A device can be specified in C (programming language) and independently deployed from the real hardware as a software library to the driver programmer. Afterwards, QEMU/KVM serves as a fast execution platform for the emulated device without the need to change the driver code. The tested driver should work normally while driving an emulated device. The tracing infrastructure of Firedancer supports debugging of device drivers. In fact, Firedancer can partially replace an expensive hardware PCI tracer device. Furthermore, Firedancer supports the implementation of tests for test driven device driver development. The resulting test suite can serve to maintain a "nightly test" run during the maintenance period of the device driver. Finally, our approach supports testing and verifying the remaining kernel-space code of a microkernel or microdriver.
 D. Eschweiler and V. Lindenstruth, “Test Driven Development for Device Drivers and Rapid Hardware Prototyping,” in Proceedings of the 8th IEEE International Conference on Software Testing, Verification and Validation (ICST), 2015.
Dominic Eschweiler is the maintainer of Firedancer.