Skip to content
HN On Hacker News ↗

Ask HN: How do you separate intentional test boilerplate from real duplication?

▲ 10 points • 7 comments • by rafaepta • 5mo ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

0 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 136
PEAK AI % 0% · §1
Analyzed
Jun 19
backend: pangram/v3.3
Segments scanned
1 windows
avg 136 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 136 words · 1 segments analyzed

Human AI-generated
§1 Human · 0%

I am maintaining an open-source project (deterministic open source duplicate-code detector) and a user asked for a feature which I don’t have a clear answer on how to implement.This seems a very hard problem to solve:-Tests repeat the same scenario. For a structural detector, this flags as repetition (duplication). However, tests are not something people want to delete from the codebases.-The repetitions from tests (on purpose) end up looking like undesired code duplication and the tools canno tell which is which.-One way to solve this would be something like a human in the loop (kind of how linters allow user to accept something once, while keeping the default first run zero-config).Wonder how you have seen this handle and if anyone have any ideas.Here is the the repo: https://github.com/Rafaelpta/dupehoundAnd here is the issue with more detail: https://github.com/Rafaelpta/dupehound/issues/23