Production C++ code often hides small, but deeply complex, algorithms inside layers of engineering -- APIs, lifetimes, error handling, integration, logging, and glue code. While we test classes and systems, we rarely test the algorithm itself in isolation.
Off-by-one errors and broken or missing invariants can survive extensive pre-production testing. Line coverage does not imply branch coverage. Branch coverage does not imply coverage of algorithmic corner cases. Testing through a wide public API often obscures the mathematical structure of the problem, making subtle bugs difficult to discover through multiple layers of abstraction.
This talk explores how to extract an "algorithmic core" from a larger component. Its correctness is fundamentally mathematical and largely language-agnostic rather than C++-specific.
Using examples such as substring matching, topological sorting variations, and lazy evaluation on trees, we will examine how problem corner cases differ from implementation corner cases, and how easily some of them are skipped.
We will discuss:
View Slides
Egor Suvorov is a senior software engineer at Bloomberg, where he works on DataLayer, the company's real-time streaming data transformation pipeline. Previously, he led a freshman C++ course, where his students uncovered and reported dozens of bugs in various C++ tools. Egor was also part of the winning team of the ACM ICPC 2014 World Finals.