Re:Ask HN: Why the Linux Kernel doesn't have unit tests?
by GTP on Friday November 25, 2022 @12:07PM
(#33744470)
I agree with the first part of your comment, but not the second. Achieving 100% code coverage is very hard and sometimes unreasonable. E.g. How do you test a GUI? I think that often it is better to write tests for the application logic and test a GUI by using it.
Re:Ask HN: Why the Linux Kernel doesn't have unit tests?
by anthonypasq on Friday November 25, 2022 @01:13PM
(#33745193)
this is simply not possible. if you move a method from one class to another every unit test breaks.
Re:Ask HN: Why the Linux Kernel doesn't have unit tests?
by 3a2d29 on Friday November 25, 2022 @02:22PM
(#33745866)
question:
How do unit tests stay green when you rewrite in another language? Are your tests an external API you call?
Re:Ask HN: Why the Linux Kernel doesn't have unit tests?
by wstuartcl on Saturday November 26, 2022 @12:42PM
(#33754784)
Rewrites are not super common -- but IMHO if you must do one the first step is to move the tests over. Unless your goal with the rewrite is to rearchitect the interfaces at which point your basically greenfielding anyways.
Code coverage? Use it to determine what is dead code you can remove: if your tests don't go through some code, that code is useless.