Summary
Improve the test harness and lay groundwork for feeding malformed or random input to the interpreter to ensure it fails cleanly.
Why
For a C interpreter, “no segfault on garbage input” is a meaningful quality bar. Before fuzzing, the harness itself should also be a bit cleaner and more robust.
Proposed changes
-
Refactor test harness to avoid shell=True when possible
-
Pass subprocess arguments as argv arrays
-
Add a small crash-only corpus of malformed programs
-
Assert that invalid input:
- does not segfault
- does not abort unexpectedly
- returns controlled errors
Future extension
- Add fuzzing later, once the harness and crash expectations are clean
- Possibly maintain a corpus of pathological inputs
Acceptance criteria
- Test harness no longer relies on shell invocation unnecessarily
- Crash-only malformed input tests exist
- Interpreter fails cleanly on garbage input
- This work makes later fuzzing easier
Notes
This issue is half harness cleanup, half groundwork for future robustness testing.
Summary
Improve the test harness and lay groundwork for feeding malformed or random input to the interpreter to ensure it fails cleanly.
Why
For a C interpreter, “no segfault on garbage input” is a meaningful quality bar. Before fuzzing, the harness itself should also be a bit cleaner and more robust.
Proposed changes
Refactor test harness to avoid
shell=Truewhen possiblePass subprocess arguments as argv arrays
Add a small crash-only corpus of malformed programs
Assert that invalid input:
Future extension
Acceptance criteria
Notes
This issue is half harness cleanup, half groundwork for future robustness testing.