Skip to content

Harden test harness and prepare crash-only fuzz/corpus testing #166

@leo-aa88

Description

@leo-aa88

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous integrationenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededtestsTesting examples and edge cases

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions