Manuscript Offprint
arXiv:2609.11824An analysis of the relationship of input metrics
Addison Crump
CISPA Helmholtz Center for Information Security
Saarbrücken, Germany
0009-0003-3271-3558
Abstract—Input metrics evaluate the progress of testing in terms of features of inputs present in a test suite. Previous works, as early as the 1950s, established a number of such metrics, but few endeavored to compare them. This paper does so by utilizing existing methods proposed for other metric classes in partition testing literature. After defining and reviewing common input metrics, we begin with a short case study revealing that typical empirical comparison strategies are fundamentally insufficient for comparing metrics. Then, we demonstrate how one rigorously improves a standard metric by defining and implementing k-alt-path, a new metric which reduces redundancy while improving sensitivity over k-path. Each of the other common input metrics are then systematically compared before discussing the implications of our findings. With these contributions, we bring forward partition testing analysis methods that justify and form a strategy for future research in refining input metrics.
I. INTRODUCTION
When we quantify the thoroughness of testing, we most often use definitions of input space subdivision formalized by partition testing. The most common form of subdivision familiar to software testing practitioners is likely code line coverage: which lines of code have been covered during the execution of a particular input or set of inputs. Where code coverage divides the input space based on program features, input metrics divide based on input features. Such features can only be measured when input features are quantifiable, and these generally form along three categories: lexical, by inspecting the sequences of tokens in the input; syntactic, by observing structure of the input; and semantic, by considering the meaning of the input.
Lexical measures of input coverage were introduced earliest, measuring observed sequences of tokens present in tested inputs. This is potentially most famously demonstrated by Shannon [1] for measuring the lexical redundancy of the English language using n-grams, observations of token sequences of length n. Using the measured n-gram distributions for both letters and words, Shannon demonstrates that one can reconstruct approximations of the English language by sampling over probable sequences of characters or words.
A few years later, Chomsky [2] publishes his abstractions for languages. These allow one to define structural rules for languages, encoding syntax rather than raw token sequences to capture the higher-level relationships between words. These grammars eventually become standard for structuring computer-readable languages due to their alignment with the grammars of human languages [3] and their efficient parseability. With such parsers becoming more prevalent, people naturally sought to test them. The same structures for parsing enabled tools for generation and corresponding metrics for computing test suite completeness. Purdom [4] first defines a generation strategy to exercise grammars by producing sentences (i.e., inputs satisfying the grammar) that exercise every production rule of the grammar, implicitly defining rule coverage. Later authors explore input generation by randomly exploring grammars [5]. Eventually, Lämmel [6] defines coverage metrics that introduce context sensitivity and define mechanisms for producing sentences that exercise each manifestation of a production rule. The current standard for syntactic coverage measurement, k-path, is a conceptual extension of Lämmel's work to extend this sensitivity to arbitrary depths [7] and corresponding generators which optimize for that metric.
Generators for semantically valid inputs are also becoming more prevalent. The rapid improvement of LLMs has spurred significant interest into LLM-based test generation, including the generation of test data and inputs [8]. Other works detail specialized generators for specific languages and targets, most often so for source code generation in compiler and interpreter testing [9, 10]. More recently, language-based testing tools attempt to produce semantically valid inputs for arbitrary input languages by performing constraint solving in the process of input production [11, 12]. While input metrics and generation have historically been inextricably linked, coverage metrics for semantic qualities of languages are typically target-specific, and few have attempted to define such metrics [13]. Instead, these works tend to rely instead on syntactic metrics for input diversity and test suite completeness measurement.
The impetus for this work was a pair of questions: are the syntactic metrics used by modern input generators optimal, and are they sufficient? We discovered that these two questions were superseded by one: how does one even compare input metrics? This paper answers this question with three theoretical contributions:
• A brief repudiation of previous comparison strategies between metrics,
• Extension of existing metric comparison strategies from partition testing literature to input metrics, and
• Analysis of how different classes of input metrics align.
Along the way, we optimize the standard k-path metric significantly with a new metric, k-alt-path, and systematize the relationship between existing input metrics.
A. Notation
In this paper, we will consider sets (distinct unordered lists), multisets (non-distinct unordered lists), and sequences (non-distinct ordered lists), for which notation often overlaps to describe similar, but not identical concepts. To avoid later confusion, the notation used throughout this paper is defined explicitly here.
A set is a subset of (denoted ) iff contains only elements present within , and is a proper subset (denoted ) iff and . The set formed by all subsets of a given set is denoted . Other operators used throughout are consistent with typical set theoretic notation.
A multiset is a submultiset of iff the number of occurrences of (denoted ) is fewer than that of :
is a proper submultiset of (denoted ) iff and . The operator creates the set formed from a given multiset, i.e.:
A multiset is a subset of iff . The number of items present in a multiset is denoted .
Finally, a sequence is a concatenation of elements, e.g. , where is the concatenation operator and each is some other (potentially empty) subsequence. When contextually obvious, the concatenation operator is omitted for concision (e.g., ). A sequence is a subsequence of (denoted ) iff there exists some sequences where , and is a proper subsequence iff and (denoted ). The length of a sequence is denoted . The set of all possible sequences formed by members of some set is denoted , and all possible sequences of length is denoted .
B. Partition Testing
Suppose we want to determine whether a program X satisfies some specification Y. In empirical testing, we can’t execute X with the often infinite domain of inputs I. Instead, we select a set of test cases . Now we ask a second question: is T enough to test X for Y?
This is where we use test adequacy criteria [14]. We say that a test suite T is C-adequate if X is “thoroughly” tested for Y according to the criterion C, denoted . As an example typical to fuzzing: the “all-edges” criterion states that T is adequate for testing X for Y if, by executing T on X, all (reachable) edges of the control flow graph of the program are covered. In reality, we rarely actually achieve such criteria, but such analysis gives us a foothold to begin comparing criteria.
We say that a criterion is subdomain-based if, for each program and specification , component-wise divides the input domain into a multiset of subdomains . To make this notion more concrete, we can consider a function , where are a set of observable features, individual elements representing observable behaviors exhibited during execution over , exercising of components of the specification , or even different aspects of an input itself. For example, the “all-edges” criterion edges would define as the set of edges in the program . then represents, “what set of edges of are traversed when executing ?” Each then acts as an index for a single element such that
is often not mutually exclusive nor distinct. As an example, when a sequence of program regions are only connected by unconditional edges, those edges necessarily correspond to the same set of inputs, but different subdivisions in .
Partition testing itself is the process of testing X by exercising different partitions (more accurately, subdomains) of the input domain such that a representative candidate of each subdomain is present in the test suite T. Since each test is a member of some submultiset of subdomains, partition testing informs us that a test suite T is C-adequate for X and Y if
- Criterion relationships: A test criterion subsumes for X, Y if
universally subsumes if this applies for all X and Y. In other words: the subsumption relationship tells us when one adequacy criterion supersedes another; satisfying the former necessarily means that you have satisfied the latter. This relationship is unfortunately quite weak; it only informs us as to the relationship of and in the extreme cases of test adequacy, when all subdomains are satisfied.
To allow us to inspect the relationship between two metrics, we also consider the covers relationship [14]. We say that covers for X, Y if:
In other words, covers if 's subdomains are each covered by some submultiset of subdomains of . As a result, if covers , then it necessarily subsumes as well. Each
Fig. 1. The “addition” grammar, where .
of these relationships are necessarily transitive and reflexive. Later, we show relationships across a variety of input metrics.
C. Context-Free Grammars
A context-free grammar (CFG) is a 4-tuple . and are sets of symbols such that representing nonterminals and terminals, respectively. is the “start symbol”, which we will revisit shortly. is a relation. For some and , we say that “directly expands” to iff (denoted ). Put simply: defines the “rules” under which each nonterminal (here, ) may be expanded into some concatenation of other symbols (here, ).
We can broaden the notion of direct expansion to that of indirect expansion. Given sequences and (where , and ), we say that indirectly expands to , written , iff when or , otherwise.
We may now apply this indirect definition of expansion recursively; for , ( recursively expands to by ) if there exists some derivation sequence . Coming all the way back around now: we say that some input is in the grammar iff . is unambiguous if there exists exactly one or zero sequences of expansions by which this holds for every . Unless explicitly mentioned otherwise, we only consider such unambiguous grammars for the remainder of the paper.
- Rule syntax and derivation trees: To define grammars, all we need to define are the rules. Consider Fig. 1; here, quoted values are terminals, means , and (an “alternation” over ) means that , , where is the “k-th variant” of . Many flavors of context-free grammar definition languages include extensions like nested alternation, where one may define sub-variants of a particular rule (e.g., ); nested concatenation, used in conjunction with nested alternations to define rules with common subsequences (e.g., ); and quantifiers, which allow for convenient repetition of symbols in rules. All of these primitives can be converted back into the typical rule definition described above by the creation of intermediary nonterminals, though we do not explicitly perform this in this paper.
Fig. 1 defines a grammar that accepts any string that represents the addition of one-to-many nonnegative integers. To better visualize what this means for inputs, we introduce the concept of a derivation tree. A derivation tree is a representation of the sequence taken during the recursive expansion of the start nonterminal to the corresponding input. Consider an input

