White-Box Testing

White-box testing checks a health economic model by reading its formulas cell by cell or code line by line to confirm each calculation works as specified.

Status
Published, version 1.0.0
Last reviewed
12 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

White-Box Testing of Health Economic Models

White-box testing is the part of model checking in which a reviewer opens a health economic model and follows its formulas or code, step by step, to see whether each calculation does what the model report says it does. It belongs to technical verification, the question of whether the model was built right, and it complements black-box testing, which judges a model only by how its outputs respond to changed inputs. The CDA-AMC Model Validation Tool, developed at CADTH by Coyle and colleagues, states that black-box testing cannot show whether a model is giving correct results and that only white-box testing can. The term differs from the white box model of the dictionary, which describes a transparent model, and from Robinson's white-box validation, which compares each part of a simulation with the real world.

Verification rather than validation

Sargent adopts the definition of verification as ensuring that the computer program of a computerised model and its implementation are correct, and keeps validation for whether the model is accurate enough for its intended use within its domain of applicability. White-box testing sits on the verification side, because it compares the code with the model's own specification. Eddy and colleagues, for the ISPOR-SMDM task force, describe two main steps in verification, checking the individual equations and checking their accurate implementation in code, with equations and parameters validated against their sources.

The term comes from software engineering, where white-box tests are done with knowledge of how the code works. For a health economic model, the TECH-VER checklist by Büyükkaramikli and colleagues defines white-box testing as going through the code line by line, or through the formulae in all related spreadsheet ranges cell by cell.

What the reviewer reads and in which direction

The CDA-AMC tool frames the aim as establishing whether the links between inputs and outputs are appropriate. Its items 47 and 48 ask whether a reviewer can trace the model results back to where the inputs are entered, and trace any input forward into the results of a single Monte Carlo simulation. The backward pass starts at a strategy's total costs or QALYs and ends at the inputs, and the forward pass follows an input, such as a price, through every cell it feeds. The tool directs effort to the inputs that most change QALYs and costs when altered.

TECH-VER organises the work by the stages of a model's calculations and names calculations that merit white-box attention at each stage.

TECH-VER stageCalculations suggested for white-box testing
1, input calculationsTechnology acquisition cost per cycle; how transition probabilities are generated and how the treatment effect is applied
2, event and state calculationsHow transition probabilities move patients between states for a few cycles; how costs and utilities are assigned to states and events
3, result calculationsHow discounted and half-cycle corrected costs and QALYs are summed; how ICERs are derived; how costs and QALYs are disaggregated

TECH-VER notes that Excel's Error checking and Evaluate formula options, or the debug tools for Visual Basic for Applications, can help, but they do not remove the need for cell-by-cell or line-by-line inspection. Reading code without running it corresponds to what Sargent, citing Fairley, calls static testing, while dynamic testing executes the program and judges it by the values produced, with traces that follow entities through the model among its usual techniques. Balci's taxonomy of simulation verification and validation techniques uses the terms differently, placing structural or white-box testing, such as branch and path testing, among the dynamic techniques that require model execution, and desk checking and inspections among the informal techniques.

Where it sits in the order of tests

TECH-VER treats completeness and consistency checks as a prerequisite, then orders its correctness tests by expected time cost, with black-box tests first, white-box tests second and replication-based tests last. Under a time constraint the authors recommend white-box tests only for key calculations selected in advance and for locating the cause of unexpected behaviour flagged by black-box tests. Replication, such as double programming, is reserved for when white-box tests fail to find the root cause, or when non-transparent, complex programming makes white-box tests harder.

The CDA-AMC tool also runs black-box testing first, but it states that white-box testing should not be limited to areas of concern raised by black-box testing and should cover all parameters judged important. The two documents therefore differ on scope more than on order. While revising TECH-VER, the authors checked each model to which the checklist was applied cell by cell or line by line after the black-box tests, and errors found that way led to new or revised black-box questions.

What makes a model open to white-box testing

White-box testing needs a model whose workings can be read. The CDA-AMC tool warns that a model which is not transparent enough may not allow the necessary testing and cannot then be considered as demonstrating validity. Its general issues of concern for Excel models, which it calls directly relevant to white-box testing, include heavy use of IFERROR and similar statements, of CHOOSE, INDIRECT, OFFSET and INDEX, hidden sheets, rows or columns, and user-created formulas inside VBA macros. It adds that overreliance on macros may make white-box testing impractical. Ghabri and colleagues list not hiding anything and minimising custom macros among good construction practices, and list evaluating all equations separately, including how they feed values into each other, among good verification practices.

Who does it and what gets reported

Robinson advises modellers to read through their code as they build and to have someone else read it as a second check, and reviewers repeat the exercise on submitted models. AdViSHE item C1 asks whether modelling experts have examined the computerised model, and lists absence of apparent bugs, logical code structure and appropriate translation of the conceptual model among the aspects to judge. NICE PMG36 (2022, updated 2026), section 4.6.4, asks companies to detail the quality assurance methods used in developing the model, which is where a record of white-box checks belongs. Eddy and colleagues recommend that the methods of verification be described in the model's non-technical documentation, with pertinent results available on request, and TECH-VER asks reviewers to document the tests conducted and omitted, with reasons.

