Code generation
Generated-code test coverage
Implemented
code.coverage_rateDefinition
Line (or branch) coverage achieved by generated tests, pooled over programs (covered / coverable), with the mean per-program coverage.
Formula
Σ covered / Σ coverable
Range: [0, 1]
Inputs and outputs
- covered: see the signature of es.coverage_rate
- total: see the signature of es.coverage_rate
Returns: MetricResult (value plus counts, intervals and breakdowns in params)
Assumptions
No assumptions beyond valid, aligned inputs of the documented types.
Limitations
No metric-specific limitations are documented yet. Interpret the value alongside the task, data, and other metrics.
Python API
import evalsuite as es
es.coverage_rate(covered=[45, 10], total=[50, 20])References
- Siddiq ML, Santos JCS, Tanvir RH, et al. Using large language models to generate JUnit tests: an empirical study. EASE. 2024:313-322.