{"id":596,"date":"2026-06-24T11:33:10","date_gmt":"2026-06-24T03:33:10","guid":{"rendered":"http:\/\/wp.rungobag.cn\/index.php\/2026\/06\/24\/ask-hn-how-do-you-separate-intentional-test-boilerplate-from-real-duplication\/"},"modified":"2026-06-24T11:33:10","modified_gmt":"2026-06-24T03:33:10","slug":"ask-hn-how-do-you-separate-intentional-test-boilerplate-from-real-duplication","status":"publish","type":"post","link":"https:\/\/wp.rungobag.cn\/index.php\/2026\/06\/24\/ask-hn-how-do-you-separate-intentional-test-boilerplate-from-real-duplication\/","title":{"rendered":"Ask HN: How do you separate intentional test boilerplate from real duplication?"},"content":{"rendered":"<p>I am maintaining an open-source project (deterministic open source duplicate-code detector) and a user asked for a feature which I don\u2019t 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 t&#8230;<\/p>\n<p><a href=\"https:\/\/news.ycombinator.com\/item?id=48574082\">\u67e5\u770b\u539f\u6587 \u2192<\/a><\/p>\n<hr>\n<p><small>\u6765\u6e90\uff1aHacker News \u00b7 RSS \u91c7\u96c6<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am maintaining an open-source project (deterministic  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ai_generated_summary":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-596","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/posts\/596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/comments?post=596"}],"version-history":[{"count":0,"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/posts\/596\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/media?parent=596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/categories?post=596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.rungobag.cn\/index.php\/wp-json\/wp\/v2\/tags?post=596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}