Characterization Testing: 6 Checks Before a Legacy Change
Use characterization testing before you change a legacy application whose behaviour your team cannot fully explain. Capture the current output for a small set of important inputs, review it with the business owner, then run those same cases after the change. Start with one workflow you need to protect, such as a report export, a price calculation or a customised form.

The useful deliverable is a repeatable comparison that helps someone approve a change. Ask your engineer to show the input, the previous result, the new result and the reason for each difference. That gives a founder or product owner something more concrete than a promise that the refactor is safe.
What does a characterization test capture?
A characterization test records what existing software does for a chosen input. It creates a baseline for later changes, including behaviour that was never written into a specification. A surprising result still needs a human decision: preserve it for compatibility, correct it deliberately or investigate it further.
Michael Feathers explains the technique through small tests that reveal an unfamiliar function’s output. For a buyer, the practical question is simple: which behaviour would you notice, and care about, if your new team changed it?
Keep this scope smaller than your whole legacy-modernisation strategy. Characterization tests help protect a selected change; choosing whether to refactor, replace or retire a system is a separate decision.
Six checks before you approve the change
1. Pick a workflow with a business consequence
Choose a narrow path that the planned change will touch. A monthly report, a customer-specific discount or a form that creates an order gives you a concrete starting point. Write down who uses its result and what would go wrong if that result changed.
Avoid making the first task “cover the legacy system with tests”. Give the engineer a boundary: one export, one calculation or one request through an interface. Expand it when the first comparison is useful.
2. Fix the inputs and the environment
Use repeatable test data, a recorded application version and controlled external dependencies. Replace private customer records with authorised synthetic fixtures. Hold dates, random identifiers and other unstable values constant where they would otherwise obscure a meaningful change.
Keep a short note of what the fixture represents. An empty response, a missing field and a zero value may require different cases. A test can only describe the inputs it actually exercises.
3. Run the old code and review the result
Capture the real result before changing the implementation. Save a readable value, file or screen comparison. Have the person who understands the workflow inspect it and flag known defects separately.
Jason Swett’s worked example shows how observing an existing return value can establish a starting point for a test. Your team can use the same principle without guessing what the old application ought to return.
4. Make the comparison easy to read
Keep meaningful fields and their units visible. Normalise irrelevant timestamps or ordering only when that variation does not matter to users. If line order affects a downstream import, preserve it in the comparison.
Snapshot and approval-testing tools can help capture larger outputs. Nicolas Carlo describes why readable output and human review matter. Agree who may accept a changed baseline; a bulk “update snapshots” command should never replace that decision.
5. Prove that the test notices a relevant change
In the test environment, deliberately alter an important field or branch and check that the test fails. Then restore it. If a change to the report total or the selected status passes unnoticed, improve the assertions before treating the test as useful protection.
This check gives you evidence about the test itself. Ask to see the failing comparison as well as the final passing run.
6. Separate refactoring from an approved behaviour fix
Make the intended change, run the fixtures again and review every difference. If the goal is to reorganise code while preserving behaviour, an unexplained difference needs investigation. If the goal includes correcting a known defect, record the approved new result and add a test for that requirement.
Keep the change small enough to explain and reverse. The same evidence can support a maintenance takeover or a framework upgrade, alongside the deployment and rollback checks in your application maintenance checklist.

Worked example: a report export changes format
Suppose an inherited reporting function exports an amount, a status and an optional reference. The following is an illustrative fixture, not a client result. The business owner wants the next release to preserve the existing export contract.
| Fixture | Captured output | Review question |
|---|---|---|
| Normal record | amount_minor=1250; status=paid |
Does the consumer expect integer minor units? |
| Missing optional reference | reference="" |
Must it remain an empty string rather than null? |
| No matching records | Header row, no data rows | Does the receiving system require the header? |
| Proposed refactor output | amount="12.50" |
Has the interface changed, even though the displayed amount looks equivalent? |
The engineer captures each result from the current version and compares it with the changed version. A switch from integer minor units to a formatted decimal string deserves review because another system may parse the field differently. The test exposes the difference; the workflow owner decides what the contract should be.
Where our own project work points us
One commercial brief we received involved a live application with heavily customised interface components and a difficult UI-library migration. The brief called for specialist frontend ownership. It illustrates why a migration brief needs a list of behaviours to preserve, including validation, saved state and the paths people use through the interface.
In a separate technical planning meeting, our team flagged inconsistent data-provider formats as a reporting risk. That observation points to another useful test boundary: capture representative responses before changing the adapter or reporting code. An absent field, a different number format and an empty response deserve separate review. Both source records describe a brief or a planning risk; neither records a completed testing outcome.

What to ask for at the handover
Use this acceptance table in the task brief. It makes responsibility visible without prescribing one test framework.
| Evidence | What you should receive | Owner |
|---|---|---|
| Scope | Workflow, application revision and selected cases | Product owner and engineer |
| Baseline | Safe fixture data and readable captured results | Engineer |
| Test sensitivity | A relevant deliberate change that causes a failure | Technical reviewer |
| Difference decision | Preserve, investigate or approve each changed behaviour | Named workflow owner |
| Repeatability | Instructions to rerun the checks and find the results | Receiving team |
For a wider transfer of responsibility, combine this evidence with the access and dependency inventory in our software maintenance takeover guide. A passing comparison cannot establish security, load capacity or correctness for cases you have not covered.
Characterization testing FAQ
What is characterization testing?
Characterization testing records how existing software behaves for selected inputs so that later changes can be compared with that baseline.
Does a characterization test prove the old code is correct?
No. It captures observed behaviour. A workflow owner must review known defects and approve any intended change to that behaviour.
How is it different from a regression test?
Characterization describes how you establish a baseline when existing behaviour is poorly understood. The resulting tests can become part of the regression checks used for later changes.
Should we capture the whole application at once?
Start with one important workflow affected by the planned change. Expand the cases when the first comparison is useful and repeatable.
Who should approve a changed output?
Name the person responsible for the workflow or interface contract. The engineer supplies the comparison and explains the change; the owner approves the intended behaviour.
Start with the next change you need to make
Bring the workflow, the planned change and an example of the output you need to preserve. Powercode’s software maintenance and support team can discuss the application and the engineering work involved. Agree the first test boundary and the acceptance evidence before widening the scope.