Skip to content
EvalSuite
Documentation menu

Code generation

Generated-code test coverage

Implementedcode.coverage_rate

Definition

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

PythonSince v0.5.0
import evalsuite as es

es.coverage_rate(covered=[45, 10], total=[50, 20])

References

  1. Siddiq ML, Santos JCS, Tanvir RH, et al. Using large language models to generate JUnit tests: an empirical study. EASE. 2024:313-322.

Implementation status