Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Do you really need tests for the read(2) syscall when Linux is running on a billion devices, and that syscall is called some 10^12 times per second globally?

Maybe not, but isn't it true that any new code that is being added to the kernel has been run on exactly 0 devices? And new code is being added all the time.

Maybe that's why the most recent commit as of right now is loaded with fixes of broken things: https://github.com/torvalds/linux/commit/08ad43d554bacb9769c...

It's one thing to say that it's impossible to test effectively locally before release (which I'm not sure if that's true or not). But you're saying it's just not worth testing because it'll break in real life and that's even better, which I"m not sure I can agree with.



That merge only has fixed because of how the development model works: there’s a merge window where new features are merged and which then becomes -rc1. After that only fixes are allowed until the final release of that version and then the merge window opens again.


That makes sense, so I just picked another commit at random without a -rc tag:

https://github.com/torvalds/linux/commit/c60c152230828825c06...

  The fix is to change && to ||
This seems like the exact type of bug that a unit test could prevent.


> Maybe that's why the most recent commit as of right now is loaded with fixes of broken things

Are you saying that if Linux had tests, there would be no bugs?


I think that's a bit of a strawman. I don't think anyone says tests prevent all bugs. They can help fix some parts of the contract down and give you a place to check against regressions.


GP pointed out to a bug fix commit as proof that the kernel would benefit from having tests, so it's not that much of a straw man.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: