When Software Can Harm People

Most software bugs are annoying — a broken button, a slow page, a formatting error. But in some industries, software bugs can injure or kill people, cause financial fraud, or compromise national security.

In these regulated industries, governments and industry bodies mandate specific standards that software must comply with. Testing in these environments goes far beyond typical QA — it requires validation, formal documentation, audit trails, and regulatory approval before software can be used.

This lesson covers the major regulated industries, their standards, and what additional testing requirements they impose.

Healthcare and Medical Devices

Key Standards

StandardScopeIssuing Body
FDA 21 CFR Part 11Electronic records and signaturesUS FDA
IEC 62304Medical device software lifecycleInternational
ISO 14971Risk management for medical devicesInternational
HIPAAHealth data privacy and securityUS HHS
EU MDRMedical device regulationEuropean Union

Testing Requirements

Software Validation (FDA): The FDA requires that medical device software be “validated” — meaning there is documented evidence that the software consistently produces results meeting predetermined specifications.

Validation is not the same as testing. Validation includes:

  • Installation Qualification (IQ) — is the software installed correctly?
  • Operational Qualification (OQ) — does the software work as specified?
  • Performance Qualification (PQ) — does the software perform correctly in the real environment?

Risk-Based Testing (ISO 14971): Every function must be assessed for risk to patient safety. Higher-risk functions require more thorough testing.

graph TD A[Identify Hazard] --> B[Estimate Risk] B --> C{Acceptable?} C -->|No| D[Implement Risk Control] D --> E[Verify Control Effectiveness] E --> B C -->|Yes| F[Document Residual Risk]

Audit Trails: Every action in a medical system must be logged — who accessed patient data, when, and what changes were made. These logs must be tamper-evident and retained for the system’s lifecycle.

Traceability: Full traceability from requirements to design to test cases to test results to defects. This is not optional — auditors will verify it.

Finance

Key Standards

StandardScopeIssuing Body
PCI-DSSPayment card data securityPCI Security Council
SOX (Sarbanes-Oxley)Financial reporting integrityUS Congress
Basel III/IVBanking risk managementBasel Committee
GDPR/CCPAData privacy (affects financial data)EU/US States
MiFID IIFinancial markets regulationEuropean Union

Testing Requirements

PCI-DSS Compliance Testing: Any system that stores, processes, or transmits credit card data must comply with PCI-DSS. This requires:

  • Regular vulnerability scanning (quarterly, by an Approved Scanning Vendor)
  • Annual penetration testing
  • Secure code review
  • Network segmentation testing
  • Access control verification

SOX Testing: SOX requires that financial systems maintain data integrity. Testing must verify:

  • That financial calculations are accurate
  • That data cannot be altered without authorization and audit trail
  • That access controls prevent unauthorized modifications
  • That backup and recovery procedures work correctly

Fraud Detection Testing: Financial systems must be tested for:

  • Transaction monitoring accuracy
  • False positive/negative rates in fraud detection
  • System behavior under unusual patterns

Automotive

Key Standards

StandardScopeIssuing Body
ISO 26262Functional safety for road vehiclesISO
ASPICEAutomotive software process improvementVDA
MISRACoding standards for automotive softwareMISRA Consortium
SOTIF (ISO 21448)Safety of intended functionalityISO

Testing Requirements

ASIL Levels (ISO 26262): Automotive Safety Integrity Levels range from A (lowest risk) to D (highest risk). The ASIL level determines the rigor of testing required:

ASIL LevelExampleTesting Requirements
AInterior lighting controlBasic functional testing
BHeadlight systemsSystematic testing, requirements coverage
CCruise controlRequirements-based testing, fault injection
DBraking system, steeringExhaustive testing, formal methods, independent verification

Hardware-in-the-Loop (HIL) Testing: Automotive software is tested using simulated hardware environments before deploying to real vehicles. This allows testing of scenarios that would be dangerous in real conditions.

Model-Based Testing: Many automotive systems use model-based development (e.g., Simulink). Testing verifies both the model and the generated code.

Aviation

Key Standards

StandardScopeIssuing Body
DO-178CAirborne softwareRTCA/EUROCAE
DO-254Airborne electronic hardwareRTCA
ARP 4754ADevelopment of civil aircraftSAE

Testing Requirements

Design Assurance Levels (DO-178C): Similar to ASIL in automotive, aviation uses DAL levels A through E:

DALFailure ConditionExample
ACatastrophicFlight control software
BHazardousEngine monitoring
CMajorNavigation display
DMinorCabin entertainment
ENo effectMaintenance logging

Structural Coverage (DO-178C): DAL A software requires Modified Condition/Decision Coverage (MC/DC) — the most rigorous form of code coverage analysis. Every condition in every decision must be shown to independently affect the outcome.

Independence: For DAL A and B, the verification activities must be performed independently from the development activities. The person who wrote the code cannot be the person who tests it.

Pharmaceutical

Key Standards

StandardScopeIssuing Body
GAMP 5GxP computerized systemsISPE
21 CFR Part 11Electronic recordsUS FDA
EU Annex 11Computerized systemsEMA
CSV (Computer System Validation)Validation approachIndustry practice

GAMP 5 Software Categories

CategoryTypeValidation EffortExample
1InfrastructureMinimalOperating systems, databases
3Non-configured productsLowOff-the-shelf commercial software
4Configured productsMediumERP systems, LIMS
5Custom applicationsHighCustom-developed lab systems

Higher categories require more extensive validation, including documented evidence that the software performs its intended function correctly and consistently.

Common Requirements Across Regulated Industries

Despite different standards, regulated industries share common testing requirements:

1. Validation vs Verification

