Your duplication report says 0%. Your Cucumber steps disagree.
Every Cucumber suite I've reviewed grows the same way. A new scenario needs a step, nobody is quite sure whether a matching one already exists, and so a slightly different one gets added. Multiply that by a few engineers and a few months, and the step library quietly fills up with near-copies. After years of pointing this out in code reviews, I built a tool to do it for me. This post covers why I…
CukeDedup is a tool designed to identify duplicate, ambiguous, reusable and unused Cucumber step definitions. It is an open-source static analyzer that works with various Cucumber implementations and can be run with a simple command. The author built CukeDedup to address the issue of duplicate step definitions in large Cucumber suites, which can clutter the codebase and make it harder to maintain.
The tool looks at both the step text and the implementation behind it to determine if two steps should be considered duplicates. The author tested CukeDedup on 92 open-source JavaScript/TypeScript repositories that use Cucumber-style tests and made several improvements based on the findings. For example, they raised the handler similarity threshold and added configuration options to reduce false positives.
The tool is designed to be easy to use and integrate into existing workflows, with no configuration required and a focus on providing evidence for its findings rather than just verdicts.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.