Skip to content
Healthcare SoftwareEngineering

Guide · Quality Engineering

Healthcare Software Testing Guide: Strategy, Tools, and Test Data

Healthcare software fails in ways that generic test suites miss: a malformed OBX segment, a FHIR search that pages differently in production, a screen reader that cannot reach the consent button. This guide covers a testing strategy built for those risks.

12 min read Updated

Start from risk, not from coverage targets

A coverage percentage tells you how much code ran during tests, not whether the tests checked anything that matters. In healthcare, begin with a risk assessment of the features: what could harm a patient, expose PHI, cause a billing error, or break an interface partner? Allocate test depth to match. A medication dose calculation deserves exhaustive boundary testing; a marketing page does not.

Write the risks down and trace tests to them. If the product is or may become a medical device, that traceability is expected as part of the design controls and software lifecycle process. Even when it is not, traceability is what lets you answer an auditor, a customer security reviewer, or your own incident review with evidence.

The test pyramid for healthcare systems

The classic pyramid still applies: many fast unit tests, fewer integration tests, and a small number of end-to-end tests. Healthcare adds a distinct layer for interface and conformance testing, because so much behavior depends on exchanging messages with systems you do not control.

Test layers and what each should catch
LayerScopeExamplesRun frequency
UnitFunctions and classesUnit conversions, date-of-birth age calculations, HL7 field parsing, eligibility rulesEvery commit
Component and contractServices with mocked dependencies; API contractsConsumer-driven contract tests between services; FHIR resource validation against profilesEvery commit
Interface and conformanceMessage exchange with external systemsSynthetic ADT and ORU feeds, FHIR API conformance with Inferno or TouchstoneEvery merge and nightly
End-to-endCritical user journeys across the stackClinician orders a lab and sees the result; patient completes intakeNightly and before release
Non-functionalPerformance, security, accessibility, resilienceLoad tests at peak census, DAST scans, screen-reader checks, failover drillsScheduled and before major releases

Interface testing with synthetic HL7 and FHIR messages

Build a library of synthetic messages that represents the real variety you will receive. Start from each partner's specification, then add the cases that break parsers: escape sequences in names, repeating OBX segments, missing optional fields that turn out to be required in practice, unexpected Z-segments, and timestamps with and without time zones.

Test ordering and duplication explicitly. Send an ADT A08 before the A01 it updates, deliver the same message twice, and send a corrected ORU result after the final. For FHIR, test paging, _include and _revinclude behavior, conditional creates, version conflicts, and token expiry in the middle of a session. Run these suites automatically, not only during integration sprints.

Checklist

  • Message specifications per partner stored with the tests
  • Synthetic message library covering happy path, edge cases, and malformed input
  • Ordering, duplicate, and replay scenarios
  • Acknowledgment behavior verified (AA, AE, AR) and retry logic exercised
  • FHIR resources validated against the relevant US Core or implementation guide profiles
  • Terminology checks: unmapped local codes routed to a review queue, not dropped

Tools: Synthea, Inferno, and Touchstone

Synthea for synthetic patients

Synthea is an open-source synthetic patient generator that produces realistic but fictional patient histories, exportable as FHIR, C-CDA, and CSV. It is useful for populating test environments, load testing with realistic data shapes, and demonstrating features without PHI. Its populations are simulated, so do not use them to validate clinical model performance.

Inferno for FHIR and ONC (g)(10) testing

Inferno is an open-source FHIR testing framework supported by ONC. Its test kits include the ONC Certification (g)(10) Standardized API test kit used in the certification of health IT against criterion 170.315(g)(10), along with kits for other implementation guides. Even if you are not pursuing certification, running Inferno against your FHIR server catches conformance gaps in US Core profiles, SMART authorization, and bulk data export.

Touchstone

Touchstone is a FHIR testing platform from AEGIS used for conformance and interoperability testing, including at HL7 connectathons. It runs TestScript-based scenarios against FHIR servers and clients, which is useful for regression testing your FHIR implementation against published test suites.

Test data: never real PHI without authorization

