App-Test-Generator
view release on metacpan or search on metacpan
one stub listing all variants â one good test kills them all.
Boundary value suggestions are generated for numeric mutations,
clamped and deduplicated for non-negative contexts such as
scalar() and length(). Environment variable hints are added where
the source line references $ENV{...}. The enclosing subroutine
name is shown in each stub for navigation context. File is skipped
if there are no survivors or low-difficulty hints to report.
- LCSAJ path dots on per-file mutation pages are now coloured blue
(covered) or red (not covered), based on whether any line in the
path range was executed during testing. Uncovered paths show
[NOT COVERED] in the hover tooltip. The LCSAJ legend is updated
to explain both colours.
- Replaced TER3-only column in mutation files table with a
TER1 / TER2 / TER3 triple, each component shown as a
colour-coded badge (green/yellow/red). TER1=Statement,
TER2=Branch, TER3=LCSAJ path coverage. Any component
without data shows a grey n/a badge. Column header carries
a tooltip defining all three metrics.
- Added --generate_test=mutant option to generate_index.pl (used
alongside --generate_mutant_tests=DIR). For NUM_BOUNDARY survivors,
attempts to produce a runnable YAML schema file in t/conf/ using
bin/test-generator-index view on Meta::CPAN
x: {
type: 'time',
time: {
tooltipFormat: 'MMM d, yyyy HH:mm:ss',
unit: 'day'
},
title: { display: true, text: 'Commit Date' }
},
y: { beginAtZero: true, max: 100, title: { display: true, text: 'Coverage (%)' } }
}, plugins: {
legend: {
display: true,
position: 'top', // You can also use 'bottom', 'left', or 'right'
labels: {
boxWidth: 12,
padding: 10,
font: {
size: 12,
weight: 'bold'
}
}
bin/test-generator-index view on Meta::CPAN
borderWidth: 1,
fill: false,
tension: 0.3,
pointRadius: 0
}]
}, options: {
responsive: false,
maintainAspectRatio: false,
elements: { line: { borderJoinStyle: 'round' } },
plugins: {
legend: { display: false },
tooltip: { enabled: false },
zoom: { // Enable zoom and pan
pan: {
enabled: true,
mode: 'x',
}, zoom: {
wheel: {
enabled: true,
},
pinch: {
bin/test-generator-index view on Meta::CPAN
# TER1 = statement, TER2 = branch, TER3 = LCSAJ path coverage.
print $out "<div class='summary'>\n";
print $out "<strong>Structural Coverage (Approximate)</strong><p>\n";
print $out "TER1 (Statement): $stmt_pct%<br>\n";
print $out "TER2 (Branch): $branch_pct%<br>\n";
print $out "TER3 (LCSAJ): $ter3_str<br>\n";
print $out "Approximate LCSAJ segments: $approx_lcsaj<br>\n";
print $out "</div>\n";
print $out qq{
<div class="legend">
<h3>LCSAJ Legend</h3>
<p>
<span class="lcsaj-dot">â</span>
<b>Covered</b> â this LCSAJ path was executed during testing.
</p>
<p>
<span class="lcsaj-dot-uncovered">â</span>
<b>Not covered</b> â this LCSAJ path was never executed. These are the paths to focus on.
bin/test-generator-index view on Meta::CPAN
</p>
</div>
};
}
}
# --------------------------------------------------
# Legend explaining line colours
# --------------------------------------------------
print $out qq{
<div class="legend">
<h3>Mutant Testing Legend</h3>
<span class="legend-box survived-1"></span> Survived (tests missed this)
<span class="legend-box killed"></span> Killed (tests detected this)
<span class="legend-box none"></span> No mutation
</div>
};
my %survived_by_line;
my %killed_by_line;
for my $m (@{ $mutants->{survived} || [] }) {
next unless defined $m->{line};
push @{ $survived_by_line{ $m->{line} } }, $m;
}
bin/test-generator-index view on Meta::CPAN
background: var(--table-header);
color: var(--table-header-text);
}
.survived-1 { background-color: var(--survived-1); }
.survived-2 { background-color: var(--survived-2); }
.survived-3 { background-color: var(--survived-3); }
.killed { background-color: var(--killed); }
.legend {
border: 1px solid #ccc;
background: #fafafa;
padding: 10px;
margin: 15px 0;
font-size: 0.9em;
}
.legend pre {
background: #f4f4f4;
padding: 5px;
}
.legend-box {
display: inline-block;
width: 16px;
height: 16px;
margin: 0 6px 0 20px;
vertical-align: middle;
border: 1px solid var(--border);
}
/* White box for non-mutated lines */
.legend-box.none {
background-color: var(--bg);
}
/* --------------------------------------------------
Suggested Test Box Styling
Theme-aware and readable in light & dark modes
-------------------------------------------------- */
.suggested-test {
margin-top: 6px;
( run in 3.172 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )