Compás:
compass · English
for navigation and targeting
compás · Spanish
rhythm that guides a fandango
Feature-Focused Test Generation
José Antonio Zamudio Amaya, Gaetano Sapia, Alexi Turcotte, David Benavides, Marcel Böhme, Andreas Zeller
ASE 2026 · IEEE/ACM International Conference on Automated Software Engineering · Munich
A developer with a change to test
Library maintainer
Software library
PNG parser
Input checks
Chunk decoder
Color handling
image.png
2 / 39
Motivation
This is a work of fiction. Any resemblance to real persons, living or dead, or actual events is purely coincidental.
How the new feature really happened
Library maintainer
Boss
WE NEED ANIMATED PNG FILES!
OK, we can do that. I’ll add it to the backlog…
Don’t worry, I coded it myself
on the way to the office.
Just force-pushed it to main :)
WHAT??????
3 / 39
Motivation
A developer with a change to test
Library maintainer
This is fine.
Software library
PNG parser
Input checks
Chunk decoder
Color handling
image.png
Animation handler
NEW
New feature: support for animated PNGs
4 / 39
Motivation
What test inputs do you need?
5 / 39
Animated PNGs, but which ones?
animated
sRGB
animated
transparent
sRGB
animated
interlaced
sRGB
animated
Display P3
animated
ECI RGB v2
6 / 39
Motivation
Animated PNGs, but which ones?
Transparency
animated
sRGB
animated
transparent
sRGB
animated
interlaced
sRGB
animated
Display P3
animated
ECI RGB v2
7 / 39
Motivation
Animated PNGs, but which ones?
Color profiles
animated
sRGB
animated
transparent
sRGB
animated
interlaced
sRGB
animated
Display P3
animated
ECI RGB v2
8 / 39
Motivation
Animated PNGs, but which ones?
Interlacing
animated
sRGB
animated
transparent
sRGB
animated
interlaced
sRGB
animated
Display P3
animated
ECI RGB v2
9 / 39
Motivation
Animated PNGs, but which ones?
Combinations
animated
sRGB
animated
transparent
sRGB
animated
interlaced
sRGB
animated
Display P3
animated
ECI RGB v2
animated
transparent
interlaced
sRGB
animated
transparent
ECI RGB v2
animated
interlaced
Display P3
animated
transparent
Display P3
animated
interlaced
ECI RGB v2
How do you get those test inputs?
10 / 39
Motivation
LLM-based fuzzing
Prompt
“Generate animated, interlaced PNGs in Display P3.”
LLM
e.g., TitanFuzz (ISSTA ’23),
Fuzz4All (ICSE ’24)
Software library
PNG parser
Input checks
Chunk decoder
Color handling
Animation handler
out_1.png
out_2.png
out_3.png
out_4.png
✗ only animated
✗ no Display P3
✗ bad checksum
Input checks
Rejected
✓ as asked
Animation handler
Reached
LLMs learn the format…
…but without guarantees
requested features
validity
combinations covered
The knowledge is learned with previous samples, not specified.
11 / 39
Background
Automating input generation
Seed corpus
Mutate the bytes
89 50 4E 47 0D 0A 1A 0A
00 00 00 0D 49 48 44 52
00 00 01 E0 00 00 01 2C
08 06 00 00 00 B1 3C 9A
00 00 00 08 61 63 54 4C
the first bytes of the seed file
3F
FF
04
IHDR → IH?R
byte replaced
bit flipped
…
Software library
PNG parser
Input checks
Chunk decoder
Color handling
Animation handler
Run it, watch for crashes
Coverage feedback: inputs that reach new code go back into the corpus
Fuzzing
e.g., AFL (Zalewski), AFLFast (Böhme et al., CCS ’16)
12 / 39
Background
Automating input generation
Seed corpus
Inside one mutant
89 50 4E 47 0D 0A 1A 0A
00 00 00 0D 49 48 44 52
00 00 01 E0 00 00 01 2C
08 06 00 00 00 B1 3C 9A
00 00 00 08 61 63 54 4C
3F
FF
04
IHDR → IH?R
byte replaced
bit flipped
There is no IH?R chunk: broken structure.
…
Software library
PNG parser
Input checks
Chunk decoder
Color handling
Animation handler
rejected
rejected
Input checks
Rejected
Most mutants break the structure and are rejected early.
Structure-aware fuzzers fix the structure…
e.g., Nautilus (NDSS ’19), AFLSmart (TSE ’19)
IHDR ✓
Structure intact: the header is still IHDR.
7F
length 13 → 127
The chunk claims 127 bytes, but holds 13.
rejected
…but not the semantics
checksums
length fields
dependencies between fields
13 / 39
Background
A description of valid inputs
PNG format description
What makes a valid input?
sig
sRGB
iCCP
IDAT
IDAT
IEND
A PNG is a sequence of pieces of information called chunks.
IDAT
IDAT
Image data
sRGB
iCCP
Color metadata
14 / 39
Background
Structure and choices
sig
sRGB
iCCP
IDAT
IDAT
IEND
Grammar
<start> ::= <sig> <control_chunks> <image_data> <iend>
<control_chunks> ::= <animation> <srgb_chunk> <iccp_chunk>
<animation> ::=
<static>
|
<animated>
<srgb_chunk> ::=
<srgb_none>
|
<perceptual>
|
<relative>
The specification offers alternatives: for example, a PNG can be static or animated.
15 / 39
Background
Structure alone isn’t enough
Grammar
<chunk> ::= <length> <type> <data> <crc>
length
13
type
IHDR
data
13 bytes
crc
4 bytes
length = size of the data
crc = checksum over type and data
where int(<length>) == len(<data>)
where int(<crc>) == crc32(<type> + <data>)
simplified
We express these rules as semantic constraints.
16 / 39
Background
Grammar and constraints
PNG (excerpt)
<start> ::= <sig> <control_chunks> <image_data> <iend>
<control_chunks> ::= <animation> <srgb_chunk> <iccp_chunk>
<animation> ::=
<static>
|
<animated>
<srgb_chunk> ::=
<srgb_none>
|
<perceptual>
|
<relative>
<iccp_chunk> ::=
<iccp_none>
|
<display_p3>
|
<eci_rgb_v2>
<chunk> ::= <length> <type> <data> <crc>
where int(<length>) == len(<data>)
where int(<crc>) == crc32(<type> + <data>)
Grammar
Constraints
Input specification
Together, they describe a set of inputs: an input language.
Generating test inputs from this description: language-based testing.
17 / 39
Background
FANDANGO generates valid inputs
Input specification
<start> ::= …
<animation> ::= …
<srgb_chunk> ::= …
<iccp_chunk> ::= …
where …
Fandango
input generator
sRGB: relative
iCCP: display_p3
sRGB: none
iCCP: eci_rgb_v2
sRGB: perceptual
iCCP: none
sRGB: relative
iCCP: none
animated
Valid means valid according to the specification we supplied.
PNG parser
Animation handler
18 / 39
Background
Return to the original goal
Generated by FANDANGO
animated
static
static
animated
static
animated
static
static
PNG parser
Input checks
Chunk decoder
Animation handler
Remember why we started: we wanted to test animation.
19 / 39
Problem
Return to the original goal
Generated by FANDANGO
animated
static
static
animated
static
animated
static
static
PNG parser
Input checks
Chunk decoder
Animation handler
Which of these inputs help us do that?
We have a description of valid inputs. Now we want to organize generation around the feature we care about.
20 / 39
Problem
Compás enters
<control_chunks> ::= <animation> <srgb_chunk> <iccp_chunk>
<animation> ::=
<static>
|
<animated>
<srgb_chunk> ::=
<srgb_none>
|
<perceptual>
|
<relative>
<iccp_chunk> ::=
<iccp_none>
|
<display_p3>
|
<eci_rgb_v2>
where not (<srgb_chunk> == <perceptual> and …)
Could we make those choices explicit…
…and use them to configure the specification itself?
21 / 39
Compás
Contribution
A concrete feature
Animation in the PNG specification
<animation> ::=
<static>
|
<animated>
<srgb_chunk> ::=
<srgb_none>
|
<perceptual>
|
<relative>
<iccp_chunk> ::=
<iccp_none>
|
<display_p3>
|
<eci_rgb_v2>
Feature
Feature values
What matters: they are alternatives for one property of the input.
22 / 39
Contribution
Extracting the feature model
PNG
animation
choose one
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
Compás extracts these choices from the specification.
23 / 39
Contribution
Extracting the feature model
PNG
animation
choose one
static
animated
srgb_chunk
choose one
srgb_none
perceptual
relative
iccp_chunk
choose one
iccp_none
display_p3
eci_rgb_v2
excludes
A feature model describes what can vary, and which combinations are allowed.
From software product-line engineering, where it describes configurable families of software products. Here: families of test inputs.
24 / 39
Contribution
Selecting feature values
PNG
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
excludes
Configuration
nothing selected yet
animation = animated
srgb_chunk = perceptual
animated
perceptual
Suppose we want animated inputs…
…with, say, the perceptual sRGB value.
25 / 39
Contribution
Selecting feature values
PNG
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
excludes
Configuration
animation = animated
srgb_chunk = perceptual
Compás rules out the alternatives in the same group.
But a choice can affect another choice.
26 / 39
Contribution
Propagating the dependency
PNG
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
excludes
eci_rgb_v2
Configuration
animation = animated
srgb_chunk = perceptual
iccp_chunk ≠ eci_rgb_v2
perceptual cannot occur together with the ICC profile value eci_rgb_v2.
Constraint propagation
27 / 39
Contribution
Other choices remain free
PNG
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
excludes
input: animated + perceptual + iccp_none
input: animated + perceptual + display_p3
Configuration
animation = animated
srgb_chunk = perceptual
iccp_chunk ≠ eci_rgb_v2
The compatible choices remain available.
28 / 39
Contribution
The specification shrinks
Configured model
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
Input specification
<start> ::= <sig> <control_chunks> <image_data> <iend>
<control_chunks> ::= <animation> <srgb_chunk> <iccp_chunk>
<animation> ::= <static> | <animated>
<srgb_chunk> ::= <srgb_none> | <perceptual> | <relative>
<iccp_chunk> ::= <iccp_none> | <display_p3> | <eci_rgb_v2>
<static> ::= ""
<animated> ::= <actl_chunk>
<perceptual> ::= "sRGB\x00\x00"
<relative> ::= "sRGB\x00\x01"
<display_p3> ::= "iCCP:DisplayP3"
<eci_rgb_v2> ::= "iCCP:ECIRGBv2"
where not (<srgb_chunk> == <perceptual> and
<iccp_chunk> == <eci_rgb_v2>)
1 Remove unselected alternatives
2 Remove rules no longer needed
3 Drop eci_rgb_v2, filter constraints
29 / 39
Contribution
The specification shrinks
Configured model
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
Slice · animated + perceptual
<start> ::= <sig> <control_chunks> <image_data> <iend>
<control_chunks> ::= <animation> <srgb_chunk> <iccp_chunk>
<animation> ::= <animated>
<srgb_chunk> ::= <perceptual>
<iccp_chunk> ::= <iccp_none> | <display_p3>
<animated> ::= <actl_chunk>
<perceptual> ::= "sRGB\x00\x00"
<display_p3> ::= "iCCP:DisplayP3"
Slice
We call the resulting specification a slice.
1 Remove unselected alternatives
2 Remove rules no longer needed
3 Drop eci_rgb_v2, filter constraints
30 / 39
Contribution
The approach, together
Input specification
<animation> ::= …
<srgb_chunk> ::= …
<iccp_chunk> ::= …
where not (…)
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
1 · Extract
Configuration
animation = animated
srgb_chunk = perceptual
iccp_chunk ≠ eci_rgb_v2
animation
static
animated
srgb_chunk
srgb_none
perceptual
relative
iccp_chunk
iccp_none
display_p3
eci_rgb_v2
2 · Configure
Slice
<animation> ::=
<animated>
<srgb_chunk> ::=
<perceptual>
<iccp_chunk> ::=
<iccp_none> | <display_p3>
<animated> ::= …
<perceptual> ::= …
<display_p3> ::= …
3 · Slice
A smaller specification, focused on the selected features, with other compatible choices still available.
31 / 39
Contribution
Generating from the slice
Full specification
Slice · animated + perceptual
<animation> ::=
<animated>
<srgb_chunk> ::=
<perceptual>
<iccp_chunk> ::=
<iccp_none> | <display_p3>
…
Fandango
input generator
sRGB: perceptual
iCCP: none
animated
sRGB: perceptual
iCCP: display_p3
animated
sRGB: perceptual
iCCP: none
animated
sRGB: perceptual
iCCP: display_p3
animated
animated and perceptual are fixed; the rest varies
We specialize the specification before generation, reducing the alternatives the generator explores.
32 / 39
Contribution
One slice for every feature value
PNG
animation
srgb_chunk
iccp_chunk
static
animated
srgb_none
perceptual
relative
iccp_none
display_p3
eci_rgb_v2
Slice
static
Slice
animated
Slice
srgb_none
Slice
perceptual
Slice
relative
Slice
iccp_none
Slice
display_p3
Slice
eci_rgb_v2
Compás derives them all, automatically: the slice suite.
Our full PNG specification: 29 feature values, so 29 slices. No one has to pick them by hand.
33 / 39
Measured on
PNG
GIF
JPEG
TIFF
MP3
ZIP
PDF
ELF
TOML
HTML
Contribution
Does every input test my change?
Target
After the change
just changed a feature
Plain FANDANGO
26%
With Compás
100%
reaches the code of the changed feature
misses it
Every input tests your change, not one in four.
Measured on
PNG
GIF
JPEG
TIFF
MP3
ZIP
PDF
ELF
TOML
HTML
34 / 39
Evaluation
Where do I look when it crashes?
Trace
When it crashes
a crash report came in
Two slices from the suite, and the lines each covers →
SLICE
animated
SLICE
static
Every slice has a footprint: the lines its inputs cover. And it is stable: the same slice covers the same lines.
✗ crash
You already know the feature: animated.
↑ only animated covers these: look here first
54%
of slices have code that no other slice reaches.
A failing slice tells you the feature, where its own code is, and gives you a generator for regression testing.
Measured on
PNG
GIF
JPEG
TIFF
MP3
ZIP
PDF
ELF
TOML
HTML
35 / 39
Evaluation
What do I run in the CI?
Minimize
In the CI
the CI takes forever
The slice suite: lines each slice covers →
perceptual
relative
srgb_none
display_p3
eci_rgb_v2
iccp_none
animated
static
eci_rgb_v2
animated
all slices
kept
same code, a fraction of the runs
1–2
slices keep the coverage of the whole suite, in every format we tested
10×
fewer inputs to generate and run over all ten formats.
Run one or two slices in the CI, not all of them, and cover the same code.
Measured on
PNG
GIF
JPEG
TIFF
MP3
ZIP
PDF
ELF
TOML
HTML
36 / 39
Evaluation
What does it cost?
Cost
Validity
100%
of inputs are valid, in every format
Speed
100%
of plain generation speed, on average
The control comes for free.
Measured on
PNG
GIF
JPEG
TIFF
MP3
ZIP
PDF
ELF
TOML
HTML
37 / 39
Evaluation
What our developer gets
Library maintainer
I want animated and perceptual, but explore the rest!
A slice crashes? I know which feature to debug!
Fixed it? That slice is now my regression generator!
My test suite shrinks: I don’t need all the other inputs!
38 / 39
Conclusions
Thank you!
Target any feature. Trace its code. Minimize your runs.
jose.zamudio@cispa.de
Compás · Feature-Focused Test Generation · ASE 2026
Paper
jzamudio.com
Code
fandango-fuzzer/compas
Scan for the paper and the open-source tool
Backup
The obvious solution
“Why not add a constraint?”
Yes.
Input specification
<start> ::= …
<animation> ::= <static> | <animated>
where not (<srgb_chunk> == …)
where <animation> == <animated>
illustrative
Only animated outputs
For one feature, that is a reasonable solution.
For every feature: one hand-written constraint per campaign, and no link to the code or to redundant campaigns. Compás derives the slices from the specification instead.
B
Backup
Organizing multiple campaigns
Input specification
<srgb_chunk> ::= <srgb_none> | <perceptual> | <relative>
<iccp_chunk> ::= <iccp_none> | <display_p3> | <eci_rgb_v2>
<animation> ::= <static> | <animated>
<interlace> ::= <none> | <adam7>
where not (<srgb_chunk> == <perceptual> and …)
Animation
where <animation>
== <animated>
Color profile
where <srgb_chunk>
== <perceptual>
Interlacing
where <interlace>
== <adam7>
and another…
A campaign is a collection of inputs we generate and run for one testing goal.
Each one needs its own hand-written restrictions, and still says nothing about the code it exercises.
B