AI Coding Agents on a Legacy Java Monolith: What Actually Worked

In this illustrative controlled trial on a legacy Java monolith, GPT-5.3-Codex-Spark completed the largest share of the migration backlog unaided at 74 percent, with 12 of 15 modules accepted first pass and an 80 percent CI pass rate. Opus 5 completed 68 percent with 11 of 15 accepted and a 73 percent CI pass rate, delivering a more balanced result on complex refactoring. Muse Code completed 57 percent with 8 of 15 accepted, a 60 percent CI pass rate and the highest median rework at 4.7 hours per module. These are illustrative pilot figures for editorial framing, not a verified benchmark.
Commercial Expertise
Need help with AI & Machine Learning?
Ortem deploys dedicated AI & ML Engineering squads in 72 hours.
Next Best Reads
Continue your research on AI & Machine Learning
These links are chosen to move readers from general education into service understanding, proof, and buying-context pages.
AI & ML Solutions
Move from concept articles to real implementation planning for copilots, RAG, automation, and analytics.
Explore AI servicesAI Agent Development
See how Ortem builds autonomous workflows, tool-using agents, and human-in-the-loop systems.
View agent serviceAI Product Case Study
Study a production AI platform with architecture, launch scope, and operating model context.
Read case studyMost AI coding-agent comparisons measure how quickly a model can generate a feature in a clean repository. Enterprise engineering teams face a different problem: upgrading and refactoring large, interdependent applications where an apparently correct patch can fail CI, break an undocumented integration, introduce a data risk, or make future maintenance harder.
Ortem Technologies LLC ran an illustrative controlled evaluation of Opus 5, GPT-5.3-Codex-Spark, and Muse Code against the same legacy Java monolith. The goal was not to determine a universal "best AI coding tool." It was to measure the work that matters in a real modernisation engagement: how much migration could be accepted without engineers materially rewriting the agent's production code.
Read this first. Results are illustrative pilot data created for article framing, not a verified benchmark. A production study should replace these placeholders with logged task outcomes, build reports, reviewer notes, and engineer-hour tracking.
Short answer: In this illustrative trial, GPT-5.3-Codex-Spark completed the largest share of the migration backlog unaided, at 74%. Opus 5 delivered a close, more balanced result for complex refactoring. Muse Code was economical for contained changes but needed more architect and engineer intervention on cross-module work.
Benchmark methodology
Every agent received the same conditions:
- The same anonymised legacy Java codebase and baseline commit
- The same 15-task modernisation backlog
- The same CI environment, build commands, time budget, and test suite
- The same limited architecture notes and clarification policy
- The same review gates: build, automated tests, security scan, architecture review, and regression checks
A task was marked unaided accepted only when the agent-produced patch passed every defined gate without an engineer modifying production code. A patch that compiled but failed contract testing, required business-logic correction, or created an unsafe migration did not receive full credit.
Headline results
| Agent | Migration completed unaided | Modules accepted first pass | Engineer-hours saved per accepted module | Median human rework per module | CI pass rate |
|---|---|---|---|---|---|
| GPT-5.3-Codex-Spark | 74% | 12 of 15 | 15.6 hours | 2.4 hours | 80% |
| Opus 5 | 68% | 11 of 15 | 14.2 hours | 3.1 hours | 73% |
| Muse Code | 57% | 8 of 15 | 10.8 hours | 4.7 hours | 60% |
Figure 1. Illustrative benchmark results: GPT-5.3-Codex-Spark achieved the highest unaided migration completion rate, while Opus 5 delivered comparable value across legacy-code refactoring tasks.
Results are illustrative pilot data created for article framing, not a verified benchmark. A production study should replace these placeholders with logged task outcomes, build reports, reviewer notes, and engineer-hour tracking.
Which tasks were evaluated?
The backlog combined predictable upgrade work with high-risk modernisation tasks:
| Task category | Examples |
|---|---|
| Runtime and dependency upgrades | Java LTS migration, Maven and Gradle modernisation, CVE remediation |
| Framework work | Spring upgrade, security configuration updates, API compatibility checks |
| Refactoring | Domain-service extraction, controller and service decoupling, shared-model cleanup |
| Data and jobs | Schema migration, rollback plan, legacy batch-job conversion |
| Quality and operations | Test coverage, observability, Docker, CI/CD hardening, performance remediation |
This mix matters because AI agents generally perform better when requirements are explicit and the change is local. Their reliability falls when they must infer hidden business rules, reason about database state, preserve undocumented interfaces, or make architectural trade-offs.
Where the agents broke
| Agent | Failure point | What happened | Required intervention |
|---|---|---|---|
| Opus 5 | Spring-security upgrade | Changed legacy filter sequencing and interrupted an existing authentication flow | 5.5 hours |
| Opus 5 | Database migration | Produced a correct forward migration but omitted a robust rollback path | 2.0 hours |
| GPT-5.3-Codex-Spark | Batch-job modernisation | Preserved main output but allowed duplicate processing after retries | 3.8 hours |
| GPT-5.3-Codex-Spark | Performance task | Refactor passed tests but created a database query-plan regression under load | 4.2 hours |
| Muse Code | Domain-service extraction | Created circular dependencies by over-extracting shared classes | 6.0 hours |
| Muse Code | Test generation | Added tests with weak assertions that did not catch a seeded regression | 2.9 hours |
Every one of these defects passed the agent's own checks and was caught downstream — by integration testing, DBA review, replay testing, load testing, architecture review, or mutation testing. The failures cluster in the same places: filter ordering, rollback steps, retry semantics, query plans, module boundaries, and assertion depth. These are all properties of a system rather than properties of a file, which is exactly what a model working from local context tends to miss.
What engineering leaders should take from this
AI coding agents can reduce the cost and elapsed time of a Java modernisation programme, but "generated" does not mean "ready to merge." The most reliable operating model is agent-assisted delivery with human acceptance gates:
- Use agents for repository discovery, upgrade planning, dependency changes, test drafting, repetitive refactoring, and documentation.
- Require senior engineers for security boundaries, data migrations, performance-sensitive paths, and architecture decisions.
- Measure net hours saved after reviews and remediation — not code volume, token count, or the speed of an initial patch.
- Preserve a complete audit trail: task prompt, branch, code diff, build logs, scan output, reviewer findings, and final outcome.
Modernising a complex platform and want the review gates designed before the agents start writing code? Ortem Technologies combines AI-enabled development with hands-on architecture, cloud and DevOps delivery through its AI and ML solutions practice and application modernization service. See our AI-powered application modernization guide, or book an architecture review →.
About Ortem Technologies
Ortem Technologies is a premier custom software, mobile app, and AI development company. We serve enterprise and startup clients across the USA, UK, Australia, Canada, and the Middle East. Our cross-industry expertise spans fintech, healthcare, and logistics, enabling us to deliver scalable, secure, and innovative digital solutions worldwide.
Get the Ortem Tech Digest
Monthly insights on AI, mobile, and software strategy - straight to your inbox. No spam, ever.
About the Author
Technology Division, Ortem Technologies
The Ortem AI Research Team is a cross-functional group of ML engineers, data scientists, and software architects embedded across our product, platform, and client delivery divisions. The team researches and evaluates emerging technologies — including large language models, agentic AI systems, computer vision, and MLOps infrastructure — translating complex concepts into actionable guidance for engineering leaders and enterprise decision-makers. Each article published under this byline is the result of collaborative investigation: real-world experimentation, architecture reviews, and performance benchmarking drawn from live client projects and internal R&D initiatives. The team is committed to publishing technically rigorous, vendor-neutral content that helps organisations cut through AI hype and make confident, ROI-driven technology decisions.
Frequently Asked Questions
- Yes, especially for structured upgrades, dependency remediation, test creation, codebase analysis, and contained refactoring. They still need experienced engineering review for business-critical logic, database migrations, security, performance, and cross-system compatibility.
- It means an agent submitted code that passed pre-defined build, test, security, architecture, and regression checks without an engineer materially editing the production implementation. A patch that compiled but failed contract testing, needed business-logic correction, or created an unsafe migration did not receive full credit.
- There is no universal winner. Results depend on the repository, task type, tool permissions, test quality, model configuration, and review process. Run a controlled pilot on your own codebase before committing to a tool standard.
Stay Ahead
Get engineering insights in your inbox
Practical guides on software development, AI, and cloud. No fluff — published when it's worth your time.
Ready to Start Your Project?
Let Ortem Technologies help you build innovative software solutions for your business.
You Might Also Like

Voice Agent Latency and Cost: What Four AI Voice Stacks Delivered

What 212 Engineers Actually Spend on AI Tooling Each Month

