1

I made a small tool for a problem I kept hitting when looking at rewrites of classic command line tools (uutils coreutils, gojq, ripgrep style replacements): how do you know the new binary really behaves like the old one?

behave runs the original tool as a black box with a lot of generated inputs and flags, records stdout, stderr, exit code and file changes into plain spec files, and then replays those specs against the rewrite. Every difference shows up as a small diff.

Running it on uutils coreutils against GNU coreutils turned up 44 differences so far, which led to 51 upstream pull requests, 34 of them merged.

It is a single Go binary (MIT), installable with go install or Homebrew. It also ships example specs for a few dozen GNU tools and jq. I would like to hear where it breaks for your tools, or which CLI you would want covered next.

you are viewing a single comment's thread
view the rest of the comments
[-] emirmrkaljevic@programming.dev 1 points 32 minutes ago

Yes, I used AI coding tools a lot while building it, both for the Go code and for working through the uutils differences. The part I care about is that everything is checkable: the specs are plain files recorded from the real GNU binaries, every reported difference is a command plus expected and actual output you can rerun yourself, and the upstream fixes went through normal review by the uutils maintainers before they were merged.

this post was submitted on 23 Nov 2026
1 points (66.7% liked)

commandline

2261 readers
4 users here now

founded 3 years ago
MODERATORS