Sign up to save tools and stay up to date with the latest in AI
bg
bg
1

Slack Combines ASTs with Large Language Models to Automatically Convert 80% of 15,000 Unit Tests

Jun 19, 2024 - infoq.com
Slack's engineering team used a large language model (LLM) to convert 15,000 unit and integration tests from Enzyme to React Testing Library (RTL), achieving an 80% success rate. The transition was necessitated by Enzyme's lack of support for React 18. The team initially used Abstract Syntax Tree (AST) transformations for the conversion, but due to the complexity of Enzyme methods, the success rate was only 45%. They then used Anthropic's LLM, Claude 2.1, but the success rates varied between 40% and 60%.

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.
View Full Article

Comments (0)

Be the first to comment!