Safeguard
Developer Tools•

How do you test a major version upgrade in small steps?

A major version upgrade can break many things at once. Break it into small, testable steps with an adapter, a compatibility pass and a staged rollout.

Safeguard Security Team
4 min read

Test a major version upgrade by splitting it into small steps that each ship and pass tests on their own: first adopt the latest release of the current major, then fix deprecation warnings, then hide the library behind an adapter, then switch the version, then roll out in stages. One giant pull request is the riskiest way to do it.

Why majors are different

Semantic Versioning says a major version increments when incompatible API changes are made. Unlike patch and minor releases, the maintainer is allowed to remove or change things your code uses. That is why the same checklist that works for a patch bump is too thin here.

The sequence

  1. Read the migration notes first. List removed APIs, changed defaults and new minimum runtime versions. Search your code for each.
  2. Upgrade to the newest release of your current major. Maintainers often add deprecation warnings and bridge APIs there. This step is usually a minor bump with low risk.
  3. Turn warnings into failures in CI. Fix deprecations one module at a time, shipping each fix. These changes work on both the old and the new major where possible.
  4. Add an adapter. Route calls to the library through a thin wrapper of your own, so the change is concentrated in one place. This is the first stage of branch by abstraction, which Fowler describes as making a large change gradually while still releasing regularly.
  5. Write characterization tests for the wrapper. See characterization tests before upgrading legacy code.
  6. Switch the version in a branch or flagged build. Run the full suite. Fix only what breaks.
  7. Smoke test, then stage the rollout. Compare the new build with a control.
  8. Remove shims. Delete the adapter layers and temporary flags you added once everything runs on the new major.

Scope the risk with a table

Change type in the new majorWhere to lookTest
Removed or renamed APICompiler errors, searchUnit tests
Changed default valueConfig, docsIntegration tests with explicit values
New minimum runtimeBuild files, base imageSmoke test on the new runtime
Behavior change without API changeRelease notesCharacterization tests
Dropped platform supportInstall and CI matricesCI on each supported target

The hardest items are the behavior changes with no compile error. They are why the characterization and integration tests matter more than the compiler.

Handling a blocked upgrade

Sometimes a dependency of yours holds you on the old major. Options include upgrading the blocker first, using a package manager override for a tested range, carrying a patch, or replacing the blocker. Each carries cost and should be recorded with a review date. For the vocabulary, see bump, pin, override, replace, fork and remove defined.

Estimating the work

Use your own history. If the last two majors of a similar library took three weeks each, plan for that and not for a day. See estimate a dependency upgrade from your own past upgrades.

When a security fix forces the issue

If the sole fixed version is on a new major, the steps are the same but the clock is shorter. Consider a temporary mitigation, such as disabling the vulnerable feature or blocking the input at the edge, while you finish the steps. Safeguard's breaking-change-aware remediation approach is covered in breaking change aware remediation, and its fix pull requests are off by default with every category on Manual.

Quick check

Should a major upgrade be one pull request?

Rarely. Small prerequisite pull requests that work on both versions reduce risk and make the final switch small enough to review.

What if the new major has no migration guide?

Treat that as a risk. Compare the public API between versions, read the changelog, and lean harder on characterization tests and a slow rollout.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.