8

When someone rewrites a command line tool in another language, the hard question is not "does it pass its tests" but "does it still do what the old one did" in all the small corners nobody wrote a test for.

I built a small open source tool for that, behave (Go, MIT): https://github.com/emirmrkaljevic/behave . It reads a tool's --help, generates a few hundred cases (every flag, a few values each, some stdin and file inputs), records stdout, stderr, exit code and touched files from the original binary, then replays the same cases against the rewrite and groups the diffs. The recording is plain YAML you can read and commit.

I pointed it at the Rust rewrites of GNU coreutils, findutils, sed and procps. So far that turned into 44 upstream bug reports and 51 fix PRs, 34 of them merged. The linked post is about the second rewrite (findutils and sed) and which kinds of differences kept showing up: error wording, exit codes and option parsing corners rather than crashes.

Happy to hear where this approach falls short.

no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 26 Nov 2026
8 points (75.0% liked)

Programming

29405 readers
306 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS