Presented at ACCU Cambridge Meetup on 4th September 2019.
You've inherited some legacy code: it's valuable, but it doesn't have tests, and it wasn't designed to be testable, so you need to start refactoring! But you can't refactor safely until the code has tests, and you can't add tests without refactoring. How can you ever break out of this loop?
I present a new C++ library for applying Llewellyn Falco's "Approval Tests" approach to testing cross-platform C++ code - for both legacy and green-field systems, and a range of testing frameworks.
I describe its use in some real-world situations, including how to quickly lock down the behaviour of legacy code. I show how to quickly achieve good test coverage, even for very large sets of inputs. Finally, I also describe some general techniques I learned along the way.