tests will allow you to make rapid progress with concentrate on a small narrow part.
I believe that tests let you write code more quickly rather than being extra work. The trick is to:
Make them run quickly.
I've implemented a simple test runner with xargs -P that runs the
[spec tests][spec-test] in parallel, which makes them run in ~10 seconds
instead of ~70 on my relatively fast i7 desktop.
Pick solid interfaces to test against. Writing many tests against an internal interface calcifies it. If done prematurely, this will harm the structure of the code and the software architecture.
The shell can be naturally tested with the process environment: argv, the
environment, stdin/stdout/stderr, and the exit code.
TODO: Change interface to
./spec.sh all ./spec.sh glob - Have a separate spec-runner.sh file? For utilities
./unit.sh all
As mentioned in the [README.md][], there are three
and some infrastructure enhancements that should make it quick and pleasant to hack on the code.
Introduce the concept of spec tests. I want to get contributors, and then I can blog more!