Prompt Coverage Adequacy

Florian Tambon, Michael Konstantinou, Cedric Richter, Charles Chenouard, Mark Harman, Mike PapadakisarXiv 2026

TL;DR

As software engineering shifts toward natural language prompts ("vibe coding"), traditional code coverage metrics are becoming obsolete because they measure executed lines of code rather than satisfied user intents. This paper introduces Prompt Coverage Adequacy, a novel testing metric that leverages LLM attention mechanisms to verify whether a test suite actually exercises the requirements specified in a prompt. By shifting the focus from implementation to specification, this approach uncovers over 30% more software faults than traditional code coverage.

What Problem Does This Paper Address?

In traditional software engineering, source code is the primary artifact, and code coverage (e.g., statement or branch coverage) tells us how thoroughly our tests exercise that code. However, in the era of LLM-driven development, developers express goals and requirements in natural language prompts, leaving the code generation to the model.

This paradigm shift exposes a critical flaw in traditional metrics: an LLM can easily generate code that achieves 100% code coverage while completely omitting or misunderstanding key requirements from the prompt. For instance, if a prompt asks for a system that handles bookings, cancellations, and refunds, a test suite might achieve perfect code coverage by only testing bookings and cancellations if the LLM forgot to implement refunds entirely. Traditional metrics cannot flag what isn't there. We need a way to measure test adequacy at the specification (prompt) level, ensuring that every requirement stated by the user is thoroughly evaluated.

Methods

The authors propose Prompt Coverage Adequacy, which automatically maps test cases to specific natural language requirements within a prompt without needing access to the generated source code.

The core technique relies on two key LLM concepts:

  1. Entropy as Surprise: An LLM is "surprised" by (assigns a lower probability to) a test case if it doesn't align with the prompt's requirements. This surprise is formally measured using cross-entropy.
  2. Attention Spotlighting: The method segments a prompt into individual requirement sentences. It then uses a technique called spotlighting to artificially boost the LLM's attention weights toward one specific requirement at a time.
Fig. 2: Computation of Prompt Coverage Adequacy. When prompted with a set of requirements, test cases that validate different aspects of the prompt have nearly equal probability, i.e., the LLM is nearly equally surprised by both test cases. By steering the attention of the LLM (spotlighting) towards specific requirement, the LLM becomes more likely to produce (less surprised by) a test that validates that requirement, indicating by the thickness of the blue arrows. We say that a test covers a requirement if after spotlighting the requirement the LLM becomes significantly less surprised by the test.

If focusing the model's attention on a specific requirement significantly reduces its "surprise" (entropy) when reading a given test case, the metric concludes that the test case successfully covers that requirement. To make this computationally efficient for long test suites, the authors approximate this entropy shift by prompting the LLM to predict a single token indicating whether the test case is entailed by the requirement.

Datasets

The authors evaluated their approach using two prominent code-generation benchmarks:

  • HumanEval+: An enhanced version of OpenAI's HumanEval, consisting of 164 Python programming problems with comprehensive test suites.
  • LiveCodeBench (v6): A benchmark of 112 complex coding contest tasks collected in 2025, designed to mitigate data contamination.

To simulate realistic testing scenarios, they generated 10 candidate solutions per task using Qwen2.5-Coder (7B and 32B variants) and Gemma3 (12B), creating a balanced mix of functionally correct and faulty implementations.

Key Insights and Ideas

  • Testing Intent, Not Syntax: Prompt coverage acts as a semantic bridge. It evaluates whether the test suite covers the semantic space of user requirements rather than the structural characteristics of a specific code implementation.
  • Robustness to Refactoring: Because prompt coverage operates entirely on the input prompt, the metric remains stable across multiple rounds of development, even if the LLM completely rewrites the underlying code structure.
  • Counterfactual Testing: By asking "How would the model react if it looked harder at requirement X?", the method uses the LLM's internal world model to deduce implicit relationships between natural language specifications and executable test code.

Key Results

The experiments yielded highly encouraging results across multiple dimensions:

  • Strong Correlation with Code Coverage: Even though prompt coverage doesn't look at the generated code, higher prompt coverage consistently predicts higher traditional code coverage.
  • Superior Fault Detection: When used to guide automated test generation, prompt coverage vastly outperforms traditional code coverage.
Fig. 5: Venn diagram of faults detected per each method: code guided (blue) or prompt guided (orange). Data for HumanEval+ (left) or LiveCodeBench (right).

As shown in the evaluation, prompt coverage-driven test generation caught 49% of faults in HumanEval+ and 57% in LiveCodeBench. In contrast, traditional code coverage-driven generation only caught 18% and 24% respectively. This represents a massive 30+% absolute increase in fault-detection effectiveness.

Limitations and Future Work

While promising, the authors highlight several limitations:

  • White-Box Dependency: The metric currently requires access to the model's internal attention weights and token probabilities, meaning it cannot be easily used with closed-source, API-only models like GPT-4 or Claude 3.5 Sonnet without using an open-source model as a proxy evaluator.
  • Prompt Complexity: The benchmarks used contain relatively concise, well-structured prompts. How well this scales to massive, messy industrial requirements documents remains an open question.
  • Language Scope: The evaluation was restricted entirely to Python code generation.

Future work will focus on extending prompt coverage to multi-turn conversational interactions, autonomous agent workflows, and hybrid metrics that combine both prompt-level and code-level coverage for maximum assurance.

Summary updated

BibTeX
@misc{tambon2026prompt,
  author = {Florian Tambon and Michael Konstantinou and Cedric Richter and Charles Chenouard and Mark Harman and Mike Papadakis},
  title = {{Prompt Coverage Adequacy}},
  year = {2026},
  eprint = {2607.02057},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.02057},
}
Figure