Test Your State Machine Monstrosities
Adam Fraser-Kruck - Watch Now - EOC - Duration: 02:00

Let’s efficiently unit test and integration test our state machine monstrosities! The general approach works with multiple unit testing frameworks, but Google Test has some distinct advantages, so we’ll use that. We’ll laugh, we’ll cry, and in the end, we’ll achieve full hierarchical state transition and behavior coverage in an easy-to-maintain manner.
The general concept works with any type of state machine (hand written, code generated, C, C++, Python…).
Topics include:
- “Hand of God” vs “natural flow” testing — pros and cons
- Unit testing and integration testing approaches
- Testing embedded C state machines
- Testing embedded C++ state machines
- Spies, fakes, mocks, and stubs
- Google Test tips: fixtures, mocks, scoped traces, and more