All case studies / Case study 10 / 12
Calvera Assurances
Legacy code modernisation with AI agents
Modernising 30-year-old software without risking how premiums are calculated
In short
Three AI agents work together: one maps the COBOL code and its business rules, one rewrites it in modern Python, and the third proves, with tests, that the new code gives exactly the same results.
- Client
- Calvera Assurances
- Sector
- Insurance
- Size
- 1,100 staff, 400,000 lines of COBOL
- −65%estimated migration time
- 10,000contracts replayed identically for each module
- 100%of modules delivered as pull requests, reviewed by the team
The context
Calvera Assurances calculates its premiums on a COBOL system written in the 1990s. The developers who know it are retiring, and every regulatory change takes weeks. A full manual rewrite had been estimated at several years.
The challenge
- 01
The business rules are documented nowhere but in the code.
- 02
A single rounding difference in a premium affects thousands of customers.
- 03
The new code must be readable and maintainable, not a word-for-word translation.
- 04
The in-house team must stay in control of every change.
Our approach
An Analyser agent walks the code with Tree-sitter, builds the dependency graph and documents every business rule. A Translator agent rewrites the modules one by one into idiomatic Python. A Tester agent generates unit tests and replays thousands of real contracts through the old and new systems: as long as outputs differ, the module goes back for correction. Each validated module arrives as a GitHub pull request.
The solution, step by step
- 01
30-year-old code
400,000 lines of COBOL, barely documented, that no one dares touch.
- 02
Mapped
The Analyser reads the syntax tree, links the modules and documents the business rules.
- 03
Translated, module by module
The Translator rewrites each module as readable Python, with comments.
- 04
Proven by tests
The Tester compares old and new outputs on 10,000 real contracts.
- 05
Delivered as pull requests
Each module lands for review with your developers, ready to merge.
Results
- −65%estimated migration time
- 0calculation differences on replayed contracts
- 2,400unit tests generated
- 100%of business rules documented
What we deliver
- Code map and dependency graph
- Business rule documentation
- Modernised Python code, module by module
- Unit tests and an old-vs-new comparison bench
- GitHub pull requests ready for review
Technologies
- CrewAI
- AutoGen
- Tree-sitter
- GitHub API
- DeepSeek Coder / CodeLlama
- Python
Timeline
8-week pilot, then in batches
Team
2 AI engineers, 1 software architect
Illustrative cases: clients and figures are fictional, representative of the solutions we deliver.