HN Hall of Fame Weekly email

Why Most Unit Testing is Waste [pdf]

www.rbcs-us.com Essays & writing Essays & articles Software engineering Candidate

Resurfaced independently across 4 calendar years, with breakout response in 4 of them.

submissions
4
submitters
4
observed span
2014–2019
peak thread · 268 comments
306 pts
latest 20+ return · 2019-06-28
192 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

From the paper: "Throw away tests that haven’t failed in a year." Hell, no. Our unit tests provide reassurance that when somebody revisits a component N years from now, and makes a change, they are significantly less likely to break the existing behaviour, even subtly. Throwing away unit tests is like saying "This ship has been sailing for years and has never sunk - let's throw away the lifeboats!" Now, yes - somebody could erroneously change the test condition to…

The normal practice for large scale codebases in complex domains is "the code is the spec". That is, the only specification for how the system should work is how it worked yesterday. In that case, unit tests serve as a great specification. Even tests that just duplicate the business code under test and assert that it's the same (A huge waste in normal cases) is useful. Because a Unit test is much better than a word document in describing how…

My experience with testing is like that old adage about advertising, "I know I'm wasting 50% of my money but I don't know which 50%." Most of it is a waste but it's hard to know in advance which test will stop an engineer in a couple of years from altering some fundamental contract and bringing the system down.

> If you want to reduce your test mass, the number one thing you should do is look at the tests that have never failed in a year and consider throwing them away. They are producing no information for you — or at least very little information. The value of the information they produce may not be worth the expense of maintaining and running the tests. This seems.. entirely unreasonable to me. Just because some area of code is not…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
4

100+ points or 50+ comments

Total points
822

reference only — not used in Hall rules or ranking

Total comments
652

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2014-03-06Why Most Unit Testing is Waste [pdf]First breakout · Best threadhenrik_w306268
2016-10-08Most Unit Testing Is Waste (2014) [pdf]ptr6667
2017-10-31Why Most Unit Testing Is Waste [pdf]quickthrower2258158
2019-06-28Most Unit Testing Is Waste (2014) [pdf]Latest 20+ point returnfagnerbrack192159