Back to Articles

JiTTests: How Meta Uses AI to Prevent Bugs Before Production

November 12, 2026206

JiTTests: How Meta catches bugs before they reach production

In the world of modern development, one of the greatest challenges is not just writing code quickly, but ensuring it doesn't break anything existing. Most AI-based tools available today focus on Code Review – they read the changes and try to guess if there is an error. But at Meta, they decided to take a completely different approach, one that changes the rules of the game: instead of guessing, they let the AI write a test that demonstrates the actual fault, even before the change enters the system.

This system is called JiTTests (short for Just-in-Time Tests), and it has long been more than just a research project; it is an integral part of the company's engineering infrastructure [1, 2].

How it works in practice

The concept behind JiTTests is simple yet powerful: the system generates "disposable" tests designed to fail. When a developer submits a code change (Pull Request), the system analyzes it and generates a test aimed at proving that this change causes undesirable behavior [3, 9].

The workflow consists of two parallel tracks:

  • •The Dodgy Diff track: The system treats the code change as a "mutation" and generates tests that distinguish between the behavior of the original code and the new code [1, 3].
  • •The Intent-Aware track: Here, the AI tries to understand what the developer's intent was (based on the PR title and summary) and generates tests that check if the change meets that intent or deviates from it [2, 3].

The most sophisticated part is the filtering stage. Since AI might generate "False Positives," Meta uses an LLM-as-Judge Ensemble – a group of language models that examine the test, the run results, and the code, and decide whether it is a real bug or a system error [1, 6].

The results speak for themselves

The use of JiTTests has proven itself to be a critical tool for security and stability. In the first half of 2026 alone, the system helped identify 74 severe privacy incidents (SEV) at the Diff stage, before they could reach the production environment. As a result, Meta reported a 20% decrease in the occurrence of privacy incidents during that period [1, 4].

Beyond the numbers, it is a cultural shift: developers don't have to spend time maintaining long-term tests for every small feature. The tests are created, check the specific change, and provide the developer with conclusive proof (in the form of a test failure) that there is a problem requiring attention [9, 10].

Why it matters to you

Meta's approach marks the future of CI/CD. Instead of relying on manual testing or human code review alone, we are moving to a world where AI acts as an active "gatekeeper." The ability to generate personalized tests for every code change is a powerful tool that can save hours of expensive debugging.

If you are working on complex projects, you should start thinking about how you can integrate AI-based automation not just for writing code, but also for verifying it. The Regression Only Trap – the trap where we only test what we have already tested in the past – is becoming a thing of the past [7].

For more information on Meta's research and implementation:

Thanks to Spotlight by Daniel Trabelsi by Daniel Trabelsi for sharing and inspiring this article.

Join the channel
#Meta#JiTTests#AI#software development#automated testing#bug prevention#coding#software engineering