Fig. 2. Derivation tree of the input . Dashed components are added for clarity on expansion but are not part of the derivation tree.
with the value . To show , we present the derivation tree in Fig. 2. This figure is annotated to show the expansion at each step of . For example, at a tree depth of 2, we see the expansion . The derivation tree bridges the formal definition and intuitive understanding of how expansion of a nonterminal actually works in practice.
-
Graph representation: To better visualize the CFG itself, we may represent it as a directed graph. The original k-path paper [7] does so in the following steps :
-
Recursing from the starting nonterminal, the immediate expansion of each nonterminal is added to the graph as children of that nonterminal with the remaining steps.
-
At each alternation, a unique synthetic | node is inserted and an edge added from this node to each of its variants. This step allows for nested alternations to be represented without intermediary nonterminals.
-
At each concatenation, a unique synthetic ⊥ node is inserted and an edge added from this node to each of the concatenated values. This step allows for nested concatenation to be represented without intermediary nonterminals.
-
Literals are inserted as nodes uniquely.
-
Each reference to a nonterminal is assigned a unique node, then an edge added to its previous expansion.
A graph for the grammar of Fig. 1 is shown in Fig. 3.
Havrikov and Zeller [7] additionally provide steps to represent quantifiers (an extension to simplify repetition) within grammar graphs, but do not specify how to compute the k-path metric in the presence of quantifiers. To avoid underspecification, we only consider grammars that do not contain quantifiers.
D. Traditional Input Metrics
Let be the set of inputs expressed by an unambiguous context-free grammar :
We define coverage as some function , where is the coverage-specific feature domain described in Section II-B, absent a specific program and specification as is independent of these for input metrics.
- n-gram Coverage: The first coverage metric introduced [1], though not formally as a metric, is a lexical coverage. n-gram coverage ( ) is defined as the set of sequences of terminals of length present in a given :
For the purposes of comparison later, we define a second metric, n-or-less-gram ( ), that is inclusive of shorter sequences:
- Rule Coverage: Purdom [4] defines production rule coverage similarly straightforwardly, intuitively representing the covered expansions of each nonterminal:
- Context-Dependent Rule Coverage (CDRC): CDRC as defined by Lämmel [6] is effectively a chained version of rule, wherein we track which sequences of expansions are observed. This allows one to not only measure which production rules are covered, but the context (i.e. the “parent” production rule) in which those production rules are used. is defined accordingly [6]:
For purposes of comparison later, we generalize this coverage to chains of arbitrary length (for ):
Note especially the union with ; without this, would fail to capture coverage over expansion sequences shorter than . Note also that neither rule coverage nor CDRC have the ability to represent nested alternations or concatenations.

