Interface TrialExecutor

All Known Implementing Classes:
DiffTrialExecutor, Junit4TrialExecutor, Junit5TrialExecutor

public interface TrialExecutor
Runs a single trial of a test method with generated arguments.

This is the seam between the engine's fuzzing loop and a test framework. An implementation creates a fresh test instance per trial and honours that framework's per-method lifecycle (for example @Before/@After under JUnit 4, or @BeforeEach/@AfterEach under JUnit 5). The engine never references framework types; it only calls runTrial(java.lang.Object[]).

An instance is bound to a single test method and reused across trials.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default Object
    Returns the value returned by the most recent trial's test method.
    void
    runTrial(Object[] args)
    Runs one trial with the given arguments.
  • Method Details

    • runTrial

      void runTrial(Object[] args) throws Throwable
      Runs one trial with the given arguments.

      Throwables raised by the test body propagate unchanged so the engine can classify them (failure, unmet assumption, timeout). Implementations must not swallow them.

      Parameters:
      args - the arguments for this trial
      Throws:
      Throwable - whatever the test body raises
    • getLastOutput

      default Object getLastOutput()
      Returns the value returned by the most recent trial's test method.

      Differential fuzzing compares these return values across runs; ordinary test runners discard them. The default returns null for executors that do not capture the return value.

      Returns:
      the most recent return value, or null