~/talk

Quickly Testing Legacy C++ Code with Approval Tests

Talkat CppCon 2019 · 2019-09-15..09-20· [testing, c-and-cpp]
slides:none on file

Shows how to lock down legacy behavior fast using ApprovalTests.cpp: a header-only C++11 library that plugs into Google Test, Catch and doctest, generates received/approved files (it always fails first run), and launches GUI diff tools (Araxis/Beyond Compare) via uses differencing reporters. Demonstrates verify/verifyAll and verifyAll combinations up to nine for Cartesian-product input testing, custom writers/comparators for images, regex “scrubbers” to normalize dates, placing approved files in VCS, and CI-friendly workflows. Useful if you need quick golden-master coverage before refactoring.

AI-written summary · about

  1. 0:00Introduction
  2. 1:35Clares background
  3. 2:37Backstory
  4. 6:33What is Legacy
  5. 8:58Locking down the current behavior
  6. 9:49Golden Master Testing
  7. 11:35Thoughts on Golden Master
  8. 12:26Approval Tests
  9. 14:10Starter Project
  10. 15:20Download Single Header File
  11. 16:02Code Examples
  12. 21:33Approval Tests vs Test Framework
  13. 22:59Approval subdirectory
  14. 23:51Questions
  15. 29:22Documentation
  16. 31:06Legacy Code
  17. 32:46Legacy Thing
  18. 33:17Consistency
  19. 34:38Writing Tests
  20. 37:33Formatting
  21. 42:40No Discard
  22. 43:47Convention Over Configuration
  23. 44:17Stable Outputs
  24. 45:36Common Challenges
  25. 46:11Example
  26. 47:18Encapsulation
  27. 48:46Approval Test Example
  28. 50:37Differencing Tools
  29. 50:50Summary
  30. 51:21Thank you
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.