CISPA Helmholtz Center for Information Security
Funded by the European Union · European Research Council
web embed
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
A developer at a laptop
Library maintainer
Software library
PNG parser
Input checks
Chunk decoder
Color handling
A regular, static PNG file
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
The library maintainer at a laptop
The library maintainer, shocked
Library maintainer
The advisor, grinning, holding a phone
Boss
WE NEED ANIMATED PNG FILES!
speech bubble tail
OK, we can do that. I’ll add it to the backlog…
speech bubble tail
Don’t worry, I coded it myself on the way to the office. Just force-pushed it to main :)
speech bubble tail
WHAT??????
speech bubble tail
3 / 39
Motivation
A developer with a change to test
web embed
The library maintainer in a hat, sipping coffee at his laptop while flames surround him
Library maintainer
This is fine.
speech bubble tail
Software library
PNG parser
Input checks
Chunk decoder
Color handling
A regular, static PNG file
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 PNG in sRGB
animated
sRGB
Animated PNG with transparency
animated
transparent
sRGB
Animated interlaced PNG
animated
interlaced
sRGB
Animated PNG with a Display P3 color profile
animated
Display P3
Animated PNG with an ECI RGB v2 color profile
animated
ECI RGB v2
6 / 39
Motivation
Animated PNGs, but which ones?
Transparency
Animated PNG in sRGB
animated
sRGB
Animated PNG with transparency
animated
transparent
sRGB
Animated interlaced PNG
animated
interlaced
sRGB
Animated PNG with a Display P3 color profile
animated
Display P3
Animated PNG with an ECI RGB v2 color profile
animated
ECI RGB v2
7 / 39
Motivation
Animated PNGs, but which ones?
Color profiles
Animated PNG in sRGB
animated
sRGB
Animated PNG with transparency
animated
transparent
sRGB
Animated interlaced PNG
animated
interlaced
sRGB
Animated PNG with a Display P3 color profile
animated
Display P3
Animated PNG with an ECI RGB v2 color profile
animated
ECI RGB v2
8 / 39
Motivation
Animated PNGs, but which ones?
Interlacing
Animated PNG in sRGB
animated
sRGB
Animated PNG with transparency
animated
transparent
sRGB
Animated interlaced PNG
animated
interlaced
sRGB
Animated PNG with a Display P3 color profile
animated
Display P3
Animated PNG with an ECI RGB v2 color profile
animated
ECI RGB v2
9 / 39
Motivation
Animated PNGs, but which ones?
Combinations
Animated PNG in sRGB
animated
sRGB
Animated PNG with transparency
animated
transparent
sRGB
Animated interlaced PNG
animated
interlaced
sRGB
Animated PNG with a Display P3 color profile
animated
Display P3
Animated PNG with an ECI RGB v2 color profile
animated
ECI RGB v2
Animated, transparent, interlaced PNG in sRGB
animated
transparent
interlaced
sRGB
Animated, transparent PNG in ECI RGB v2
animated
transparent
ECI RGB v2
Animated, interlaced PNG in Display P3
animated
interlaced
Display P3
Animated, transparent PNG in Display P3
animated
transparent
Display P3
Animated, interlaced PNG in ECI RGB v2
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
LLM output 1: animated PNG in sRGB, not interlaced
out_1.png
LLM output 2: animated interlaced PNG in sRGB
out_2.png
LLM output 3: looks like an animated interlaced PNG in Display P3, but its checksum is wrong
out_3.png
LLM output 4: animated interlaced PNG in Display P3
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
Existing PNG file
Existing PNG file
Existing PNG file, picked as the seed
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
Mutated PNG 1
Mutated PNG 2
Mutated PNG 3
…
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
Existing PNG file
Existing PNG file
The seed file
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.
Mutated PNG 1
Mutated PNG 2
Mutated PNG 3
…
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
The developer
PNG format description
What makes a valid input?
A PNG file
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
Generated animated PNG
sRGB: relative
iCCP: display_p3
Generated PNG
sRGB: none
iCCP: eci_rgb_v2
Generated PNG
sRGB: perceptual
iCCP: none
Generated PNG
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
Generated animated PNG
animated
Generated static PNG
static
Generated static PNG
static
Generated animated PNG
animated
Generated static PNG
static
Generated animated PNG
animated
Generated static PNG
static
Generated static PNG
static
PNG parser
Input checks
Chunk decoder
Animation handler
The developer
Remember why we started: we wanted to test animation.
19 / 39
Problem
Return to the original goal
Generated by FANDANGO
Generated animated PNG
animated
Generated static PNG
static
Generated static PNG
static
Generated animated PNG
animated
Generated static PNG
static
Generated animated PNG
animated
Generated static PNG
static
Generated static PNG
static
PNG parser
Input checks
Chunk decoder
Animation handler
The developer
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 compass logo
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
Generated animated PNG
sRGB: perceptual
iCCP: none
animated
Generated animated PNG
sRGB: perceptual
iCCP: display_p3
animated
Generated animated PNG
sRGB: perceptual
iCCP: none
animated
Generated animated PNG
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
The developer
After the change
just changed a feature
Plain FANDANGO
About one in four inputs reaches the changed code
26%
With Compás
Every input reaches the changed code
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
The developer, after a crash report
When it crashes
a crash report came in
Two slices from the suite, and the lines each covers →
SLICE
animated
Lines the animated slice covers
SLICE
static
Lines the static slice covers
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.
Lines only the animated slice covers
↑ 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
The developer, waiting for the CI
In the CI
the CI takes forever
The slice suite: lines each slice covers →
perceptual
perceptual slice coverage
relative
relative slice coverage
srgb_none
srgb_none slice coverage
display_p3
display_p3 slice coverage
eci_rgb_v2
eci_rgb_v2 slice coverage
iccp_none
iccp_none slice coverage
animated
animated slice coverage
static
static slice coverage
eci_rgb_v2
eci_rgb_v2 slice coverage, kept
animated
animated slice coverage, kept
all slices
Combined coverage of all slices
kept
Combined coverage of the kept slices: the same
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
The developer
Library maintainer
I want animated and perceptual, but explore the rest!
speech bubble tail
A slice crashes? I know which feature to debug!
speech bubble tail
Fixed it? That slice is now my regression generator!
speech bubble tail
My test suite shrinks: I don’t need all the other inputs!
speech bubble tail
38 / 39
The advisor, grinning, holding a phone
Conclusions
CISPA Helmholtz Center for Information Security
Funded by the European Union · European Research Council
Compás compass logo
Thank you!
Target any feature. Trace its code. Minimize your runs.
jose.zamudio@cispa.de
Compás · Feature-Focused Test Generation · ASE 2026
Paper
QR code linking to the paper at jzamudio.com/feature-focused-test-generation
jzamudio.com
Code
QR code linking to the Compás repository at github.com/fandango-fuzzer/compas
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
Generated animated PNG
Generated animated PNG
Generated animated PNG
Generated animated PNG
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