TECH-VER gives cases from practice. In the NICE submission for ramucirumab in gastric cancer, hospitalisation rates that included adverse events were costed each cycle alongside separate adverse event costs that also covered hospitalisation, a double counting error detected during white-box testing. In a student model, treatment-specific utilities for two interventions had been assigned the wrong way round, an error that replication tests flagged and white-box tests then located.

Worked example of a forward trace finding a missing stopping rule

All numbers are illustrative. A Markov cohort model with one-year cycles and a four-year horizon, without discounting, compares a new drug with standard care. The report says the drug costs GBP 10,000 per cycle and is given for at most two cycles. Ten per cent of the cohort die each year in both arms, so the proportions alive at the start of cycles 1 to 4 are 1.000, 0.900, 0.810 and 0.729. The specified drug cost per person is

C=∑t=1Tp St ItC = \sum_{t=1}^{T} p \, S_t \, I_t

where CC is undiscounted drug acquisition cost per person, TT is the number of cycles (4), pp is the drug cost per cycle (GBP 10,000), StS_t is the proportion alive at the start of cycle tt, and ItI_t equals 1 when tt is at most the maximum number of treatment cycles dd (2) and 0 otherwise.

1. Result as specified. Only cycles 1 and 2 count, so CC = 10,000 × (1.000 + 0.900) = GBP 19,000.

2. Model as received. The model reports a drug cost of GBP 34,390. Other costs are GBP 3,000 lower with the drug and the incremental QALY gain is 0.80, so the model gives an ICER of (34,390 − 3,000) / 0.80 = 31,390 / 0.80 = GBP 39,237.50 per QALY.

3. Black-box tests pass. Equal effectiveness in both arms gives equal QALYs, since the fault does not touch QALYs. Raising the drug price raises costs only in the drug arm, as expected. Shortening the horizon to two cycles lowers costs, and at that horizon the faulty and correct models both give GBP 19,000, so the fault cannot show.

4. White-box forward trace. The reviewer chose drug acquisition cost per cycle in advance, as TECH-VER suggests. Following the price input forward shows that every cycle's cost cell multiplies the price by the proportion alive, and the maximum-duration input feeds no cell at all. The model computes 10,000 × 3.439 = GBP 34,390, where 3.439 is the sum of all four proportions alive.

5. Backward check and correction. Tracing back from the total confirms it sums all four cycles. With the stopping rule linked, the drug cost is GBP 19,000 and the ICER becomes (19,000 − 3,000) / 0.80 = 16,000 / 0.80 = GBP 20,000 per QALY. At an illustrative threshold of GBP 25,000 per QALY, incremental net monetary benefit moves from 25,000 × 0.80 − 31,390, or minus GBP 11,390, to 25,000 × 0.80 − 16,000 = GBP 4,000.

TECH-VER reports an error of this kind in a student model, where drug costs ran for as long as patients were alive although the drug could be given for at most ten cycles. A black-box test varying the maximum duration would also have exposed it, had the test list included one.

Neighbouring terms and other meanings

White-box testing reads the formulas, while black-box testing watches outputs. Replication, by contrast, rebuilds the calculation. A hand calculation check of one result, unit testing of a single module and a structured walkthrough, in which the programmer explains the code to others who search for errors, are neighbouring verification techniques, and the walkthrough is the closest to white-box testing because it also reads the code. Robinson defines white-box validation as checking that each part of the model represents the real world closely enough, a validation question that Robinson keeps separate from verification, conceptual model validation and data validation, although the same code checks serve both.

Limits of reading the code

White-box testing checks that the code matches the specification but cannot show that the specification is right. Eddy and colleagues note that verification helps ensure there are no unintentional computational errors but does not evaluate the accuracy of the model's structure or predictions. Their example is a distance equation set up as a sum of rate and time terms instead of their product, which can be fitted and coded correctly and still give wrong results. Reading every cell of a large model is slow, which is why TECH-VER rations it. The checklist deliberately assigns no verification score, because a score might give a false sense of security, so a white-box record is a log of what was checked, read alongside model validation against data and other models.

