Healthcare software testing checks that clinical and patient-facing systems handle health data correctly, keep it private and stay usable when people depend on them. The stakes are different from most software. A wrong value in a patient record can look perfectly normal on screen, and a privacy failure can become a reportable incident.
This guide covers what to test and how, built around a test run we did on 29 October 2026. We sent synthetic patient records to a public HL7 FHIR test server and recorded what was accepted, what was rejected and what slipped through. One result sets the tone for everything below: a heart rate of 720 beats a minute passed every automated check we ran.
What makes healthcare software testing different
Most of the techniques are familiar: functional, integration, performance, security and accessibility testing. What changes is the cost of each failure and the rules around the data.
- The data is regulated. In the United States, the HIPAA Security Rule sets technical safeguards for electronic protected health information (ePHI). Other countries have their own rules, and you need to test against the ones that apply to you.
- Systems must exchange data. Records move between electronic health records (EHRs), labs, pharmacies, billing and devices, often through HL7 v2 messages or the FHIR API standard.
- Wrong is worse than broken. A crash is obvious. A record that saves successfully with the wrong unit, the wrong patient or an impossible value is not, and clinicians may act on it.
- People use it under pressure. Clinical staff work during shift changes and emergencies, so performance and usability defects have real consequences.
Also read: QA in DevOps for Healthcare Apps: The Advantages
Test the data exchange: what our FHIR run showed
FHIR, Fast Healthcare Interoperability Resources, is the HL7 standard most modern healthcare APIs use. A heart-rate reading, for example, is an Observation resource with a status, a code, a patient and a value with units.
We tested against the public HAPI FHIR test server, which runs HAPI FHIR 8.13.10 on FHIR R4 (4.0.1). The server warns that it is "not a production server" and asks users not to store personal health information, so we used only synthetic records. Most checks used the $validate operation, which tests a record without storing it.
Structure errors are caught early
Three records broke the basic rules: a patient whose gender was sent as "M", a birth date of 2026-02-30 and an observation with the status "done". FHIR allows only male, female, other and unknown for gender, and "done" is not an observation status. The server rejected all three with HTTP 400 before validation even started, because it could not parse them.
That is the easy layer. Your interface tests should still include these cases, because not every system in the chain is as strict as this server.
Some errors arrive with a success code
An observation with no status at all is valid JSON, so the server could read it. Validation then reported one error: "Observation.status: minimum required = 1, but only found 0". But the HTTP response code was 200.
A test that checks only the status code would call this a pass. Read the OperationOutcome in the response body, and fail the test when it contains an error.
Accepted is not the same as valid
We then sent the same record without a status to the server as a normal create request. It returned 201 Created and stored it. Reading it back returned the record, still without a status. We deleted it straight away and confirmed it was gone.
This is how this public test server is configured, and production servers can be set up to validate every request. The lesson still holds: never assume a server checked what it accepted. If your system receives data from partners, test what happens when they send a record your own validator would reject.
Profiles add the rules that matter
The base FHIR rules are loose. A heart rate sent with the unit "bpm" and no unit system passed with 0 errors. Checked against the FHIR heart-rate profile, the same record failed with 2 errors: the profile requires both a unit system and a unit code, and the record had neither.
In practice, most healthcare systems work to a profile: a national one, a vendor one or your own. Validate against the profile you actually promise to support, not just the base standard.
The same response held a quieter warning: "CodeSystem is unknown and can't be validated: http://loinc.org". This server had no copy of LOINC, the code system for lab and clinical observations, so it never checked whether our heart-rate code was real. A validator is only as good as the terminology loaded into it. Confirm that yours can resolve the code systems you use, or a made-up code will pass.
Times without a time zone are rejected
Healthcare records are full of timestamps: when a sample was taken, a dose given, a patient admitted. We validated the same heart-rate reading with four versions of its time. A time with an offset, such as +05:30, and a UTC time ending in Z both passed. A date on its own passed. A time with no time zone failed with one error: "If a date has a time, it must have a timezone".
This matters as soon as data crosses a boundary between systems, sites or countries. A local time with no offset means something different to every system that reads it. Test that your system sends offsets, stores them and displays times in the zone the user expects, especially around daylight saving changes.
Clinical sense is your job
Finally, we sent a heart rate of 720 beats a minute, a value no patient could have. It passed with 0 errors, even against the heart-rate profile. FHIR checks that a value is well formed, not that it is plausible.
This is the gap that matters most. Agree plausibility rules with your clinical team, for vital signs, lab values, doses and dates, and turn each one into a test. The values should come from clinicians, not from testers guessing.
Decide which warnings matter
Validation responses grade each issue as an error, a warning or information. Our valid heart-rate reading passed with 0 errors but still came back with warnings. One said "A resource should have narrative for robust management". Another said "In general, all observations should have a performer", meaning the person or device that took the reading. A third was the LOINC warning above.
Warnings do not fail validation, so most test suites ignore them. That is a choice you should make on purpose, one warning at a time. A missing performer may be harmless in a home monitoring app and a real gap in a hospital, where someone may need to know who recorded a value. The unknown code system warning, as we saw, means a whole class of errors cannot be detected at all.
Keep a short list of the warnings your team has agreed to treat as failures, and assert on them in your tests alongside the errors. Review the list when your profile or your server changes.
The tests we ran
These are the contract tests we ran with pytest 9.2.0. All five passed in 4.97 s. They check the response body, not just the status code, and they record what validation does not catch.
"""Contract checks for FHIR R4 Observations, run against the public HAPI test server with synthetic data.
$validate only: nothing is stored."""
import json
import pytest
import requests
BASE = "https://hapi.fhir.org/baseR4"
HEADERS = {"Content-Type": "application/fhir+json", "Accept": "application/fhir+json"}
HEART_RATE_PROFILE = "http://hl7.org/fhir/StructureDefinition/heartrate"
def heart_rate(value=72, status="final", quantity=None):
obs = {
"resourceType": "Observation",
"status": status,
"category": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs"}]}],
"code": {"coding": [{"system": "http://loinc.org", "code": "8867-4", "display": "Heart rate"}]},
"subject": {"display": "Synthetic test patient (not a real person)"},
"effectiveDateTime": "2026-10-29T10:00:00+05:30",
"valueQuantity": quantity or {"value": value, "unit": "beats/minute",
"system": "http://unitsofmeasure.org", "code": "/min"},
}
return {k: v for k, v in obs.items() if v is not None}
def validate(resource, profile=None):
url = f"{BASE}/Observation/$validate" + (f"?profile={profile}" if profile else "")
response = requests.post(url, headers=HEADERS, data=json.dumps(resource), timeout=90)
outcome = response.json()
errors = [i for i in outcome.get("issue", []) if i.get("severity") in ("error", "fatal")]
return response.status_code, errors
def test_valid_heart_rate_meets_the_vital_signs_profile():
status, errors = validate(heart_rate(), HEART_RATE_PROFILE)
assert status == 200 and errors == []
def test_missing_status_is_reported_in_the_body_not_the_status_code():
status, errors = validate(heart_rate(status=None))
assert status == 200 # the HTTP call succeeded...
assert len(errors) == 1 # ...but the resource is invalid
assert "Observation.status" in errors[0]["diagnostics"]
def test_unit_without_ucum_system_fails_only_with_the_profile():
text_only = heart_rate(quantity={"value": 72, "unit": "bpm"})
assert validate(text_only)[1] == []
assert len(validate(text_only, HEART_RATE_PROFILE)[1]) == 2
@pytest.mark.parametrize("value", [72, 720])
def test_validation_does_not_judge_clinical_plausibility(value):
status, errors = validate(heart_rate(value), HEART_RATE_PROFILE)
assert errors == [] # 720 beats a minute passes: plausibility needs its own ruleUse a test server like this for learning and early checks only. For your own system, point the same tests at your FHIR endpoint and the profiles you support.
Test privacy and security against the HIPAA Security Rule
The HIPAA Security Rule lists five technical safeguards in 45 CFR 164.312. They are written as obligations, but each one turns into something you can test.
Two of these deserve extra effort because they fail quietly. Audit logging works until someone checks it after an incident, so test that each sensitive action appears in the log with the user, the time and the record. Access control fails at the edges, so test direct object references: change the record ID in a request and confirm the system refuses.
Also read: Quality Testing: The Secret Sauce to Ensure HIPAA-Compliance
Use test data that belongs to nobody
Real patient data does not belong in test environments. Copying production data into a test system multiplies the places it can leak, and test systems usually have weaker controls.
Synthetic data is the safer default. Synthea, an open-source patient population simulator, generates realistic synthetic records in FHIR and other formats. For specific defects, write records by hand, as we did: invalid codes, missing fields, impossible values and duplicate patients.
Design test data for the risks, not just the happy path. For a patient record screen, that means records with long names, missing optional fields, merged duplicates, minors and patients with restricted records. Our knowledge hub has 28 EHR patient record test cases you can use as a starting point.
Common healthcare data defects to test for
Most of the defects that worry healthcare teams are data defects. They pass functional tests because the screen saves and the API returns success. Build test cases for each of these:
- Wrong patient. Two patients with the same name and date of birth, a merged duplicate record, or a result matched on the wrong identifier.
- Units. A value stored in one unit and displayed in another, or a unit dropped somewhere in an interface, like the "bpm" with no unit system in our run.
- Times. Missing time zones, as above, and events recorded out of order when system clocks disagree.
- Truncation. Long names, addresses or clinical notes cut short by a field limit in one system but not another.
- Silent acceptance. An interface that stores a record its own rules say is invalid, as our test server did.
- Retries. A message sent twice after a timeout, creating a duplicate order or result.
For each defect, write one test that sends the bad case through the real interface and checks what was stored, not only what was returned.
Test clinical workflows end to end
Most healthcare defects that reach users live between screens, not on them. Test complete journeys the way staff work:
- Order to result. A clinician places a lab order, the lab receives it, the result comes back and lands on the right patient with the right units.
- Medication. A prescription is written, checked for allergies and interactions, dispensed and recorded as given.
- Admission to discharge. A patient is admitted, moved between wards and discharged, with the record following them.
- Patient access. A patient books, checks in online, reads results and messages their care team.
For each journey, test the interruptions as well as the happy path: a message that fails and must be retried, a session that times out halfway, two staff members editing the same record. Retries deserve care in particular. A retried message that creates a second order is a patient safety issue, not a cosmetic one.
Test performance and accessibility for real conditions
Healthcare systems have predictable peaks: morning clinics, shift handovers and seasonal surges. Load tests should copy those patterns, such as many staff logging in within a few minutes, rather than a smooth average.
Accessibility matters more here than almost anywhere. Patients may be older, unwell or using assistive technology, and staff may be working fast on small screens. Test patient-facing screens against WCAG 2.2 level AA: keyboard access, screen reader labels, colour contrast and text that still works when enlarged. Also try the patient portal on an older phone over a slow mobile connection, because some patients will only ever reach it that way.
Automate the repeatable checks
Healthcare releases carry a lot of repeated checking: interface contracts, role permissions, audit entries and regression on core journeys. These are good candidates for automation, because they are precise and must run on every release.
- Contract tests for every FHIR or HL7 interface, like the ones above, run on every build.
- Permission matrices that log in as each role and check every sensitive endpoint.
- Audit assertions that perform an action and then query the audit log for it.
- Regression suites for order, medication and discharge journeys.
Keep people on what automation cannot judge: whether a screen makes sense to a nurse at the end of a shift, and whether a value looks clinically right. Our run is a reminder of the limit. Every automated check accepted the impossible heart rate.
Also read: Digital Assurance & Quality Testing for Digital Transformation
A risk-based test plan for a healthcare release
You will rarely have time to test everything equally. Rank each area by the harm a defect could cause, then spend effort in that order.
Agree the ranking with clinical and privacy owners, not just the delivery team. They know which failures would reach a patient.
Build the plan around patient risk
Start with the data flows that carry patient information, the journeys clinicians depend on and the rules you must meet. Validate interface data in layers, read response bodies rather than status codes, write plausibility rules with your clinical team and keep real patient data out of test systems.
If you need a team to plan or run this work, QAble provides healthcare software testing services for EHR, integration and patient-facing systems, delivered by our software testing service in India.