← Bob Recipes

Modernize a legacy application

Plan-first modernization: dependency map, risk-ordered steps, characterisation tests, then code.

AdvancedMulti-dayCOMMUNITY ANALYSISJavaMavenOpenRewrite

Prompt

We are modernizing a legacy application. Phase 1 only: produce a dependency and risk map, then an incremental migration plan ordered by risk, with validation criteria and a rollback point per step.
Do not modify code in this phase. Explicitly list assumptions you had to make.

Problem

Big-bang migrations get rejected in review and abandoned.

Goal

A migration plan the team can execute over weeks in reviewable slices.

Context

A legacy service with thin tests and multiple internal consumers.

Expected Output

Dependency map, risk-ordered step list, validation criteria, assumptions.

Steps

  • Run phase 1 (plan) and get team agreement
  • Generate characterisation tests for the riskiest paths
  • Execute one migration step per pull request
  • Re-run dependency scanning after each step

Validation

  • Full build per step
  • Behaviour diff in staging
  • Consumer contract tests

Security Considerations

  • Dependency upgrades change the vulnerability surface in both directions
  • Re-scan after every step

Lessons Learned

  • Refusing code changes in phase 1 is the single highest-leverage constraint
  • Characterisation tests lock in current bugs on purpose