VERSION

Version 0.46

DESCRIPTION

Generates a test strategy plan for all methods in a schema, determining which test types should be produced for each method based on its accessor classification, output type, and other metadata. Side-effect and dependency-driven planning (mocking, isolation) is handled separately by App::Test::Generator::Planner::Mock and App::Test::Generator::Planner::Isolation.

This way a package's API can be automatically tested.

new

Construct a new TestStrategy.

my $strategy = App::Test::Generator::TestStrategy->new(
    schema     => \%schemas,
    thresholds => { confidence => 'high' },
);

Arguments

  • schema

    A hashref of method name to schema hashref Optional - defaults to an empty hashref.

  • thresholds

    A hashref of threshold configuration. Optional - defaults to { confidence => 'medium' }.

Returns

A blessed hashref.

API specification

input

{
    schema     => { type => 'hashref', optional => 1 },
    thresholds => { type => 'hashref', optional => 1 },
}

output

{
    type => OBJECT,
    isa  => 'App::Test::Generator::TestStrategy',
}

generate_plan

Generate a test plan for all methods in the schema and return it as a hashref mapping method names to plan hashrefs.

my $strategy = App::Test::Generator::TestStrategy->new(
    schema => \%schemas,
);
my $plan = $strategy->generate_plan;

for my $method (keys %{$plan}) {
    print "$method: ", join(', ', keys %{ $plan->{$method} }), "\n";
}

Arguments

None beyond $self.

Returns

A hashref mapping method names to test plan hashrefs, each containing boolean flags for the test types that should be generated.

API specification

input

{
    self => { type => OBJECT, isa => 'App::Test::Generator::TestStrategy' },
}

output

{
    type => 'hashref',
    keys => {
        '*' => { type => 'hashref' },
    },
}

SUPPORT

This module is provided as-is without any warranty.

LICENCE AND COPYRIGHT

Copyright 2025-2026 Nigel Horne.

Usage is subject to the terms of GPL2. If you use it, please let me know.