Sources

  • Abraham K, Corro Ramos I, Braal CL, Feenstra T, Kleijburg A, van Voorn GAK, Uyl-de Groot C. Under-reporting of validation efforts for health economic models persists despite the availability of validation tools: a systematic review. PharmacoEconomics. 2025;43:849-858. https://doi.org/10.1007/s40273-025-01491-2
  • Balci O. Verification, validation and accreditation of simulation models. In: Proceedings of the 1997 Winter Simulation Conference. 1997:135-141. https://www.informs-sim.org/wsc97papers/0135.PDF
  • Büyükkaramikli NC, Rutten-van Mölken MPMH, Severens JL, Al M. TECH-VER: a verification checklist to reduce errors in models and improve their credibility. PharmacoEconomics. 2019;37(11):1391-1408. https://doi.org/10.1007/s40273-019-00844-y
  • Coyle D, Haines A, Lee K. The development of a model validation tool to assist in the conduct of economic evaluations. Canadian Journal of Health Technologies. 2024;4(3). https://doi.org/10.51731/cjht.2024.862
  • Eddy DM, Hollingworth W, Caro JJ, Tsevat J, McDonald KM, Wong JB. Model transparency and validation: a report of the ISPOR-SMDM Modeling Good Research Practices Task Force-7. Value in Health. 2012;15(6):843-850. https://doi.org/10.1016/j.jval.2012.04.012
  • Ghabri S, Stevenson M, Möller J, Caro JJ. Trusting the results of model-based economic analyses: is there a pragmatic validation solution? PharmacoEconomics. 2019;37(1):1-6. https://doi.org/10.1007/s40273-018-0711-9
  • National Institute for Health and Care Excellence. NICE technology appraisal and highly specialised technologies guidance: the manual (PMG36). Published 31 January 2022, last updated 13 October 2026. Section 4.6.4. https://www.nice.org.uk/process/pmg36
  • Robinson S. Simulation model verification and validation: increasing the users' confidence. In: Proceedings of the 1997 Winter Simulation Conference. 1997:53-59. https://www.informs-sim.org/wsc97papers/0053.PDF
  • Sargent RG. Verification and validation of simulation models. In: Proceedings of the 2011 Winter Simulation Conference. 2011:183-198. https://www.informs-sim.org/wsc11papers/016.pdf
  • Vemer P, Corro Ramos I, van Voorn GAK, Al MJ, Feenstra TL. AdViSHE: a validation-assessment tool of health-economic models for decision makers and model users. PharmacoEconomics. 2016;34(4):349-361. https://doi.org/10.1007/s40273-015-0327-2

Frequently Asked Questions (6)

  • What is White-Box Testing?

    White-box testing checks a health economic model by reading its formulas cell by cell or code line by line to confirm each calculation works as specified.

    Source: Büyükkaramikli et al. 2019

  • How is white-box testing carried out on a spreadsheet health economic model?

    The TECH-VER checklist by Büyükkaramikli and colleagues describes white-box testing as scrutinising the formulae in all related ranges of a spreadsheet cell by cell, or reading program code line by line. The checklist names calculations that merit this attention at each stage of a model. Examples include the drug acquisition cost per cycle, how transition probabilities move patients between states for a few cycles and how discounted, half-cycle corrected costs and QALYs are summed and ICERs derived. Excel options such as Error checking and Evaluate formula can help the reviewer, but TECH-VER states that they do not remove the need for detailed cell-by-cell inspection.

    Source: Büyükkaramikli et al. 2019

  • How does white-box testing differ from black-box testing when an HTA reviewer checks a company model?

    Black-box testing judges a model by how its outputs respond to changed inputs, without any need to know how the model works inside. The CDA-AMC Model Validation Tool by Coyle and colleagues states that black-box testing cannot identify whether a model is giving correct results, which only white-box testing can establish. The tool runs black-box testing first and then scrutinises the coding. It also states that white-box testing should not be limited to areas of concern raised by black-box testing, and should cover all parameters judged important, with effort directed to inputs that most change costs and QALYs.

    Source: Coyle et al. 2024

  • Where does white-box testing sit in the TECH-VER order of verification tests?

    TECH-VER treats completeness and consistency checks as a prerequisite and then orders its correctness tests by expected time cost. Black-box tests come first, white-box tests second and replication-based tests last. Under a time constraint, the authors recommend white-box tests only for key calculations selected in advance and for locating the cause of unexpected behaviour flagged by black-box tests. Replication, such as double programming, is reserved for cases where white-box tests fail to find the root cause, or where non-transparent, complex programming makes white-box tests more challenging.

    Source: Büyükkaramikli et al. 2019

  • What features of a submitted model make white-box testing hard for HTA reviewers?

    The CDA-AMC Model Validation Tool by Coyle and colleagues warns that a model which is not sufficiently transparent may not allow the necessary testing, and then cannot be considered as demonstrating validity. It lists Excel features of direct relevance to white-box testing, among them heavy reliance on IFERROR and similar statements and on CHOOSE, INDIRECT, OFFSET and INDEX. Hidden sheets, rows or columns and user-created formulas embedded within VBA macros are also listed. The tool adds that overreliance on macros may make white-box testing impractical, which limits the ability to validate the model.

    Source: Coyle et al. 2024

  • What can white-box testing not show about a health economic model?

    White-box testing compares the code with the model's own specification, so it cannot show that the specification itself is right. Eddy and colleagues, for the ISPOR-SMDM task force, note that verification helps ensure there are no unintentional computational errors but does not evaluate the accuracy of a model's structure or predictions. Their example is a distance equation set up wrongly, which can be coded correctly and still give wrong results. A white-box record therefore shows that calculations match their design, and questions of structure and fit to data belong to model validation.

    Source: Eddy et al. 2012

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 12 Nov 2026

Content version: 1.0.0

Canonical Identity

Term code
HE-EM-MV-108

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/white-box-testing