Table of Contents
Fetching ...

Detecting Underspecification in Software Requirements via k-NN Coverage Geometry

Wenyan Yang, Tomáš Janovec, Samantha Bavautdin

Abstract

We propose \geogap{}, a geometric method for detecting missing requirement types in software specifications. The method represents each requirement as a unit vector via a pretrained sentence encoder, then measures coverage deficits through $k$-nearest-neighbour distances z-scored against per-project baselines. Three complementary scoring components -- per-point geometric coverage, type-restricted distributional coverage, and annotation-free population counting -- fuse into a unified gap score controlled by two hyperparameters. On the PROMISE NFR benchmark, \geogap{} achieves 0.935 AUROC for detecting completely absent requirement types in projects with $N \geq 50$ requirements, matching a ground-truth count oracle that requires human annotation. Six baselines confirm that each pipeline component -- per-project normalisation, neural embeddings, and geometric scoring -- contributes measurable value.

Detecting Underspecification in Software Requirements via k-NN Coverage Geometry

Abstract

We propose \geogap{}, a geometric method for detecting missing requirement types in software specifications. The method represents each requirement as a unit vector via a pretrained sentence encoder, then measures coverage deficits through -nearest-neighbour distances z-scored against per-project baselines. Three complementary scoring components -- per-point geometric coverage, type-restricted distributional coverage, and annotation-free population counting -- fuse into a unified gap score controlled by two hyperparameters. On the PROMISE NFR benchmark, \geogap{} achieves 0.935 AUROC for detecting completely absent requirement types in projects with requirements, matching a ground-truth count oracle that requires human annotation. Six baselines confirm that each pipeline component -- per-project normalisation, neural embeddings, and geometric scoring -- contributes measurable value.
Paper Structure (61 sections, 10 equations, 10 figures, 7 tables)

This paper contains 61 sections, 10 equations, 10 figures, 7 tables.

Figures (10)

  • Figure 1: The GeoGap pipeline. Stage 1 builds the reference corpus (embeddings, topics, type centroids). Stage 2 computes three complementary gap scores. Stage 3 fuses them and produces a structured gap report with heatmaps.
  • Figure 2: Three scoring components. (a) Geometric coverage ($\Psi_{\mathrm{geo}}$): unrestricted $k$-NN finds a cross-type neighbour, masking the gap. (b) Type-restricted coverage ($\Psi_{\mathrm{type}}$): restricting to same-type neighbours reveals the gap. (c) Population count ($\Psi_{\mathrm{pop}}$): the target has far fewer Performance requirements than the corpus average.
  • Figure 3: Geometric intuition. (a) A covered region: the target has requirements near corpus point $x$, so $\varphi$ is small. (b) A gap region: the target's nearest requirement is far from $x$, so $\varphi$ is large. Per-project normalisation (Figure \ref{['fig:normalisation']}) determines whether a large $\varphi$ is unusual or merely reflects inherent sparsity.
  • Figure 4: Per-project normalisation. (a) In a sparse region, all projects are equally far from $x$, so the target is typical ($\psi \approx 0$, not a gap). (b) In a dense region, training projects are close but the target is far ($\psi \gg 0$: genuine gap).
  • Figure 5: Score fusion via two hyperparameters. Three configurations are studied (Table \ref{['tab:configs']}).
  • ...and 5 more figures