Slack's AI-Powered, Hybrid Approach for Large-Scale Migration from Enzyme to React Testing Library

With the Enzyme test framework no longer supporting React 18, migrating to React Testing Library (RTL) became imperative.

At Slack, our hybrid approach integrated an Abstract Syntax Tree (AST) method and a Large Language Model (LLM) using Anthropic's AI model, Claude 2.1. Despite initial hurdles, we achieved an 80% conversion success rate.

Key innovations included AST conversions and annotations, DOM tree collection, stringent control mechanisms, and packaging all information into a cohesive pipeline with LLM call and feedback steps. This resulted in a 64% adoption rate and a 22% time-saving in test case conversion.

This success underscores the value of AI in large-scale code migrations and establishes a robust, innovative approach for similar challenges.

Interview:

What is the focus of your work?

The focus of my work these days includes three main areas: code migrations, test code generation, and integrating LLMs into developer workflows. I am particularly interested in understanding where LLMs fit in the development life cycle and how to smoothly integrate them. Additionally, I am working on open-sourcing the Enzyme to RTL codemod, which is the topic of my presentation at QCon.

What’s the motivation for your talk?

The motivation for my talk is to share our innovative approach for complex code conversions that has proven to be successful at Slack. With Enzyme still seeing 1.5 million weekly downloads, there's a real need for an efficient method to automatically convert Enzyme tests to React Testing Library (RTL). By showcasing a real-life use case of LLMs for code conversions, I'd like to demonstrate how this technology can save significant engineering hours and provide a practical solution for developers facing similar challenges

Who is your talk for?

The target audience for my talk is mid to senior software engineers who are actively building AI solutions. These individuals are likely to have a solid foundation in software development and interest in leveraging AI to enhance their workflows and solve complex problems.

What do you want someone to walk away with from your presentation?

I want this persona to walk away with a clear understanding of how we used LLMs to tackle our specific conversion problem and how this approach can be relevant to their own tasks. I would like to showcase the practical benefits of AI, addressing skepticism and proving its effectiveness in certain cases.

What do you think is the next big disruption in software?

I believe the next big disruption in software will be the simplification of writing software that will significantly reduce the need for hard skills. This will likely be achieved through an additional layer of abstraction on top of existing coding languages, enabling developers to accomplish the same tasks with less complexity. This advancement will democratize software development, making it more accessible to a broader range of people and accelerating the pace of innovation.


Speaker

Sergii Gorbachov

Staff Software Engineer @Slack, Specializing in AI-Driven Tools for Automating Code Migrations and Test Authorship

Sergii Gorbachov is a Staff Software Engineer at Slack, based in Vancouver, Canada. As part of the DevXp pillar, he focuses on developing AI-driven tools to automate and streamline development processes. His recent projects include leveraging large language models (LLMs) for code migrations and automating test authorship. Outside of work, Sergii enjoys hiking, running, and biking in the stunning landscapes of British Columbia.

Read more
Find Sergii Gorbachov at:

Date

Tuesday Nov 19 / 05:05PM PST ( 50 minutes )

Location

Ballroom A

Topics

AI/LLMs Unit testing React Test Automation Code migrations

Share

From the same track

Session Productivity

Productivity Lessons in Moving from Big Tech to Scaling a Startup

Tuesday Nov 19 / 10:35AM PST

Most productivity research happens in large tech companies. Many of the lessons learned there apply to the world of Startups as well, but some don't carry over.

Speaker image - Rachel Potvin

Rachel Potvin

SVP Eng @Sanity.io with 25 Years in Tech, Previously @Google and @GitHub, Engineering Leader Focused on Building Productive Happy Teams

Session

Security or Convenience - Why Not Both?

Tuesday Nov 19 / 01:35PM PST

Traditionally, security is all about creating obstacles and making it difficult to access data. This is at odds with our drive for a more smooth and faster development process. How can we keep the software we’re building secure without adding friction for engineers?

Speaker image - Dorota Parad

Dorota Parad

CEO @Authress, Product and Team Builder, Test Enthusiast

Session Engineering productivity

Inflection Points in Engineering Productivity as Amazon Grew 30x

Tuesday Nov 19 / 11:45AM PST

I joined Amazon in 2009, when we were a 3000-engineer company, and got to experience its fast growth from 3k to 90k engineers over a 15-yr period. During that time, our engineering productivity needs had a number of interesting inflection points.

Speaker image - Carlos Arguelles

Carlos Arguelles

Senior Principal Engineer @Amazon, 27 Years Experience in Developer Productivity Engineering, Previously @Google and @Microsoft

Session Research

Supporting Engineering Productivity for All

Tuesday Nov 19 / 02:45PM PST

Understanding what drives software development productivity is the key to making high-impact investments in engineering productivity.

Speaker image - Emerson  Murphy-Hill

Emerson Murphy-Hill

Research Scientist at the Intersection of Software Engineering and Human-Computer Interaction, Former Googler and Professor

Session Engineering Efficiency

Test Automation: Shifting Left for Faster Releases

Tuesday Nov 19 / 03:55PM PST

Details coming soon.

Speaker image - Ying Dai

Ying Dai

Principal Software Engineer @Roblox, Working on Improving Engineering Efficiency. Previously @Google & @LinkedIn.