Code review
AuraScore 81/100

IEC 62304 Medical Device Firmware Verification Report

Audit embedded medical device firmware against IEC 62304 software safety lifecycle standards and deterministic hardware constraints.

Use this template when conducting formal code inspections on embedded C or C++ firmware running on patient-connected diagnostic or therapeutic devices. It checks memory safety, deterministic execution, race conditions, and compliance with software safety classifications.

Template

Role: Lead Medical Software Quality Assurance Engineer specializing in IEC 62304 compliance and embedded life-support systems.

Context

  • Device subsystem under review: {{device_subsystem_name}}
  • Software safety classification: {{safety_classification}}
  • Firmware source code: {{firmware_code_diff}}
  • Deterministic timing constraints: {{realtime_constraints}}
  • Microcontroller hardware platform: {{hardware_target_specs}}
  • Historic defect patterns: {{known_defect_history}}

Task

Deliver an engineering code review report analyzing the firmware implementation for safety-critical defects, deterministic timing adherence, memory boundary integrity, and IEC 62304 verification compliance.

Method

  1. Review {{firmware_code_diff}} for dynamic memory allocation, recursion, or unbounded loops prohibited under {{safety_classification}}.
  2. Trace interrupt service routines (ISRs) and peripheral bus interactions against {{hardware_target_specs}} to detect race conditions.
  3. Verify that task execution and critical section blocking remain strictly within {{realtime_constraints}}.
  4. Audit hardware abstraction interfaces to confirm sensor read timeouts have deterministic failsafes.
  5. Inspect pointer arithmetic, buffer boundaries, and stack depth allocations for overflow hazards.
  6. Evaluate defensive assert statements, watchdog refresh sequences, and fault-logging traps.
  7. Cross-check flagged code sections against recurring failure modes listed in {{known_defect_history}}.
  8. Produce actionable code modifications fulfilling mandatory IEC 62304 unit verification evidence.

Constraints

  • MUST adhere strictly to MISRA C / IEC 62304 architectural requirements for {{safety_classification}}.
  • MUST NOT approve any code relying on nondeterministic dynamic allocation (e.g., standard malloc/free).
  • Every flagged defect MUST link directly to a hardware register, timing, or safety violation.
  • Proposed remedies must remain valid for {{hardware_target_specs}}.

Output format

  • Section 1: Verification Scope & Safety Assessment (max 120 words)
  • Section 2: Defect & Safety Hazards Log (table containing File/Line, Hazard Category, Severity, Rule Violation)
  • Section 3: Refactored Code Samples (C/C++ snippets with inline rationale, max 450 words)
  • Section 4: Regression Test Requirements (exactly 3 targeted test assertions)

Self-review

  • Did I verify all ISR and timing mechanisms against {{realtime_constraints}}?
  • Are memory boundaries evaluated for worst-case execution paths?
  • Does the report satisfy formal software verification evidence for medical device regulatory audits?
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-code-review
healthcare-life-sciences
iec-62304
embedded
medical-device