The team then adopted a hybrid approach, combining AST transformations with LLM capabilities, mimicking human behavior. They fed the rendered React component under test and the conversions performed by the AST tool into the LLM as part of the prompt, creating a robust control mechanism for the AI. This approach resulted in an 80% conversion success rate, demonstrating the complementary nature of these technologies. The conversion tool's adoption rate at Slack reached approximately 64%, saving at least 22% of 10,000 hours of developer time.
Key takeaways:
- Slack's engineering team used a large language model (LLM) to automatically convert 15,000 unit and integration tests from Enzyme to React Testing Library (RTL), achieving an 80% conversion success rate.
- The transition was necessary due to Enzyme's lack of support for React 18, and the conversion tool's adoption rate at Slack reached approximately 64%, saving at least 22% of 10,000 developer hours.
- Initially, the team attempted to automate the conversion using Abstract Syntax Tree (AST) transformations, but due to the complexity of Enzyme methods, the success rate was only 45%.
- By combining the AST transformations with LLM capabilities and mimicking human behaviour, the team achieved a higher conversion success rate, demonstrating the potential of AI in streamlining complex development tasks.