Fig. 3. The graph constructed for the “addition” grammar.
- k-path Coverage: For the grammar graph with nodes and edges , the paths of this graph are each sequences of nodes where:
When we draw a derivation tree for a given input , we are effectively drawing the set of paths (excluding synthetic nodes) taken over the corresponding grammar's graph during expansion (hereon, ). For example, the path in the derivation tree shown in Fig. 2 directly corresponds to the path:
k-path coverage maps the set of all possible inputs I to the set of paths with length k in the graph H covered by the derivation tree of a given input, i.e. . In the original k-path definition, coverage is computed for paths of exactly length k. In practice, because some paths to terminal nodes can only exist with lengths less than k [7] (similar to ), k-path is typically computed for paths of length k or less, as demonstrated by the original authors [11, 12]; we continue with this definition.
Havrikov and Zeller [7] then propose that one build a fuzzer by sampling inputs that exercise previously-uncovered paths.
III. EMPIRICAL RESULTS ARE INSUFFICIENT
With the background now established, we motivate this work with a brief repudiation of previous evaluation practices when comparing two metrics. There are two versions of the -path paper: one that was accepted to ASE in 2019 and an extended version published independently in 2023. In the original paper [7], the future work section suggests:
One would assume that there would be strong correlations between individual language elements and some code in the program under test...
which is subsequently evaluated in the extended version [15]:
... -path input coverage positively correlates with code coverage [and is therefore] a useful objective for systematic generation of diverse inputs.
The objective of this evaluation is to establish that as -path coverage increases, so does code coverage—that is, there is a causal relationship between -path and code coverage. However, correlation is not a reliable means by which to establish a causal relationship between metrics. To demonstrate this, we conduct a short experiment with the “identity” coverage metric, :
This is, for all intents and purposes, an input metric by the definitions from Section II-D: it maps each input in an input domain to a set of coverage points (here, exactly one input). We can now study its correlation with other coverage metrics.
A. Correlating with -path
We experiment using the tribble input generation tool introduced in the -path paper [7]. tribble comes equipped with a “random” mode, allowing us to generate random inputs from a given grammar. For direct comparisons, we use the grammars from the correlation evaluation of the extended -path paper [15], sampling 100 inputs or until -path is saturated. We merge the data from 50 trials and perform Spearman rank correlation [16] between and . Results of this experiment are presented in Table I.
Excluding CSV, we observe that the coverage metric is strongly correlated with . In other words: executing more inputs increases -path coverage. This makes sense! Since we are measuring over grammar, the probability that we cover more -paths by sampling is simply an instance of the coupon collector’s problem [17]. CSV’s correlation and significance is low because random generation saturates -path for small
TABLE I CORRELATION BETWEEN PATH AND IDENT. BOLDED MEASUREMENTS ARE STATISTICALLY SIGNIFICANT ().
| Grammar | Spearman's (path vs. ident) | ||||
|---|---|---|---|---|---|
| 1-path | 2-path | 3-path | 4-path | 5-path | |
| JSON | 0.80 | 0.88 | 0.91 | 0.91 | 0.91 |
| CSV | 0.19 | 0.29 | 0.64 | 0.71 | 0.63 |
| URL | 0.89 | 0.92 | 0.93 | 0.95 | 0.96 |
almost immediately due to the uncomplicated nature of the grammar. This result reveals the issue with using correlation as a measure for the strength of a coverage metric: correlation reveals just as much about the sampling method as it does about the measured variables.
The covering relationships explored in Section V grants greater insight into the nature of the relationships between metrics. When we show that one metric covers another, we show that it is more sensitive; an increase in one metric is necessarily observed as an increase in another that covers it. This does not necessarily reveal a strong causal relationship either; after all, ident trivially universally covers all test metrics, and we can arbitrarily construct metrics that are more sensitive than others without necessarily improving test performance. What covering reveals that correlation cannot is that methods that efficiently saturate one metric will saturate others covered by it, and that, in doing so, we test more of each subdomain of each covered metric.
B. Correlating with Code
We know now that ident correlates with -path, but does it correlate with code coverage? We reproduce Tables 2 and 5 of the extended -path paper [15] in Table II by correlating with cumulative branch coverage using the inputs from Section III-A. The results are comparable with that of systematic generation, and are actually more correlated with branch coverage than -path in many cases. Are we to take from this that ident is a strong predictor for code coverage? When sampling randomly, yes: this is the very basis for fuzz testing (“fuzzing”). In the case of grammar-based fuzzing specifically, every program that parses based on a grammar contains some state machine that accepts or rejects a given input based on its conformance to that grammar. In typical implementations, program branches that correspond to a nonterminal expansion will only be visited if its parent’s branches are covered. When we sample random derivation trees, we cover code regions corresponding to the randomly selected nonterminal expansions. When the code is not already entirely covered, sampling more inputs will likely cover more code.
That said, this correlation is only strong for code regions corresponding to the actual parsing. Consider a program that then does something with this parsed information; the code regions not pertaining to parsing would be covered merely by
We do not use the Markdown grammar, as tribble exhausted system memory before completing a trial.
Subjects jackson-databind and galimatias-nu omitted as they no longer function.
TABLE II CORRELATION AND ABSOLUTE RESULTS OF BRANCH AND IDENT: SPEARMAN'S (BOLDED WHERE ) AND ARITHMETIC MEAN OF BRANCH COVERAGE.
| Grammar | Subject | ρ | μ |
|---|---|---|---|
| JSON | argo | 0.78 | 0.3959 |
| fastjson | 0.86 | 0.0360 | |
| genson | 0.83 | 0.0880 | |
| gson | 0.78 | 0.2272 | |
| json-flattener | 0.62 | 0.7100 | |
| json-java | 0.76 | 0.1629 | |
| json-simple | 0.80 | 0.5719 | |
| json-simple-cliftonlabs | 0.72 | 0.3729 | |
| json2flat | 0.71 | 0.6647 | |
| minimal-json | 0.78 | 0.4106 | |
| pojo | 0.78 | 0.1278 | |
| CSV | commons-csv | 0.74 | 0.3714 |
| jackson-dataformat-csv | 0.65 | 0.1467 | |
| jcsv | 0.66 | 0.3622 | |
| sfm-csv | 0.54 | 0.0721 | |
| simplecsv | 0.69 | 0.4050 | |
| super-csv | 0.66 | 0.1695 | |
| URL | autolink | 0.84 | 0.5897 |
| galimatias | 0.87 | 0.2452 | |
| jurl | 0.76 | 0.6678 | |
| url-detector | 0.89 | 0.4621 |
chance. Relating this to the end of Section III-A, one would need to show that k-path at least subsumes the subset of code coverage corresponding to parsing in order to claim any strong relationship. Anything beyond this is strictly a function of the distribution of inputs sampled and the probability of covering program semantics not expressed within the grammar. Correlation does not indicate that increasing k causes k-path to cover a subject more than simply taking more samples. Relying on correlation of test metrics leads to conflicting results according to the sampling method used [18, 19] and must not be used as justification for using one metric in place of another.
C. Other Empirical Comparisons
Sections III-A and III-B consider correlation-based analysis to compare two metrics with constrained random input generation. Another common method to compare metrics is to generate inputs by sampling underrepresented features of each, like in the original k-path work [7]. While historically new metrics emerge as objectives of generation, metrics themselves are used to evaluate test suites from arbitrary sources. Evaluations which measure the performance of generation that optimizes for some specific metric have value in empirically determining the efficacy of those generation strategies, but provide little indication as to the properties of the metrics themselves.
IV. IMPROVING k-PATH METRIC
To demonstrate how one may more rigorously compare metrics, we begin by refining k-path. We show that this new metric is strictly more sensitive than k-path alone and requires less computational resources.
When we traverse from one node to another in the grammar graph, that means that there was a corresponding expansion step in the derivation tree. At nonterminals and concatenations, we always traverse the outgoing edge(s) in the graph; no matter what the next node is, it is involved in the expansion. At alternations, however, we only traverse one during expansion. This means that paths other than those between alternation-variant edges are redundant, as it can be inferred from the rules of derivation.
To demonstrate the effect of this, consider the path from Eq. (14). The information expressed over this path by -path for is effectively no more than that already expressed by , since every node in the path is implied by either the presence of its parent or the presence of its child. In fact, because the grammar contains no nested alternations or concatenations (and therefore no path or ), there are no inputs for which -path for expresses more information than . Yet, the number of paths of length 1 is 30; the number of paths of length 2 or fewer is 64, meaning that 34 of these paths are redundant.
A. -alt-path Definition
The alt-paths of the grammar graph are the paths between and including the outgoing edges of alternations. That is, paths beginning with alternations and ending with immediate descendants of alternations as a result of expansion. With as the set of synthetic alternation nodes:
We then define like before for , but for paths over or fewer outgoing edges from alternations.
B. -alt-path vs. -path
Both and are subdomain-based criteria. are the subdomains of corresponding to inputs for which the derivation tree traverses each path of length , therefore the number of subdomains directly corresponds to the number of paths: . For , .
- -alt-path covers -path: Every path in a grammar with paths can be decomposed into subpaths, where for every subpath and
When we subdivide the input domain by paths present in the derivation trees, the subdomain of inputs for which the derivation trees that contain some path are subdivided by paths that have as a prefix:
This is necessarily the case as this subdivision enumerates all paths of length with as a prefix, i.e., all the cases in which the path appears. This similarly holds over sets of paths for which is a suffix, and is recursively applicable: we can further subdivide by subdividing any .
Having established that one can cover the input subdomains corresponding to the presence of paths in derivation trees, we can now show that covers . By the definition of paths, the logic presented at the start of Section IV, the expansion rules of grammars, :
and are universally covered by . There exists no grammar for which there exists an input such that there exists some path where that is not implicitly present in due to the presence of either the start node or some alternation-child pair . Each subdomain corresponding to each path is necessarily subdivided by some set of alt-paths, which cover each subdivision where this path is present, satisfying the covering relation by Eq. (21). By the same logic, is universally covered by because any path of length or less is implied by the presence of some other path where , and the subdomain corresponding to each path of length or less is subdivided completely. Further, we expect that this should hold for over many because path redundancy increases as the grammar contains more nonterminal and concatenation nodes between alternation nodes.
- Subdivision size: Since both and rely on counting unique paths, computing these metrics requires both enumeration and storage of each potential path (and therefore has storage and computation requirements proportional to and , respectively). For every , there exists some minimum where is not covered by because where and . By construction,
In plain English, has lower storage requirements than , the maximum path that covers. This directly corresponds to a reduced computational effort as the number of paths that need to be counted during a coverage computation is reduced quadratically. Without loss of covering by Eqs. (20) and (21), we reduce the memory requirement even further by omitting paths contained by others.
C. Evaluations on Real Grammars
To demonstrate the degree to which subdivision counts differ, we evaluate the storage requirement and covering relationship
TABLE III THE RESULTS OF SECTION IV-C FOR INCREASING k.
| Subject | k | j | Ratio | ||
|---|---|---|---|---|---|
| "Addition" | 1 | 4 | 110 | 17 | 6.5:1 |
| 2 | 7 | 294 | 30 | 9.8:1 | |
| 3 | 10 | 591 | 45 | 13.1:1 | |
| 5 | 15 | 1,362 | 88 | 15.5:1 | |
| CSV | 1 | 4 | 830 | 199 | 4.2:1 |
| 2 | 7 | 2,360 | 298 | 7.9:1 | |
| 3 | 10 | 5,095 | 497 | 10.3:1 | |
| 5 | 16 | 20,765 | 1,661 | 12.5:1 | |
| REST | 1 | 4 | 1,991 | 427 | 4.7:1 |
| 2 | 6 | 4,408 | 798 | 5.5:1 | |
| 3 | 8 | 8,368 | 1,111 | 7.5:1 | |
| 5 | 14 | 41,223 | 4,662 | 8.8:1 | |
| XML | 1 | 4 | 816 | 152 | 5.4:1 |
| 2 | 6 | 2,105 | 350 | 6.0:1 | |
| 3 | 9 | 6,550 | 823 | 8.0:1 | |
| 5 | 15 | 31,696 | 3,411 | 9.3:1 |
for increasing on the “addition” grammar of Fig. 1 and the well-known context-free CSV, REST, and XML grammars taken from recent works that rely on -path for diversity metrics [12, 11]. Our findings are presented in Table III. These results emphasize the degree of reduction achieved by -alt-path, which requires less storage for small than the corresponding -path, the effect of which compounds with increasing .
D. Interpreting -alt-path
In Section IV-B1, we demonstrate that -alt-path covers -path and has fewer subdomains, therefore showing that -alt-path is both more sensitive and efficient. In Section III-B, however, we reasoned that the finding that -path correlates with code coverage is not a strong one. The latter would seem to undermine the former, but no: if the objective is to cover a grammar, then these metrics are perfectly suitable. -alt-path is still superior as it tests more of each subdomain of -path and requires significantly less computational resources. Nevertheless, one must not rely on grammar coverage as a proxy [20] for code metrics (e.g. branch coverage, mutant coverage [21], or fault coverage), as correlation neither guarantees an increase in code metrics nor considers code regions that are probabilistically uncovered by sampling derivation trees from grammars.
V. OTHER INPUT METRIC RELATIONSHIPS
Now that we have motivated use of the covers relationship, we now review the relationships between all input metrics discussed in this paper. These are enumerated in Table IV and Fig. 4. Most of these relationships may be shown simply by comparing their subdomains; if is a subset of , there is some subset of the subdomains of that covers the subdomains of . For example: rule covers because every rule is either a variant of an alternation, or is the only
TAR is omitted as it depends on constraints to be parseable.
TABLE IV EXPLANATION OF COVERING BETWEEN INPUT METRICS.
| Edge | Reasoning |
|---|---|
| uniq() uniq() | |
| uniq() uniq() | |
| 3 | See Section V-A1. |
| 4 | See Section IV-B1. |
| 5 | uniq() uniq() (definition) |
| Shown by Lämmel [6]. | |
| 7 | uniq() uniq() (definition) |
| 8 | uniq() uniq() (definition) |
| 9 | See Section V-A2. |
| See Section V-A3. | |
| 11 | uniq() uniq() (definition) |
| 12 | All terminals must be covered. |
Requires no nested alternations or concatenations.
Requires that start nonterminal has exactly one rule.