Copying production data into test environments is the shortcut that causes breaches. Test environments typically have weaker access controls, more users, and less monitoring than production. Default to synthetic data. If a scenario genuinely requires production-derived data, for example to reproduce a defect tied to specific data patterns, obtain authorization under the organization's HIPAA policies, use de-identified or minimum necessary data, and apply production-equivalent safeguards to that environment.

Treat test fixtures and screenshots as potential PHI too. Bug reports with pasted HL7 messages, recorded sessions from a test tool pointed at production, and log files attached to tickets are common leaks.

Performance and resilience testing

Model load on real usage patterns: shift changes, morning clinic starts, Monday after a holiday, open enrollment, month-end claim runs. A patient portal may be quiet at 3 a.m. and saturated at 8 a.m. when appointment reminders go out. Test interfaces at burst volumes, such as an interface engine flushing a backlog after an outage, not just steady state.

Resilience tests matter as much as throughput. Kill a dependency and confirm queues buffer and drain, a circuit breaker opens, and the user sees a useful message rather than a spinner. Confirm that retry storms do not overwhelm a recovering EHR API.

Accessibility testing: WCAG 2.1 AA and Section 1557

Accessibility is a legal and clinical requirement, not polish. Patients with visual, motor, hearing, or cognitive disabilities must be able to schedule, read results, message clinicians, and complete forms. Clinicians with disabilities need accessible tools too.

Combine automated scanning (which catches a portion of issues, such as missing labels and contrast failures) with manual testing using screen readers such as NVDA, JAWS, and VoiceOver, keyboard-only navigation, zoom to 200 percent and reflow, and testing with users with disabilities where possible.

  • Every form control has a programmatic label and clear error messages
  • Full keyboard operability with visible focus
  • Sufficient color contrast; information never conveyed by color alone (e.g. abnormal lab flags)
  • Session timeout warnings that can be extended
  • Charts and results tables readable by assistive technology
  • Accessible PDFs for documents such as visit summaries

Security testing

Build security testing into the pipeline: static analysis (SAST), dependency and container scanning, secrets detection, and infrastructure-as-code policy checks on every change; dynamic scanning (DAST) against deployed test environments; and periodic manual penetration testing focused on business logic, such as whether a patient can view another patient's results by changing an ID.

Use the OWASP Application Security Verification Standard as a checklist for requirements and the OWASP API Security Top 10 for API-heavy products. Test authorization paths specifically: SMART scopes, role-based access, break-the-glass flows, and audit logging of every PHI access.

Checklist

  • SAST, dependency scanning, and secrets detection in CI
  • DAST against a deployed environment before release
  • Authorization tests for horizontal and vertical privilege escalation
  • Audit log entries verified for PHI read, write, and export events
  • Annual or major-release penetration test with remediation tracked

References

This guide is educational and is not legal or regulatory advice.

Frequently asked questions

Can we use production patient data for testing?

Not by default. Use synthetic data, generated with tools such as Synthea, and synthetic HL7 and FHIR messages. If a specific scenario requires production-derived data, it needs authorization under the organization's HIPAA policies, should be de-identified or limited to the minimum necessary, and the test environment must have safeguards equivalent to production.

What is Inferno used for?

Inferno is an open-source FHIR testing framework supported by ONC. It includes the test kit used for ONC certification against the 170.315(g)(10) standardized API criterion, covering US Core, SMART authorization, and bulk data. Teams also use it outside certification to find conformance gaps in their FHIR servers.

Which accessibility standard should healthcare software meet?

WCAG 2.1 Level AA is the practical target. HHS's 2024 Section 504 rule adopted it as the technical standard for web content and mobile apps of HHS-funded recipients, and the Section 1557 rule requires covered entities to make ICT-based health programs accessible. Test with automated tools plus manual screen reader and keyboard testing.

How should we test HL7 interfaces?

Build a synthetic message library from each partner's specification, then add edge cases: malformed segments, escape sequences, repeating fields, Z-segments, out-of-order and duplicate messages, and corrected results. Automate these suites in CI, verify acknowledgment and retry behavior, and replay recorded synthetic traffic before every release.

Discuss your healthcare engineering project

Tell us about the system, the integrations it depends on, and the constraints you are working within. A senior engineer will review it and reply with questions, not a sales script.