Slack engineers achieve 80% automated migration of 15,500 Enzyme tests to React Testing Library using a hybrid AST and LLM pipeline
Slack had 15,500 Enzyme tests requiring migration to React Testing Library to support a React 18 upgrade, with an estimated total of more than 10,000 engineering hours if done manually and no existing open-source tools or adapters to help automate the work.
A pure AST codemod approach achieved only a 45% success rate due to the complexity of Enzyme's 65 methods and JavaScript/TypeScript variability. An initial Claude 2.1 LLM-only trial achieved just 40% to 60% success with high variability and was not released to developers.
The hybrid AST and LLM pipeline converted 80% of code in each file correctly and saved 22% of developer time, enabling the team to complete all 15,500 test migrations by May 2024.
The tool was open-sourced on npm for other companies to use.
Show all 16 reported metrics
Frequently asked questions
What did this team achieve with this AI workflow?
The hybrid AST and LLM pipeline converted 80% of code in each file correctly and saved 22% of developer time, enabling the team to complete all 15,500 test migrations by May 2024.
What tools did this team use?
Claude 2.1, AST, codemod, npm.
What results were reported?
Initial test cases to migrate: 15,500; Manual time per test case: 30 to 45 minutes; Estimated total manual engineering effort: more than 10,000 engineering hours; AST-only conversion success rate: 45% (source-reported, not independently verified).
What failed first in this deployment?
A pure AST codemod approach achieved only a 45% success rate due to the complexity of Enzyme's 65 methods and JavaScript/TypeScript variability.
How is this quality assurance AI workflow structured?
File submitted to pipeline → Context collection → AST partial conversion and annotation → LLM generates converted code → Test execution check → Feedback loop on failure → Output results.