Quality assurance · Production

Automated Unit Test Improvement using LLMs at Meta — TestGen-LLM

The problem

Existing unit tests in Meta's Android/Kotlin applications left edge cases unaddressed, limiting code coverage and requiring manual effort to improve test suites.

Workflow diagram · grounded in source
1
LLM test case generation
ai_action
“leverages LLMs to generate additional test cases for existing unit tests, aiming to improve code coverage by addressing neglected edge cases”
2
Filtration and quality gate
validation
“its rigorous filtration process, which discards any candidate test cases that do not meet stringent criteria such as buildability, reliability, resistance to flakiness, and contribution to novel code coverage”
3
Engineer acceptance review
human_review
“most recommendations being positively accepted by Meta's software engineers for production”
Reported outcome

TestGen-LLM enhanced 10% of the classes it was applied to, with most recommendations positively accepted by Meta's software engineers for production, and demonstrated substantial improvements in unit test coverage and code base quality.

Reported metrics
Classes enhanced10%
Recommendations accepted for productionmost recommendations being positively accepted
Test cases reliable with coverage improvementssignificant portion found to be reliable and offered tangible improvements in coverage
Reported stack
TestGen-LLMLLMs
Source
https://www.emergentmind.com/assistant/https-arxiv-org-abs-2402-09171/ec12fddf0024cb30c0eb8b9a
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

TestGen-LLM enhanced 10% of the classes it was applied to, with most recommendations positively accepted by Meta's software engineers for production, and demonstrated substantial improvements in unit test coverage and…

What tools did this team use?

TestGen-LLM, LLMs.

What results were reported?

Classes enhanced: 10%; Recommendations accepted for production: most recommendations being positively accepted; Test cases reliable with coverage improvements: significant portion found to be reliable and offered tangible improvements in coverage (source-reported, not independently verified).

How is this quality assurance AI workflow structured?

LLM test case generation → Filtration and quality gate → Engineer acceptance review.