A Universal Behavior Testing Tool for Any Executable Program, Featuring Deterministic Output Recording and Verification, CLI-Based Interaction, Structured .tester File Storage, and Fine-Grained Comparison of stdout, stderr, Exit Codes, and Runtime
- Universal: Works with any executable (Python scripts, compiled programs, shell commands, etc.)
- Automatic Storage: Stores test expectations in
.testerfiles alongside your code - Easy Verification: Compare current output against recorded expectations
- Clean Management: Remove all test files with a single command
- Detailed Output: Shows exactly what differs when tests fail
git clone https://github.com/WillKirkmanM/tester.git
cd tester
go build -o testerRecord the expected behavior of your program:
# Record Python script output
tester -record python script.py
# Record compiled program with arguments
tester -record ./myprogram arg1 arg2
# Record any command
tester -record node app.js --port 3000This creates a .{executable}.tester file containing the expected output, stderr, and exit code.
Verify current behavior matches recorded expectations:
# Verify Python script
tester -verify python script.py
# Verify compiled program
tester -verify ./myprogram arg1 arg2Remove all .tester files from current directory and subdirectories:
tester -clean# Create a simple Python script
echo 'print("Hello, World!")' > hello.py
# Record expected output
tester -record python hello.py
# ✓ Recorded test output to .python.tester
# Verify it works
tester -verify python hello.py
# ✅ Test PASSED - Output matches expected result
# Modify the script
echo 'print("Hello, Universe!")' > hello.py
# Verify again
tester -verify python hello.py
# ❌ Test FAILED - Output differs from expected
#
# Expected:
# Hello, World!
#
# Actual:
# Hello, Universe!# Build your Go program
go build -o calculator main.go
# Record behavior with different inputs
tester -record ./calculator add 5 3
tester -record ./calculator multiply 4 7
# Later, verify behavior hasn't changed
tester -verify ./calculator add 5 3
tester -verify ./calculator multiply 4 7# Record error output and exit codes
tester -record python nonexistent.py
# Records stderr and non-zero exit code
# Verify error handling still works
tester -verify python nonexistent.pyThe .tester files are JSON formatted and contain:
{
"result": {
"stdout": "Hello, World!\n",
"stderr": "",
"exitCode": 0,
"duration": "15.2ms"
},
"timestamp": "2025-05-31T10:30:00Z"
}- Language Testing: Verify compiler/interpreter behavior across versions
- Regression Testing: Ensure program behavior doesn't change unexpectedly
- CI/CD Integration: Automated behavior verification in pipelines
- Documentation: Executable examples that stay up-to-date
- Cross-Platform Testing: Verify consistent behavior across systems
# GitHub Actions example
- name: Verify Program Behavior
run: |
tester -verify python script.py
tester -verify ./compiled-program