Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 15 min read Case study mediumAdept

Balancing Old Tricks with New Feats: AI-Powered Conversion From Enzyme to React Testing Library at Slack

Slack converted over 15,000 Enzyme tests to React Testing Library ahead of its React 18 upgrade by combining AST codemods with an LLM (Claude 2.1). AST transformations alone converted about 45% of code. The LLM alone fluctuated between 40-60%. A hybrid pipeline reached about 80% on evaluated files. It fed the LLM the original test, a partially converted codemod output with in-code instructions, and the actual rendered DOM captured per test case via overridden Enzyme mount/shallow methods. A structured prompt with explicit required and optional tasks constrained hallucinations and improved results by 20-30% over the out-of-the-box LLM.

Related posts

  • Helix: The internal tool powering our Shopify app's native migration

    Shopify Engineering mediumAdept

    Helix is Shopify's internal LLM tooling for rebuilding its 300+ screen React Native app in native Swift and Kotlin. Instead of one-shot generation, it splits each screen into small ordered checkpoints, each gated by CLI-driven behavior tests, a Gemini-based visual comparison against screenshots of the reference app, two context-isolated adversarial code reviews against documented architecture guidelines, and engineer approval. Reviewer feedback is stored in memory so later checkpoints need less oversight, enabling autonomous and parallel runs that produce committed, evidence-backed checkpoints instead of one large diff. The core lesson is to optimize for reliable convergence rather than a perfect first attempt.

  • LLM powered migration of UI component libraries

    Zalando Engineering mediumAdept

    Zalando's Partner Tech team migrated 15 B2B applications between two in-house UI component libraries using GPT-4o, after five hackathon iterations showed that accuracy came from combining generated component interfaces, manually verified attribute mappings (e.g. old "medium" button maps to new "large") and worked examples in the prompt. The resulting Python tool, built on the llm library's conversation API, used temperature 0, a "continue" prompt for truncated output, tagged output formatting, component groups capped at 40-50K context tokens, prompt-caching-friendly ordering, and LLM-generated regression tests. Migration reached roughly 90% accuracy at under $40 per repository, and the LLM handled edge cases such as aliased components that codemods would need explicit code for.

  • LLMs Are the Key to Mutation Testing and Better Compliance

    Meta Engineering easyNovice

    Meta's Automated Compliance Hardening (ACH) tool uses LLMs to make mutation testing practical at scale. Engineers describe a fault class in plain text, ACH generates realistic mutants that existing tests miss, and it then generates unit tests guaranteed to kill them. An LLM-based equivalence detector filters out unkillable mutants, reaching 0.95 precision and 0.96 recall with simple preprocessing. In a late-2024 privacy-testing trial across Facebook, Instagram, WhatsApp and wearables, engineers accepted 73% of generated tests. Meta also proposes the Catching JiTTest Challenge for generating bug-revealing tests at pull-request time, which runs into the test oracle problem.

  • How to Fix ESLint Violations with AI Assistance

    Docker mediumAdept

    An LLM can produce correct fixes for ESLint violations once it has tools that supply minimal, precise context. ESLint's JSON output for even 100 violations exceeds 10,000 characters, so the full report is written to an ephemeral Docker volume and read through condensed or per-file parse tools rather than passed through the model's context. A Dockerized Tree-sitter tool then fetches the AST node and surrounding code for a given line. Violations are grouped by whether they need source context and human supervision. The agent fixed individual violations such as floating promises and unused vars, but it would not loop through multiple violations unless each prompt named a specific rule.

  • Autoresearch isn’t just for training models

    Shopify Engineering easyNovice

    Generalizing Karpathy's Autoresearch beyond model training, Shopify built pi-autoresearch, an extension for the Pi agent harness that runs an agent in an endless loop against a single measurable metric: establish a baseline, form a hypothesis, test it, keep improvements and discard crashes or regressions. Applied to the Polaris build, it cut build time 65% by skipping a redundant full component pipeline before Storybook and limiting a TypeScript transform to the 105 of 580 files that needed it, though humans still had to discard hacks like deleting files. Tobi Lütke added multi-metric support and auto-commits, then ran it on Liquid for 53% faster parse+render and 61% fewer allocations. The open-sourced tool has been used internally to speed up unit tests, React mounting, Playwright tests and pnpm.

The quest for software engineering knowledge.

Look:
Layout: