AI-Assisted Code Migrations: Reality and Limits
Examining real-world AI migration outcomes and what they mean for engineering teams.
Editorial position: AI can accelerate specific migration tasks, but outcomes depend heavily on context and available data.
The constraint behind the work
Many organizations maintain legacy codebases that are difficult or impossible to update manually. Time and budget constraints often make large-scale migrations impractical. Traditional approaches require extensive engineering effort, with limited visibility into potential savings. Teams face trade-offs between maintaining outdated systems and investing heavily in manual rewrites.
The engineering choice
Several companies have adopted AI-assisted migration techniques to address these constraints. The common thread is using large language models (LLMs) to automate the conversion of code from one framework or version to another. These tools parse existing code, suggest transformations, and generate new implementations that align with target standards. The reported cases focus on well-defined transformations where source and target systems are both well-documented.
How it works
The reported migrations share a few common patterns:
- Test suite updates: Asana and Airbnb both migrated from Enzyme to React Testing Library using AI assistance. This involved converting hundreds or thousands of test files to a newer, supported library.
- Framework upgrades: Uber migrated 600,000 unit tests from JUnit 4 to JUnit 5, adjusting syntax and behavior to match the newer version.
- Language transitions: Bun migrated 530,000 lines of code from Zig to Rust, which required more than simple syntax changes due to differences in type systems and standard libraries.
In practice: These migrations appear to have succeeded because the transformations were well-defined and the source and target systems were both well-documented. AI tools handled bulk conversions, but human engineers handled edge cases and validation.
The scale assumptions
The reported cases involve substantial codebases and teams:
- Asana: Migrated an unspecified amount of test code in two weeks, saving an estimated five years of manual work and $5.9M in costs. The reported AI cost was $12K.
- Airbnb: Completed 3,500 test files in six weeks. The source estimates this would have taken 1.5 engineering years manually.
- Uber: Handled 600,000 unit tests over four months with two engineers and AI support. The reported cost was $165K.
- Bun: Converted 530,000 lines of code in two weeks for a $165K API cost.
These projects required varying levels of AI support and human oversight. The time and cost figures suggest that AI reduced effort significantly but did not eliminate the need for engineering judgment.
Operational lessons
Teams undertaking similar migrations should consider these observations:
- Clear transformation rules help: Migrations between closely related systems (e.g., library versions) tend to be more predictable. Well-defined input-output mappings improve AI accuracy.
- Human review remains essential: Even with AI assistance, engineers must validate generated code and handle edge cases. Review time often represents a significant portion of the total effort.
- Cost accounting is nuanced: Reported costs include AI API usage but not always the full engineering time spent reviewing and refining outputs. Teams should budget for both compute and labor.
Watch out: Not all migrations will have the same success factors. Projects involving highly custom or undocumented code may see diminishing returns from AI tools. Transformation complexity can undermine efficiency gains.
Trade-offs the source accepts
The sources highlight several implicit trade-offs:
- Speed vs. depth: Faster migrations may leave some technical debt unresolved if review cycles are compressed. Teams must balance speed against code quality requirements.
- Dependency on AI quality: Outcomes depend on the training data and capabilities of the underlying models. Model limitations can affect migration reliability.
- Long-term maintenance uncertainty: There is limited discussion on how migrated code performs over time or how future changes will be managed. Teams should plan for ongoing support.
What smaller teams can reuse
Smaller teams can apply these insights in a few practical ways:
- Prioritize well-defined migrations: Start with projects that have clear source-to-target mappings, such as updating to a supported library version. These offer the highest potential for AI efficiency.
- Estimate conservatively: Use public reports as rough benchmarks but validate against your own codebase complexity. Pilot projects help calibrate expectations.
- Allocate review time: Plan for engineering effort to audit AI-generated changes, which may be the largest cost factor. Review should include unit testing and integration checks.
Who should act
Engineering leaders evaluating migration strategies should:
- Assess the specificity of their transformation requirements. Well-scoped projects yield better results.
- Pilot AI tools on a small, non-critical subset of code. This validates feasibility before full commitment.
- Track both time and quality metrics during evaluation. Compare against manual baselines to measure real savings.
Bottom line
AI-assisted migrations can reduce time and cost for well-scoped projects, but success depends on clear goals, good documentation, and sufficient engineering oversight. Teams should treat these reports as starting points rather than guarantees. Careful planning and validation remain essential.
Sources
Pragmatic Engineer: The Pulse: We need to talk about migrations with AI