Encoding Public-Health Ethics Constraints as Executable Tests: A Design Pattern and Reference Implementation for Behavioral Public Health Decision Support
Digital public-health systems that detect overdose risk, treatment interruption, or heat-illness vulnerability can either connect people to support or, if misdesigned, convert vulnerability into suspicion and drive the people who most need help away from institutions. Ethical requirements for such systems are usually stated in guidelines, governance frameworks, or operational rules. Documents, however, do not fail loudly: an implementation can silently drift away from its stated ethics, and the violation may only be discovered in production. We propose a design pattern in which domain-specific ethics constraints of a decision-support system are encoded as ordinary executable unit tests over the system’s domain layer, so that violations can be detected during software development rather than after deployment. We identify five recurring classes of testable ethics invariants: score-composition constraints, information-flow constraints, absence-of-path constraints, content-safety constraints, and procedural constraints. We provide a working reference implementation, the Behavioral Public Health Navigator (BPHN), covering six behavioral public-health use cases: overdose prevention, polypharmacy, care interruption, heat illness, immunization and screening follow-up, and disaster health continuity. BPHN assesses cases on six separated axes—safety risk, support need, access barrier, care-coordination need, equity concern, and integrity concern—rather than a single composite risk score. Its automated test suite contains 58 tests, including tests that directly encode ethical and safety invariants. A paired Monte Carlo policy simulator using entirely synthetic data and assumption-based parameters illustrates why axis separation matters: an intervention may improve an incidence-related measure while simultaneously widening an equity-related measure. The simulation is presented as a methodological demonstration rather than an empirical estimate of intervention effectiveness. Encoding ethics constraints as executable tests turns aspirational requirements into regression-protected properties of software. The approach is intended to complement, not replace, governance, legal review, clinical review, and stakeholder engagement. All person-level data used in the reference implementation are synthetic, and the system should not be used for clinical or policy decisions without calibration and expert review.
Authors
- Kunihisa Ohno (ORCID: https://orcid.org/0009-0009-2710-2043)
Institutions
- Jinchuan (China) (CN)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-21
- DOI
- https://doi.org/10.5281/zenodo.22874159
- Primary Topic
- Information and Cyber Security
- Type
- preprint