← Use Cases

Modernizing a legacy Java application

Plan and execute an incremental upgrade of an old Java service — dependency mapping, framework migration and test coverage first.

AdvancedCOMMUNITY ANALYSISJavaSpring BootMavenJUnit

Prompt

You are helping modernize a Java 8 application. First produce a dependency and risk map. Then propose an incremental migration plan to a current LTS Java release, ordered by risk, with a rollback point after each step. Do not change code yet.

Problem

Legacy services block platform upgrades but nobody owns the migration plan, and the test suite is too thin to make changes safely.

Scenario

A Java 8 / Spring 4 service with 60k lines, no integration tests and three internal consumers.

Architecture

  • Characterisation tests first, migration second
  • Dependency map before any code change
  • One rollback point per migration step

Why Bob?

The bottleneck is comprehension, not typing. Asking for an ordered, risk-annotated plan produces a document the team can argue about — which is the real deliverable.

Prompt

Copy the prompt above and attach `pom.xml` plus the module list.

Bob Workflow

  • Inventory dependencies and flag unmaintained ones
  • Group changes into reviewable steps
  • Generate characterisation tests for the riskiest classes

Generated Result

A migration plan with steps, risk ratings and validation criteria, plus a first batch of tests around the payment and auth paths.

Validation

  • Full build on each step
  • Behaviour diff against the old service in staging

Security

Upgrading dependencies changes your vulnerability surface both ways. Re-run dependency scanning after every step.

Lessons Learned

  • Refuse code changes until the plan is agreed — otherwise the diff is unreviewable
  • Generated tests capture current behaviour, including current bugs; that is the point

Resources

  • Java LTS migration guides
  • OpenRewrite recipes