Install
App::Test::Generator is one Perl distribution with ten command-line tools. Nothing needs a daemon, a database or a network connection once it is installed; the only runtime service any part of it touches is the CPAN Testers API, and only when you ask for that part of the dashboard.
From CPAN
cpanm App::Test::Generator
That installs the module tree and puts
fuzz-harness-generator, extract-schemas,
test-generator-mutate, test-generator-index,
generate-test-dashboard, benchmark-generator,
pod-example-tester, deploy-workflows,
instrument-modules and demo_extractor on your
PATH.
From a checkout
git clone https://github.com/nigelhorne/App-Test-Generator.git
cd App-Test-Generator
perl Makefile.PL
make
make test
make install
prove -Ilib t runs the suite without installing anything.
Two of the test files are opt-in integration tests and only run when
EXTENDED_TESTING=1 is set:
EXTENDED_TESTING=1 TEST_JOBS=4 prove -Ilib t
t/app.t is the canary: it takes every module in
lib/, extracts a schema from it, generates a fuzz harness and
proves that harness. t/self-fuzz.t does the same through the
installed command-line tools, so a change that breaks extraction or
generation usually shows up there first.
Requirements
| Needs | Why |
|---|---|
| Perl 5.036 or later | Declared as MIN_PERL_VERSION. The code uses signatures and say-era features without feature pragmas. |
Config::Abstraction 0.36+ |
Reads the schema files, so YAML, JSON and Perl configuration all work. |
Params::Validate::Strict 0.36+ and Params::Get 0.15+ |
Used both by ATG itself and by the harnesses it generates, to validate inputs against the schema. |
Return::Set 0.03+ |
Validates the routine's return value in the generated test. 0.03 is the floor because list returns need it. |
PPI and Text::Balanced |
Schema extraction parses Perl source rather than guessing with regular expressions. |
Template, Data::Section::Simple, Data::Random*, Unicode::GCString |
The harness generator: templating, the embedded template body, and typed random data including grapheme-correct strings. |
YAML::XS, JSON::MaybeXS |
Reading schemas and writing mutation.json and the dashboard data files. |
Test::Most |
The generated .t files are Test::Most scripts. |
prove |
Shipped with Perl. fuzz-harness-generator -r and the mutation runner invoke it by absolute path, derived from $^X. |
Optional modules that unlock features
These are declared as recommendations, not requirements. Each one is loaded at runtime, and its absence degrades a feature instead of breaking the install.
| Module | What you get |
|---|---|
Devel::Cover 1.51+ |
Coverage-guided fuzzing in CoverageGuidedFuzzer and the coverage columns in the dashboard. Without it, fuzzing runs blind — random only, no branch feedback. |
Test::LectroTest and Test::LectroTest::Compat |
Property-based tests. Both are in TEST_REQUIRES, so make test installs them; generated property tests skip themselves if they are missing. |
Type::Params and Types::Common |
Accurate schema extraction from signature_for declarations. Without them, extraction falls back to heuristics. |
BSD::Resource |
Applies a memory cap to the child process that evaluates a Type::Params signature. Not available on every platform, and not required anywhere else. |
Code::CutNPaste-style CPD data |
The duplication table and per-file duplication drill-downs, if cover_html/cpd.json exists. |
# everything, including the optional features
cpanm --with-recommends App::Test::Generator
Verify the install
perl -MApp::Test::Generator -e 'print "$App::Test::Generator::VERSION\n"'
0.47
fuzz-harness-generator --version
extract-schemas --version
test-generator-mutate --version
Then generate a harness for the sample module and run it. This is the whole pipeline in two commands, and it needs nothing but the installed distribution:
extract-schemas lib/App/Test/Generator/Sample/Module.pm --output-dir /tmp/schemas
fuzz-harness-generator -r /tmp/schemas/greet.yml
fuzz-harness-generator -r writes the harness to a temporary
file, runs it through prove, and prints
Result: PASS followed by the TAP file and test counts. If you
see that, the generator, the assertion libraries and your Perl all agree.
Everything works on Windows, with two differences. The
close_stdin configuration option is ignored, because
Windows has no equivalent of closing the inherited standard input. And
the shell script generate-test-dashboard is a bash script —
run it under Git Bash, MSYS2 or WSL, or run its individual steps by hand.