ConceptQuestion It AnswersExample
Verification“Did we build the product right?”Does the code match the specification?
Validation“Did we build the right product?”Does the product meet the user’s actual needs?

Both are required in regulated environments, and both must be documented.

2. Documentation Requirements

Regulated testing produces significantly more documentation than typical testing:

  • Validation Plan
  • Validation Protocol (test cases with expected results)
  • Validation Report (actual results, deviations, conclusions)
  • Traceability Matrix
  • Risk Assessment
  • Change Control Records

3. Change Control

Any change to validated software must go through a formal change control process:

  1. Change request documented
  2. Impact analysis performed (what tests need to be re-run?)
  3. Change approved by authorized personnel
  4. Change implemented and tested
  5. Regression testing performed
  6. Updated documentation reviewed and approved

4. Data Integrity (ALCOA+)

Regulated data must comply with ALCOA+ principles:

PrincipleMeaning
AttributableWho generated the data?
LegibleCan the data be read?
ContemporaneousWas it recorded when it happened?
OriginalIs it the original record?
AccurateIs it correct?
+CompleteIs all data included?
+ConsistentAre there contradictions?
+EnduringWill it be available throughout the retention period?
+AvailableCan it be accessed when needed?

Compliance Testing Basics

Compliance testing verifies that the software meets regulatory requirements. It includes:

  1. Regulatory requirement mapping — Map each regulatory requirement to specific test cases
  2. Evidence collection — Document all test results as evidence for auditors
  3. Gap analysis — Identify areas where the software does not yet meet requirements
  4. Remediation testing — Re-test after fixes to verify compliance
  5. Periodic re-validation — Regulations may require periodic re-validation (e.g., annually)

Exercise: Identify Compliance Requirements

Scenario: You are the QA Lead for a healthcare startup building a telemedicine app. The app allows patients to:

  • Video call with doctors
  • View and download medical records (lab results, prescriptions)
  • Pay for consultations via credit card
  • Receive medication reminders via push notification

The app will launch in the US market first, then expand to the EU.

Tasks:

  1. Which regulatory standards apply to this app? List all that apply and explain why.
  2. For each standard, identify the top 3 testing requirements it imposes.
  3. Create a compliance testing checklist (minimum 15 items) organized by regulation.
  4. What would be the consequences of non-compliance for each standard?
Hint

Think about what data the app handles:

  • Medical records → HIPAA, FDA (if classified as medical device)
  • Credit card data → PCI-DSS
  • EU expansion → GDPR
  • Medication reminders → Could be classified as a medical device by FDA

Also consider:

  • Video calls may store recordings → data retention requirements
  • The app stores PHI (Protected Health Information) → encryption requirements
  • EU launch requires GDPR compliance from day one
Solution

1. Applicable Regulatory Standards

StandardWhy It Applies
HIPAAApp handles Protected Health Information (medical records, prescriptions)
FDA 21 CFR Part 11Electronic medical records and e-prescriptions require compliant electronic signatures and records
FDA SaMD guidanceThe app may be classified as Software as a Medical Device if it aids clinical decisions
PCI-DSSApp processes credit card payments
GDPREU expansion means processing EU citizens’ personal and health data
CCPACalifornia users have specific data rights
ADA/Section 508Healthcare apps must be accessible

2. Top 3 Testing Requirements per Standard

HIPAA:

  1. Encryption testing — PHI must be encrypted at rest and in transit
  2. Access control testing — role-based access, minimum necessary standard
  3. Audit trail testing — all access to PHI must be logged

PCI-DSS:

  1. Penetration testing — annual testing of payment processing components
  2. Vulnerability scanning — quarterly scans by approved vendor
  3. Data storage testing — verify credit card numbers are not stored unencrypted

GDPR:

  1. Consent management testing — verify consent collection, withdrawal, and record-keeping
  2. Data subject rights testing — right to access, deletion, portability
  3. Data breach notification — verify breach detection and 72-hour notification capability

3. Compliance Testing Checklist

HIPAA Compliance:

  • PHI encrypted at rest (AES-256 or equivalent)
  • PHI encrypted in transit (TLS 1.2+)
  • Role-based access control enforced
  • Audit trail captures all PHI access (who, when, what)
  • Session timeout after inactivity
  • Business Associate Agreements in place for third-party services

PCI-DSS Compliance:

  • Credit card data never stored in plain text
  • Payment processing uses tokenization
  • Quarterly vulnerability scans pass
  • Annual penetration test completed
  • Network segmentation between payment and other systems

GDPR Compliance:

  • Explicit consent obtained before processing health data
  • Users can access all their personal data
  • Users can request data deletion
  • Data Processing Impact Assessment completed
  • Privacy policy clearly describes data processing

Accessibility:

  • WCAG 2.1 AA compliance verified
  • Screen reader compatibility tested

4. Consequences of Non-Compliance

StandardConsequence
HIPAAFines up to $1.5M per violation category per year, criminal penalties
PCI-DSSFines $5K-100K/month, loss of ability to process credit cards
GDPRFines up to 4% of annual global turnover or EUR 20M
FDAWarning letters, product recalls, injunctions, criminal prosecution

Key Takeaways

  • Regulated industries require testing that goes far beyond typical QA — including validation, formal documentation, and audit trails
  • Key regulated industries include healthcare (FDA/HIPAA), finance (PCI-DSS/SOX), automotive (ISO 26262), aviation (DO-178C), and pharma (GAMP 5)
  • All regulated industries share common requirements: traceability, change control, data integrity, and independent verification
  • Non-compliance can result in severe consequences including fines, recalls, and criminal prosecution
  • The level of testing rigor is proportional to the risk — higher risk to life or safety requires more thorough testing