# Pin It Down: Tests for Code You Didn't Write

Before changing old code that has no tests, write tests that record what it does today, right or wrong, so any change that alters its behavior shows up at once; these characterization tests pin the code down, surprises included, and the surprises become questions for the people who know the business.

![Cheat sheet: Pin It Down: Tests for Code You Didn't Write](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/4dddd18f0c7a43538243627bd7481d1b.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: Approval Testing, Characterization Test, Legacy Code, OOP, software-development
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-characterization-tests-cheat-sheet
