Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How the GNU coreutils are tested (2017) (pixelbeat.org)
107 points by njn on Sept 22, 2018 | hide | past | favorite | 9 comments


Have you ever heard that old phrase "you can either make a program so simple it obviously has no bugs, or you can make a program so complex that it has no obvious bugs"?

GNU programs are the latter. That's why they need to go to such lengths to test "cat".


Any practical program has the potential for bugs.

Note one can build the coreutils like busybox with the --enable-single-binary configure option. In this mode all 100 or so utils are combined to a single 1MB binary. I would not consider this bloated given the functionality provided.


Busybox is no spring chicken, you know - it attempts to be coreutils and util-linux and ip(8) and dhcp(8) and vi and more all at once. Here are some numbers, all compiled with musl libc and stripped:

coreutils with --enable-single-binary=symlinks: 1.6M. Naturally this is a bit optimistic because coreutils is usually built with glibc.

busybox with `make defconfig`: 964K.

sbase[0] with `make sbase-box`: 340K.

[0] https://core.suckless.org/sbase

Even without considering that coreutils also ships with a heaping pile of support files for things like localization, it's still 5 times larger than sbase, and just under twice as big as busybox, which has 5-10x the functionality.


sbase is incomplete, though, so not really apples to apples


Trite, and seems to ignore evolution. Most of the complexity in these utilities came from emergent behaviour.


Wrong, most of the complexity was designed in. Have you ever read the source code for GNU coreutils? And maybe compared it to the POSIX specification for those tools?


GNU true/false in particular is like one of those jokes that takes two minutes to build up to a cheesy pun at the end:

Overly elaborate setup: https://github.com/coreutils/coreutils/blob/master/src/true....

Snappy punchline: https://github.com/coreutils/coreutils/blob/master/src/false...


I don’t think this makes the observation any less true or valuable.


Really nice overview.




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

Search: