HEX: Change Risk as Hazard × Exposure

Two families of software metric have grown up without meeting. One measures how dangerous a piece of code is from its structure - cyclomatic complexity, coupling, the Chidamber–Kemerer suite, the Maintainability Index. The other measures how well a change would be caught, from its tests - statement and branch coverage, mutation score, combinatorial coverage of the input space. Very few metrics draw on both, and the best-known that does - CRAP - multiplies complexity by uncovered code and stops there, inheriting a proxy for test quality that has been known for a decade to be weak. HEX is a per-construct change-risk score that spans the gap: risk is hazard, how much a change can break, times exposure, how little the tests would notice. Hazard combines complexity and efferent coupling; exposure combines coverage and the variety of inputs the tests actually drive and assert on. The CRAP-lineage variant of the same components reduces to CRAP exactly, so HEX contains it rather than competing with it. The asserted-variety signal that separates HEX from its coverage-based ancestors is only cheaply computable because the EK9 language makes @Test and assert first-class constructs rather than library conventions: the compiler owns the assertion grammar, so which construct's result a test pins down is a by-product of parsing, not an inference over a test framework. HEX is, in that sense, less a new formula than a demonstration of what pulling test structure into the language makes available. This is a position paper: the metric is argued, not validated. The paper is explicit about the calibration bind that makes it so - a corpus with a defect history lacks the input-variety signal, and a language new enough to emit the signal lacks a defect history — and about the ablation on a defect-labelled corpus that would settle whether asserted input variety adds predictive power over coverage.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-08-03
DOI
https://doi.org/10.5281/zenodo.21769907
Primary Topic
Software Engineering Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

HEX: Change Risk as Hazard × Exposure

Stephen Limb
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
preprint

HEX: Change Risk as Hazard × Exposure

Stephen Limb
preprint en

Abstract

Two families of software metric have grown up without meeting. One measures how dangerous a piece of code is from its structure - cyclomatic complexity, coupling, the Chidamber–Kemerer suite, the Maintainability Index. The other measures how well a change would be caught, from its tests - statement and branch coverage, mutation score, combinatorial coverage of the input space. Very few metrics draw on both, and the best-known that does - CRAP - multiplies complexity by uncovered code and stops there, inheriting a proxy for test quality that has been known for a decade to be weak. HEX is a per-construct change-risk score that spans the gap: risk is hazard, how much a change can break, times exposure, how little the tests would notice. Hazard combines complexity and efferent coupling; exposure combines coverage and the variety of inputs the tests actually drive and assert on. The CRAP-lineage variant of the same components reduces to CRAP exactly, so HEX contains it rather than competing with it. The asserted-variety signal that separates HEX from its coverage-based ancestors is only cheaply computable because the EK9 language makes @Test and assert first-class constructs rather than library conventions: the compiler owns the assertion grammar, so which construct's result a test pins down is a by-product of parsing, not an inference over a test framework. HEX is, in that sense, less a new formula than a demonstration of what pulling test structure into the language makes available. This is a position paper: the metric is argued, not validated. The paper is explicit about the calibration bind that makes it so - a corpus with a defect history lacks the input-variety signal, and a language new enough to emit the signal lacks a defect history — and about the ablation on a defect-labelled corpus that would settle whether asserted input variety adds predictive power over coverage.

Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

HEX: Change Risk as Hazard × Exposure — Stephen Limb · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS