← Latest papers
💬 NLP

Deja Vu at Scale: Paraphrase-Robust Detection of Duplicate Gherkin Steps in Behaviour-Driven Software Testing with Sentence-Transformer Embeddings and a 1.1M-Step Open Benchmark

This paper addresses the maintenance costs of duplicate Gherkin steps in Behaviour-Driven Development by releasing a large-scale, cross-organisational benchmark of over 1.1 million steps and introducing a paraphrase-robust detector that combines exact, lexical, and semantic methods to identify and quantify significant eliminable redundancy.

Original authors: Ali Hassaan Mughal, Noor Fatima, Muhammad Bilal

Published 2026-06-15
📖 5 min read🧠 Deep dive

Original authors: Ali Hassaan Mughal, Noor Fatima, Muhammad Bilal

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are the editor of a massive, collaborative cookbook. Thousands of chefs from different kitchens have contributed recipes. Over time, you notice a problem: the same instructions appear over and over again, just written slightly differently.

  • One chef writes: "Add two cups of flour."
  • Another writes: "Add 2 cups of flour."
  • A third writes: "Put in 2 cups of flour."

In the world of software testing, these instructions are called Gherkin steps. They are the "recipes" that tell a computer how to test a piece of software. The problem is that when these instructions are duplicated or slightly paraphrased, it becomes a nightmare to maintain. If you need to change a step (like changing "Add flour" to "Add almond flour"), you might have to hunt down and edit thousands of copies instead of just one.

This paper, titled "Déjà Vu at Scale," is about building a super-smart tool to find these duplicates, even when they are written in slightly different ways, and creating a giant library of examples to prove the tool works.

Here is the breakdown of what they did, using simple analogies:

1. The Problem: The "Déjà Vu" Effect

The authors found that in the software world, duplication is everywhere. They looked at 347 different software projects (like 347 different cookbooks) and found over 1.1 million instructions.

  • The Stat: They discovered that 80% of these instructions were exact copies of something else.
  • The Pain: If a company wants to fix a typo or change a rule, they might have to edit thousands of files. It's like trying to update a recipe in a cookbook where that recipe is written on 1,000 different pages in 1,000 different books.

2. The Solution: A "Smart Librarian"

The authors built a tool called cukereuse. Think of this tool as a super-librarian who can read the instructions and understand that "Add 2 cups" and "Add two cups" are the same thing, even if the spelling or spacing is different.

They didn't just use one trick; they used a four-layer defense system to catch duplicates:

  1. The Exact Match: If two instructions are identical down to the last letter (like two photocopies), it catches them instantly.
  2. The "Almost" Match: If the instructions are 90% the same (like "Add 2 cups" vs "Add two cups"), it catches those too.
  3. The "Meaning" Match: This is the clever part. It uses AI (called Sentence Transformers) to understand the meaning. It knows that "The user clicks the button" and "Clicking the button by the user" mean the same thing, even if the words are totally different.
  4. The Hybrid: It combines the "Almost" and "Meaning" checks to be extra sure.

3. The Proof: The "Gold Standard" Test

To prove their librarian was actually good, they didn't just guess. They created a giant test set:

  • They took 1,020 pairs of instructions.
  • Three different people (the authors) manually read them and decided: "Are these duplicates or not?"
  • They made sure everyone agreed on the answers (a high score called Fleiss' κ = 0.84, which is like a team of judges all agreeing on who won a contest).
  • The Result: Their "Meaning Match" tool was very good, but the "Almost Match" tool was the most reliable and honest, correctly identifying duplicates about 82% of the time without getting confused by the test rules.

4. The Big Discovery: The "Consolidation" Savings

The most exciting part of the paper is the math they did on the savings.

  • They found that in a typical software project, you could delete about 62.5% of the duplicate instructions and replace them with just one "master" instruction.
  • The Analogy: Imagine you have 100 pages of a cookbook. After using this tool, you realize you only need 37 unique pages. The other 63 pages are just copies. You can throw them away, making the book much thinner and easier to manage.
  • They linked this to ISO/IEC 25010, which is basically a global rulebook for "good software." They showed that cleaning up these duplicates makes software easier to change (Maintainability) and less likely to break (Reliability).

5. What They Released to the World

The authors didn't keep their findings to themselves. They released a "starter pack" for anyone who wants to do this research:

  • The Data: A massive collection of 1.1 million real-world instructions from public software projects.
  • The Test: The 1,020 pairs of instructions with the "gold standard" answers.
  • The Tool: The actual software code (cukereuse) that finds the duplicates.
  • The Rules: A guidebook on how they decided what counts as a duplicate.

Summary

In short, this paper says: "Software testing instructions are full of unnecessary duplicates, making them hard to manage. We built a smart tool that finds these duplicates (even when they are written differently), proved it works with a massive, high-quality test, and showed that fixing this could save software teams a huge amount of time and effort. We are giving all our tools and data away for free so others can use them."

What they did NOT claim:

  • They did not say exactly how much money this saves (because every company pays its workers differently).
  • They did not say this fixes all software quality problems, just the specific problem of duplicate instructions.
  • They did not claim their tool works on private, secret company data (since they only looked at public data).

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →