Distro News

behave black-box tester finds 44 bugs in uutils Rust coreutils, findutils, sed and procps

Key Takeaway

A new open-source golden-test harness, behave, replayed GNU CLI behavior against uutils Rust rewrites and surfaced 44 upstream bug reports, 51 fix PRs and 34 merges.

Summary

Developer Emir Mrkaljevic has published behave, an open-source tool that records how a command-line program behaves — flags, stdin handling, file effects, exit codes and stderr output — as golden tests, then replays those recordings against a different implementation of the same tool. Pointed at the uutils Rust rewrites of coreutils, findutils, sed and procps, the harness produced 44 upstream bug reports and 51 fix pull requests, of which 34 have been merged.

The work matters because uutils is the Rust replacement set that distributions are evaluating as a drop-in for the traditional GNU utilities, and compatibility failures in edge-case flag handling, exit codes or stderr text are exactly what breaks shell scripts and package build systems. By treating the GNU tools as the reference oracle and the Rust versions as the system under test, behave turns behavioral drift into reproducible golden tests rather than anecdotal bug reports.

How behave tests uutils against GNU as the oracle

  • Recording model: behave captures a CLI's observable contract — accepted flags, stdin consumption, filesystem side effects, exit codes and stderr text — and stores it as golden tests that can be replayed against another binary.
  • Targets under test: the harness was pointed at the uutils Rust rewrites of coreutils, findutils, sed and procps, covering four separate utility suites rather than coreutils alone.
  • Upstream yield: the black-box runs generated 44 bug reports and 51 fix pull requests, with 34 of those PRs merged into the upstream projects.
  • Black-box stance: testing is done without inspecting the Rust source, so discrepancies are identified purely from externally visible behavior compared against the reference implementation.
  • Availability: the tool is open source and hosted at github.com/emirmrkaljevic/behave.

Why it matters

Distributions weighing uutils as a default replacement for GNU coreutils, findutils, sed and procps depend on behavioral parity in exit codes, stderr and flag handling, since shell scripts and build tooling branch on those details. A reusable golden-test harness gives uutils maintainers a repeatable compatibility gate instead of one-off reports, and the 34 merged fixes show the approach converts directly into upstream corrections. It also offers a pattern other Rust rewrites of long-standing Unix tools can adopt.

Original reference: www.linuxtoday.com →