Advanced Unit Testing in the Hedron Microkernel
- Track: Microkernel and Component-based OS devroom
- Room: D.microkernel
- Day: Saturday
- Start: 10:50
- End: 11:20
- Video with Q&A: D.microkernel
- Video only: D.microkernel
- Chat: Join the conversation!
Concurrent code is hard to get right, but at the same time also hard to test. It gets worse when hardware interaction is required. This leads to a comparatively poor culture of unit testing in kernel code, where both come together.
In this talk, I’m going to highlight one particular method of unit testing the page table manipulation code in Hedron, a microkernel written in C++ specially geared towards virtualization workloads. This code safely modifies page tables that are concurrently used by the CPU. Usually, unit tests only check whether the state after an operation meets the expectation of the programmer. In contrast, Hedron employs completely deterministic unit tests that show that the CPU will always see a valid virtual memory mappings while a page table manipulation is in progress (for the tested cases).
The goal of this task is to show that unit tests can be a powerful tool even for properties of code that are usually not deemed unit testable.
Speakers
Julian Stecklina |