Fig. 4. Covering relationships between input metrics. covers if there is a path from to . Restrictions from Table IV denoted with dotted edges.
rule for that nonterminal, at least when nested alternations are forbidden. covers rule for similar reasons; by the construction steps of the grammar graph in Section II-C2, there is at least one node that corresponds exactly to each expansion of each nonterminal. The remaining trivial covering relationships follow by their definition.
A. Non-trivial Covering Relationships
Not every covering relationship can be shown by comparing subdomains directly. To show that a metric covers , we must show that, for each subdomain of , there exists some subset of subdomains of that, when unioned, are exactly that subdomain. We explain why this holds for several pairs of metrics in the following subsections, though with less detail as they are each consequences of Section IV-B1.
-
1-alt-path covers Rule Coverage: Each nonterminal in a well-formed grammar has one to many associated rules. When there are more than one associated rules, we represent this with an alternation; as a result, there is exactly one edge in the grammar graph corresponding to each variant in this alternation, and and rule share a corresponding subdomain of inputs formed by the paths to this edge. When a nonterminal has only one associated rule, the subdomain corresponding to the expansion of this rule is subdivided by the previous rule expansions or the start node; this is a result of Eqs. (22) and (23). Therefore, rule is covered by , because there is no rule for which there is not some subdividing set of alternation-variant pairs.
-
-alt-path covers -: is effectively the chained version of rule coverage, like is the extended form of alternation coverage. Every sequence of expansions is the union of subdomains formed by subsets of sequences of alternation-variant pairs in the grammar graph (i.e., the rule expansions), just like rule.
-
CDRC-k covers -path: Expansion sequences correspond quite well to paths in the grammar graph when forbidding nested alternations and concatenations. An expansion corresponds to two entries in the graph: the nonterminal and its immediate descendant (when the nonterminal has exactly one rule) or the nonterminal's alternation and its immediate descendant. When considered together, a sequence of k expansions corresponds to, minimally, paths of length in the grammar graph; for the same reasons as the previous two metric relationships and Section IV-B1, this suggests that covers , but not vice versa, as the introduction of any alternations or concatenations increases this path length.
B. Lexical vs. Syntactic Coverage
Table IV and Fig. 4 reveals no relationships between and any syntactic input metrics for . The reason for this is simple: there are no universal covering relationships between and any syntactic metric for any . We may demonstrate this by counterexample.
-
-or-less-gram does not subsume rule coverage: Recall that subsumption is implied by covering; if a metric cannot subsume another, then it also cannot cover it. rule is the weakest syntactic coverage; if we cannot subsume rule, then we cannot subsume any other syntactic metric. Choose an arbitrary ; we may construct a grammar . For to subsume rule, its satisfaction must imply the satisfaction of rule, but it trivially does not. We may select an arbitrary terminal symbol and a subset of inputs . saturates , but is the minimum set of inputs to saturate rule; since , does not subsume rule.
-
-alt-path does not subsume 2-or-less-gram: is the strongest syntactic metric defined in this paper; if it cannot universally cover , no syntactic metric defined in this paper can. For arbitrary , we can construct a grammar such that:
As a result, ; only will saturate . saturates . Since , does not subsume .
VI. Discussion
Before concluding, we discuss the limitations, threats to validity, the implications of this paper, and related work that covers similar ground to ourselves.
A. Limitations
k-alt-path, like k-path, is not well-defined for CFG extensions like repetitions. Furthermore, while we establish the covering relationship for input metrics, covering alone does not indicate superiority in fault detection. Those familiar with the work of Frankl and Weyuker [14] will notice that this paper does not attempt to establish the properly covers relationship between metrics. A given test adequacy metric properly covers another if it covers uniquely, where no subdomain is used more than once in the covering of the subdomains of the other metric. k-alt-path trivially does not properly cover k-path simply because k-path has more subdomains. This distinction is crucial, as one can establish that if one metric properly covers another, then it is also necessarily superior at fault detection [14] under the failure rate model [22], whereas this is not the case for the covering alone. That said, the proof for this claim is in the context of partition testing, where each subdomain is sampled exactly once regardless of whether that subdomain has already been covered by other samples. This is not the model under which we test programs with random inputs, where we either (1) generate inputs without regard to input subdomains, or (2) continuously produce inputs. We suggest that covering likely does indicate superior fault detection under the failure rate model in fuzzing, but proving this would require a better model of fuzzer behavior and may fail to hold for certain classes of fuzzers (e.g., mutational coverage-guided fuzzers [23]). As such, we defer this to future work.
B. Threats to Validity
Tables I to III are results from empirical evaluations. As such, they must be caveated with potential threats that may affect their correctness and generality.
External: The selection of grammars in Section IV-C was based on grammars present in other evaluations of works utilizing the k-path. We do not claim that these results are representative for all grammars; indeed, we can construct grammars for which the resource requirement ratios between k-alt-path and k-path are significantly lower. The general, weaker claims of minimal j-path not covered by k-alt-path and resource requirements are justified in Section IV-B1 and Section IV-B2, respectively.
Similarly, the correlation of the identity metric with k-path and branch coverage presented in Sections III-A and III-B may only be the case for these grammars, which were selected due to their presence in a previous work [15]. Only showing that this correlation is present for a few grammars serves as a counterexample to the claim that strong correlation indicates a strong causal relationship between metrics, obviating this threat.
Internal: The findings of Sections III-A and III-B are subject to the random set of inputs produced by tribble [7]. In degenerative cases, the correlation might be weaker than presented here. We control for this by performing several trials, and reiterate that these measurements serve as a counterexample rather than evidence for a general claim.
Construct: The findings of Sections III-A and III-B use the random generator of tribble configured with a maximum depth of 100. This implements a depth-limited derivation tree generator with random decisions local to alternations being sampled. Other methods for random derivation tree generation exist, so while this is the most typical and straightforward implementation, these results may not represent all forms of random derivation tree sampling. Additionally, we sample up to 100 inputs in both experiments. The choice of the number of samples is arbitrary, and other choices may reveal differing strengths of correlation. Given that this experiment serves primarily as an example of how correlation can be misleading, we believe that neither of these threats invalidate our findings.
C. Implications for Modern Fuzzing
In Section IV-C, we consider grammars from works that prototype a relatively new class of fuzzing, called language-based testing (LBT) [12, 11]. These fuzzers use grammars in combination with constraints to produce inputs that satisfy requirements beyond syntactic validity. An open question in LBT and other modern input generation strategies is how one produces diverse inputs; while both ISLA [12] and FANDANGO [11] achieve some amount of syntactic diversity as measured by k-path, it is so far unclear whether this (in the context of their constrained generation) corresponds to an increased semantic diversity. Indeed, for FANDANGO in particular (which uses evolutionary search to satisfy constraints), this question is critical for ensuring satisfaction of multitudinous constraint systems [24]. In the same way that lexical and syntactic diversity have no covering relationships as explored in Section V-B, the same is likely true for semantic diversity (e.g., there are likely many desirable metrics that would not be captured by grammar-agnostic ones). The misalignment of generation objectives and the metrics used to diversify inputs in generation processes of LBT, LLM-based test generation, and other specialized generators demands future work that develops metrics that can truly measure the semantic diversity of test cases.
Furthermore, our work demonstrates that the comparison of metrics must be heavily scrutinized. Correlation of metrics spontaneously emerging merely as a result of sampling indicates that conclusions based on correlation must be extremely specific as to the sampling pattern used and denote that results are not general. Comparisons that consider performance (e.g., by Mann-Whitney U, as per fuzzing evaluation standard [25]) must ensure to compare against reasonable baselines (e.g. ident presented here) along comparable objectives (e.g., time or number of generated inputs), but ultimately compare generation techniques, not metrics. Works performing metric or technique comparisons should also consider set-theoretic analyses that do not remove nuance about how these metrics are covered [26], as aggregate comparisons can obscure the differences between approaches.
D. Related Work
Partition Testing: Our work retreads numerous findings; Section III mostly discusses known consequences of comparing metrics with statistical modeling [27, 28]. The network of covering relationships presented in Section V was inspired largely by Zhu [29], which builds a network for the subsume relation between various code coverage metrics. Presenting new metrics that improve upon existing metrics and proving their relationships is a motif of partition testing literature [30], and we happily extend this tradition to input metrics. We hope this paper will act as a bridge for new research in input generation techniques to engage with partition testing works, which provide methods to reason about new metrics.
Statistical fuzzer modeling: Likewise, we believe our findings are related to other recent studies of test adequacy metrics in fuzzing literature. Böhme et al. [19] showed recently that, while code coverage and fault coverage are very strongly correlated, there is no strong agreement between these metrics. In other words, while one can predict that a fuzzer with high coverage will also find more faults, one cannot predict the ranking of a collection of fuzzers by fault coverage from the ranking by code coverage. While initially puzzling, this result is, in essence, the same observation of our analysis in Section III-B: while increasing aggregate code coverage guarantees that more code will be tested, it says nothing about which code regions are tested nor the depth to which those code regions are tested. Moreover, the correlative result shares further similarity with Section III-A: while code coverage correlates with fault coverage, this also says nothing about the degree to which code coverage covers fault coverage. In the context of test suites, where there is greater dissimilarity between individual suites, this correlation weakens [18].
Other input metrics: Though we discuss several syntactic input metrics in this paper, there are a few niche metrics which are not compared in this paper due to dissimilarity in their design. There are quite a few such works; we review the most prominent or related to this work below.
From the syntactic approach, Lämmel and Schulte [31] considers combinatorial coverage, or the coverage of entire derivation trees up to a certain depth or at certain boundaries. This trivially covers many of the path-based metrics presented in this paper, but is exponential with depth. To refine this, Lämmel and Schulte also consider a number of “control mechanisms” which mitigate this exponentiality at the cost of some completeness. Fryer et al. [32] defines a grammar coverage metric based on the pairs of grammar elements encountered during pre-order traversal of the derivation tree, giving a “horizontal” coverage compared to the “vertical” syntactic metrics discussed in this paper. It additionally defines synthetic nonterminals to represent certain fields present in binary context-sensitive grammars, whereas the grammars presented in this paper are restricted or reduced to context-free.
Semantic coverage metrics have been defined, but are often too complex to see widespread adoption. Kalinov et al. [13] introduce a number of semantic coverage metrics specific to compiler testing, namely those based on abstract state machines (historically, “evolving algebras”) [33] and tree-finite state machines [34]. This work then generates test cases which increasingly satisfy these metrics, finding several faults. As far as we could find, there are no works which subsequently attempt to use these metrics. Schumi and Sun [35] identified (though do not experiment to confirm) that the computational cost of these metrics were prohibitive, and improve upon them by making their measurement tractable for large-scale testing. They do not relate the strength of their metric against that of Kalinov et al. [13], but their prototype reveals a number of faults in the Java and Solidity compilers with relatively few test cases, taking several weeks to generate and execute. So far, we could not find any work that has evaluated whether guidance by input semantic coverage metrics meaningfully improve fault coverage over syntactic coverage metrics or traditional mutational code coverage-guided fuzzers alone. These questions remain open for future works which generate highly constrained inputs.
VII. Conclusion
In this paper, we outline, justify, utilize, and systematize existing partition testing techniques for comparing input-based test adequacy criteria (i.e., input metrics). We do this to create a foothold for future research in developing input metrics for new problems facing the testing field, like those of complex input generation. In the course of our work, we significantly improve k-path with k-alt-path, doing so using partition testing analysis to identify desirable metric properties, namely concision and sensitivity. For now, we hope that this work serves to bring interest to the development of new metrics, identifying and remediating weaknesses in those that already exist and exploring new ways to describe and understand our test suites. In future work, we plan to use this analysis further by developing language-specific semantic metrics and integrating them into modern input generation tools.
ARTIFACT AVAILABILITY
All code used in this work may be found on Zenodo:
https://doi.org/10.5281/zenodo.19251724
This artifact directly constructs Tables I to III and includes experimental data which was generated or measured during our evaluation for reference. This code should execute on any modern consumer Linux computer and is not affected by performance.
ACKNOWLEDGMENTS
A deep thank you to all my colleagues who reviewed this work, especially Keno Hassler, Jasper von der Heidt, Moritz Schloegel, Sahil Sihag, Alexi Turcotte, Xinyi Xu, José Antonio Zamudio Amaya, and Andreas Zeller, who suffered through far denser, rougher drafts. A second thanks to Andrew Fryer, Benjamin Kushigian, and Marcel Böhme for their insightful comments which eventually led to the creation of this paper. I would also like to thank my supervisor, Thorsten Holz, and the Saarbrücken Graduate School of Computer Science for their respective support in my doctoral studies.
REFERENCES
[1] C. E. Shannon, “The redundancy of English,” Transactions of the 7th Conference on Cybernetics, pp. 248–272, 1951.
[2] N. Chomsky, “Three models for the description of language,” IEEE Transactions on Information Theory, vol. 2, no. 3, p. 113–124, 1956.
[3] G. K. Pullum and G. Gazdar, “Natural languages and context-free languages,” Linguistics and Philosophy, vol. 4, no. 4, p. 471–504, 1982.
[4] P. Purdom, “A sentence generator for testing parsers,” BIT Numerical Mathematics, vol. 12, no. 3, 1972.
[5] A. Celentano, S. C. Reghizzi, P. D. Vigna, C. Ghezzi, G. Granata, and F. Savoretti, “Compiler testing using a sentence generator,” Software: Practice and Experience, vol. 10, no. 11, p. 897–918, 1980.
[6] R. Lämmel, Grammar Testing, ser. Lecture Notes in Computer Science. Berlin, Germany: Springer, 2001, vol. 2029, p. 201–216.
[7] N. Havrikov and A. Zeller, “Systematically covering input structure,” in 34th IEEE/ACM International Conference on Automated Software Engineering. New York, NY, USA: IEEE, 2019, pp. 189–199.
[8] J. Zhang, X. Hu, C. Gao, X. Xia, and S. Li, “Enhancing automated unit test generation with large language models: A systematic literature review,” ACM Transactions on Software Engineering Methodology, 2026.
[9] X. Yang, Y. Chen, E. Eide, and J. Regehr, “Finding and understanding bugs in C compilers,” in 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, M. W. Hall and D. A. Padua, Eds. New York, NY, USA: ACM, 2011, pp. 283–294.
[10] S. Groß, “Fuzzil: Coverage guided fuzzing for javascript engines,” Master, Karlsruhe Institute of Technology, Karlsruhe, Germany, 2018. [Online]. Available: https://saelo.github.io/papers/thesis.pdf
[11] J. A. Zamudio Amaya, M. Smytzek, and A. Zeller, “FAN-DANGO: evolving language-based testing,” Proceedings of the ACM on Software Engineering, vol. 2, no. ISSTA, pp. 894–916, 2025.
[12] D. Steinhöfel and A. Zeller, “Input invariants,” in 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. New York, NY, USA: ACM, 2022, pp. 583–594.
[13] A. Y. Kalinov, A. S. Kossatchev, A. K. Petrenko, M. Posypkin, and V. Shishkov, “Coverage-driven automated compiler test suite generation,” in Workshop on Language Descriptions, Tools and Applications, ser. Electronic Notes in Theoretical Computer Science, no. 3. Amsterdam, Netherlands: Elsevier, 2003, pp. 500–514.
[14] P. G. Frankl and E. J. Weyuker, “A formal analysis of the fault-detecting ability of testing methods,” IEEE Transactions on Software Engineering, vol. 19, no. 3, pp. 202–213, 1993.
[15] N. Havrikov, A. Kampmann, and A. Zeller, “From input coverage to code coverage: Systematically covering input structure with k-paths,” 2023.
[16] C. Spearman, “The proof and measurement of association between two things,” The American Journal of Psychology, vol. 15, no. 1, p. 72, 1904.
[17] P. Flajolet, D. Gardy, and L. Thimonier, “Birthday paradox, coupon collectors, caching algorithms and self-organizing search,” Discrete Applied Mathematics, vol. 39, no. 3, pp. 207–229, 1992.
[18] L. Inozemtseva and R. Holmes, “Coverage is not strongly correlated with test suite effectiveness,” in 36th International Conference on Software Engineering. New York, NY, USA: ACM, 2014, p. 435–445.
[19] M. Böhme, L. Szekeres, and J. Metzman, “On the reliability of coverage-based fuzzer benchmarking,” in 44th IEEE/ACM International Conference on Software Engineering. New York, NY, USA: ACM, 2022, pp. 1621–1633.
[20] K. Serebryany, M. Lifantsev, K. Shtoyk, D. Kwan, and P. Hochschild, “Silifuzz: Fuzzing CPUs by proxy,” arXiv, vol. abs/2110.11519, 2021.
[21] T. T. Chekam, M. Papadakis, Y. L. Traon, and M. Harman, “An empirical study on mutation, statement and branch coverage fault revelation that avoids the unreliable clean program assumption,” in 39th International Conference on Software Engineering. New York, NY, USA: IEEE / ACM, 2017, pp. 597–608.
[22] T. A. Thayer, M. Lipow, and E. C. Nelson, Software reliability: a study of large project reality, ser. TRW Series of Software Technology. Amsterdam, Netherlands: North-Holland Publ. Co, 1978.
[23] V. J. M. Manès, H. Han, C. Han, S. K. Cha, M. Egele, E. J. Schwartz, and M. Woo, “The art, science, and engineering of fuzzing: A survey,” IEEE Transactions on Software Engineering, vol. 47, no. 11, pp. 2312–2331, 2021.
[24] K. Deb, “Multi-objective genetic algorithms: Problem difficulties and construction of test problems,” Evolutionary Computation, vol. 7, no. 3, p. 205–230, 1999.
[25] M. Schloegel, N. Bars, N. Schiller, L. Bernhard, T. Scharnowski, A. Crump, A. A. Ebrahim, N. Bissantz, M. Muench, and T. Holz, “Sok: Prudent evaluation practices for fuzzing,” in 45th IEEE Symposium on Security and Privacy. New York, NY, USA: IEEE, 2024, pp. 1974–1993.
[26] A. Crump, S. Sihag, and M. Leonelli, “SBFT’25 competition report - fuzzing track,” in 2025 IEEE/ACM International Workshop on Search-Based and Fuzz Testing. New York, NY, USA: IEEE, 2025, pp. 9–12.
[27] A. S. Namin and J. H. Andrews, “The influence of size and coverage on test suite effectiveness,” in 18th International Symposium on Software Testing and Analysis. New York,
NY, USA: ACM, 2009, pp. 57–68.
[28] M. Staats, G. Gay, M. W. Whalen, and M. P. E. Heimdahl, "On the danger of coverage directed test case generation," in 15th International Conference on Fundamental Approaches to Software Engineering, ser. Lecture Notes in Computer Science, vol. 7212. Berlin, Germany: Springer, 2012, pp. 409–424.
[29] H. Zhu, “A formal analysis of the subsume relation between software test adequacy criteria,” IEEE Transactions on Software Engineering, vol. 22, no. 4, pp. 248–255, 1996.
[30] H. Zhu, P. A. V. Hall, and J. H. R. May, “Software unit test coverage and adequacy,” ACM Computing Surveys, vol. 29, no. 4, pp. 366–427, 1997.
[31] R. Lämmel and W. Schulte, “Controllable combinatorial coverage in grammar-based testing,” in 18th International Conference on Testing of Communicating Systems, ser. Lecture Notes in Computer Science. Berlin, Germany: Springer, 2006, pp. 19–38.
[32] A. Fryer, T. Dean, and B. Lachine, “Input output grammar coverage in fuzzing,” in 41st IEEE Military Communications Conference. New York, NY, USA: IEEE, 2023, pp. 937–943.
[33] Y. Gurevich, “Evolving algebras 1993: Lipari guide,” in Specification and validation methods. Oxford, UK: Oxford University Press, 1993, pp. 9–36.
[34] P. W. Kutter and A. Pierantonio, “Montages specifications of realistic programming languages,” Journal of Universal Computer Science, vol. 3, no. 5, pp. 416–442, 1997.
[35] R. Schumi and J. Sun, “Spectest: Specification-based compiler testing,” in 24th International Conference on Fundamental Approaches to Software Engineering, ser. Lecture Notes in Computer Science. Berlin, Germany: Springer, 2021, pp. 269–291.