News for hackers. Stuff that matters.
Re:Ask HN: Why the Linux Kernel doesn't have unit tests? by wpietri on Friday November 25, 2022 @11:33AM (#33744011)
I'm a huge proponent of good testing, mainly because it's so much easier to work sustainably on a code base with good tests. But I hate, hate, hate test coverage mandates. Every time I've seen them, it's as you say: some people write garbage tests to hit the metric. Before with those people you wouldn't have been able to trust their code. Now you have two problems, because you can't trust their tests either.
Re:Ask HN: Why the Linux Kernel doesn't have unit tests? by GaryPalmer on Saturday November 26, 2022 @01:07AM (#33750400)
Sometimes you are forced to write a garbage test because there is not much to say about some simple code in terms of tests.
Re:Ask HN: Why the Linux Kernel doesn't have unit tests? by wpietri on Saturday November 26, 2022 @07:32PM (#33758660)
That's an interesting phrasing. Who forces you?
Re:Ask HN: Why the Linux Kernel doesn't have unit tests? by GaryPalmer on Monday November 28, 2022 @03:44AM (#33771193)
It's integrated into the build process. The build fails if there are not enough lines covered by tests.