Section 1: Test Plan Development and Acceptance Criteria
Creating the strategic blueprints for quality. Learn to define scope, write crystal-clear acceptance criteria, and build the foundational contract for system safety and reliability.
Test Plan Development and Acceptance Criteria
From a Pharmacist’s Gut Check to an Engineer’s Blueprint: Formalizing the Science of Verification.
10.1.1 The “Why”: Translating Verification into a Formal Strategy
In your entire professional life as a pharmacist, the concept of verification has been an ever-present, almost subconscious, part of your workflow. It is the silent pause you take before handing a medication to a patient, the rapid mental checklist you run when a new prescription appears on your screen, the “gut feeling” that something about a dose is not quite right. This constant, low-level hum of critical analysis is what makes you a safe and effective practitioner. It is a process honed over tens of thousands of repetitions, built on a deep foundation of clinical knowledge, pattern recognition, and a profound sense of responsibility.
The challenge and opportunity of pharmacy informatics is to take this deeply ingrained, almost intuitive, process and translate it into a formal, documented, and repeatable strategy. A Test Plan is the document that accomplishes this. It is the formal manifestation of a pharmacist’s skepticism. It is not merely a “to-do” list of tasks; it is a strategic document that outlines the entire philosophy, scope, and methodology for proving that a complex system is safe for patient care. It is your ultimate risk mitigation tool. While a pharmacist at the bench prevents errors one prescription at a time, a pharmacist authoring a test plan prevents entire classes of errors for thousands of patients simultaneously.
If a project’s implementation plan is its roadmap, the test plan is its comprehensive safety inspection protocol. It forces the entire project team—from developers and analysts to clinical end-users—to stop and ask the most critical questions before a single line of code is released into the wild:
- What, precisely, are we trying to achieve with this new technology?
- How will we objectively know if we have succeeded?
- What are all the ways this could fail, and how will we proactively try to make it fail in a controlled environment?
- Who is responsible for what, and what resources do we need to do this job properly?
- What are the absolute, non-negotiable conditions that must be met before we allow this system to touch a real patient?
Retail Pharmacist Analogy: Validating a New Compounding Protocol
Imagine your pharmacy is introducing a new, complex, and high-risk compound: a pediatric chemotherapy suspension. You would never simply accept a written recipe from a manufacturer and start making it for patients. Your professional duty compels you to perform a rigorous validation process, which is, in essence, a small-scale, high-stakes test plan.
First, you would define your scope and objectives. You’re not testing all compounding, just this specific formula. Your objective is to prove you can consistently create a product that is potent, stable, and free of contamination. Next, you would define your acceptance criteria. These are your non-negotiable definitions of success:
- The final concentration must be within ±5% of the target strength.
- The beyond-use date study must show the product maintains at least 90% potency for the assigned duration.
- Microbial testing on three separate validation batches must show no growth.
- The final product must be uniform in appearance with no visible clumps or separation.
Then, you would outline your approach. You’ll perform three full validation batches. You will document every step: the lot numbers of the raw ingredients (test items), the specific equipment used (environmental needs), and the exact technique performed by a trained technician (staffing/responsibilities). You would document all results—the potency assays, the stability data, the culture reports (test deliverables). You’d also consider your risks and contingencies: what if the bulk powder is on backorder? What if the stability testing fails at day 14?
Only after you have successfully executed this plan, met every single acceptance criterion, and have a binder full of documented, objective evidence would you sign off (approvals) and feel comfortable dispensing this compound. A test plan for a new EHR feature is exactly this process, just applied to software instead of a suspension. You are the pharmacist in charge of the digital clean room, and your job is to prove the final product is safe before it reaches the patient.
10.1.2 The Anatomy of a Master Test Plan: Your Strategic Blueprint
A formal test plan is not an informal memo; it is a structured, comprehensive document that follows a standardized format, often based on industry standards like IEEE 829. While the exact template may vary between organizations, the core components are universal. As a pharmacy informatics analyst, you will be responsible for authoring, reviewing, and contributing to these documents. Understanding each section is essential to ensuring a thorough and defensible validation strategy. Let’s dissect a master test plan, section by section, from a pharmacist’s perspective.
Masterclass Table: Deconstructing the Test Plan
| Test Plan Section | Purpose & Description | Pharmacist’s Clinical Application & Key Questions |
|---|---|---|
| 1.0 Test Plan Identifier | A unique name or number for the document (e.g., “ADC_Firmware_Upgrade_v2.5_TestPlan_2025-10-18”). This is for version control and traceability. | Is this linked to a specific project or change request number? If I need to find this document in five years during an audit, can I? |
| 2.0 Introduction & Scope | A high-level overview of the project and its goals. Crucially, it defines the boundaries of the testing effort. It explicitly states what is IN SCOPE (will be tested) and what is OUT OF SCOPE (will not be tested). | This is the most important political and safety section.
|
| 3.0 Test Items | A list of the specific software, hardware, and documents that are the subject of the test. This includes version numbers, build numbers, and hardware models. |
|
| 4.0 Features to Be Tested | A detailed, granular list of the new features or functionalities that will be validated. This is a breakdown of the “In Scope” items. | Think like a clinician using the system.
|
| 5.0 Features Not to Be Tested | An explicit list of functionalities that will be intentionally excluded from this testing cycle, along with the rationale. This is a breakdown of the “Out of Scope” items. | This protects you and the team.
|
| 6.0 Approach / Strategy | The core methodology of the test. It describes the types of testing to be performed (e.g., Unit, Integration, Regression, User Acceptance Testing) and the overall flow. It mentions who will be testing and at a high level, how they will be testing. | This is your battle plan.
|
| 7.0 Item Pass/Fail Criteria | The high-level definition of success for the entire testing effort. It defines when a specific test case passes or fails, and when the overall project is considered ready for go-live. | This is the “go/no-go” decision point.
|
| 8.0 Suspension & Resumption Criteria | Defines the conditions under which testing will be halted entirely (e.g., discovery of a critical “showstopper” bug that prevents further testing) and the criteria for restarting once the issue is fixed. | This is your emergency stop button.
|
| 9.0 Test Deliverables | A list of all the documents and artifacts that will be created as part of the testing process. | This is your evidence locker for audits.
|
| 10.0 Environmental Needs | A detailed specification of the necessary hardware, software, data, interfaces, and security access needed to perform the testing. | This is your setup for success.
|
| 11.0 Staffing & Training Needs | Identifies the key personnel needed for testing and any specific training they might require before the testing cycle begins. | You can’t test what you don’t understand.
|
| 12.0 Responsibilities | Clearly defines who is responsible for what. Often uses a RACI (Responsible, Accountable, Consulted, Informed) chart to assign roles for every major task in the testing process. | This prevents finger-pointing later.
|
| 13.0 Schedule | A detailed timeline of all testing activities, including deadlines for test case writing, environment setup, execution cycles, and defect resolution. | This is your project timeline. It should include buffer time. A 2-week testing cycle might have 3-4 days dedicated to re-testing fixed bugs and regression testing. |
| 14.0 Risks & Contingencies | Identifies potential problems that could derail the testing effort and outlines a proactive plan to mitigate them. | Thinking ahead about what could go wrong.
|
| 15.0 Approvals | Specifies who must review and sign the test plan before testing can begin. This signifies that key stakeholders agree with the strategy and scope. | This is the formal sign-off. Signatories often include the Project Manager, the Director of Pharmacy, a key Physician champion, and the lead IT Quality Assurance manager. |
10.1.3 Masterclass on Writing Acceptance Criteria (AC)
If the test plan is the strategic blueprint, then the Acceptance Criteria (AC) are the detailed, legally-binding construction specifications. They are short, clear, testable statements that describe the required behavior of a feature from an end-user’s perspective. They are the ultimate definition of “done.” An AC is a contract: if the system meets all of its acceptance criteria, the feature is considered complete and correct. If it fails even one, it has a defect. Your ability as a pharmacist to write clear, comprehensive, and unambiguous AC is perhaps the single most important skill in clinical system validation.
Poorly written AC are the leading cause of failed projects, software that doesn’t meet clinical needs, and patient safety risks. Vague statements like “The system should be easy to use” or “The order should process quickly” are useless because they are not testable. How do you measure “easy”? How do you define “quickly”? Writing effective AC removes all ambiguity and subjectivity, replacing it with a clear, binary (pass/fail) condition.
The Gherkin Framework: A Universal Language for Behavior
One of the most effective and widely adopted formats for writing AC is the Gherkin syntax, often used in Behavior-Driven Development (BDD). It provides a simple, structured “Given-When-Then” framework that anyone—from a developer to a clinician—can understand. It tells a story about how a user interacts with the system.
Deconstructing the Gherkin Format
Think of Gherkin as a structured way to describe a cause-and-effect scenario. Every AC should be written in this format to ensure clarity and testability.
-
GIVEN – This sets the stage. It describes the preconditions and the state of the system before the user does anything. What context must be true for the test to begin?
-
WHEN – This is the specific action or event that the user performs. It should be a single, clear action.
-
THEN – This is the expected outcome. It describes the change in the system’s state and the observable result of the user’s action. This is where you define what “correct” looks like.
-
AND – This can be used to add additional conditions to any of the Given, When, or Then statements to avoid making them too long or complex.
From Weak to World-Class: Transforming Acceptance Criteria
Let’s see this in action. We will take common pharmacy scenarios and transform vague, untestable requirements into strong, Gherkin-formatted acceptance criteria. This transformation is your core function as a clinical quality gatekeeper.
| Scenario | Weak / Vague Requirement | Strong / Testable Acceptance Criteria |
|---|---|---|
| Ordering a Renally Dosed Drug | “The system should warn me about kidney function.” |
|
| Barcode Medication Administration (BCMA) | “Scanning the wrong drug should cause an error.” |
|
| Automated Dispensing Cabinet (ADC) Stocking | “The ADC needs to be refilled correctly.” |
|
| IV Workflow Management System | “The system should take a picture of the ingredients.” |
|
The Danger of “And”: Keep Your Scenarios Atomic
While the Gherkin syntax allows for the use of “And” to chain conditions, a common pitfall is to create monolithic acceptance criteria that try to test too many things at once. Each AC should, whenever possible, test a single, discrete behavior.
Weak Example (tries to do too much):
Given a patient has a penicillin allergy And a CrCl of 20 mL/min, When a doctor orders piperacillin-tazobactam, Then the system should fire an allergy alert And a renal dosing alert.
Why it’s weak: What if the allergy alert fires but the renal alert doesn’t? Does the test case pass or fail? It’s ambiguous. This should be broken into two separate, atomic ACs:
Strong Example (two separate ACs):
AC #1: Given a patient has a penicillin allergy, When a doctor orders piperacillin-tazobactam, Then the system fires an allergy alert.
AC #2: Given a patient has a CrCl of 20 mL/min, When a doctor orders piperacillin-tazobactam, Then the system fires a renal dosing alert.
This approach ensures that each test case has a single, clear reason to fail, which makes bug tracking and resolution infinitely simpler.
10.1.4 Integrating Risk Analysis into Test Planning
You cannot test everything. In a complex health IT system, the number of possible user pathways and data combinations is virtually infinite. A brute-force approach to testing is inefficient and often ineffective. The key to a successful testing strategy is to be intelligent and risk-based. As a pharmacist, you are already an expert at risk stratification. You instinctively pay more attention to a new warfarin prescription than a refill for ibuprofen. Your test plan must reflect this same clinical pragmatism. You must focus your limited time and resources on the areas of the system that pose the greatest risk to patient safety.
A powerful, proactive tool for achieving this is the Failure Mode and Effects Analysis (FMEA). FMEA is a systematic, team-based activity that involves brainstorming all the potential ways a process or system could fail (Failure Modes), understanding the consequences of those failures (Effects), and identifying their potential causes. Crucially, it involves a scoring system to prioritize which risks are the most severe, allowing you to tailor your testing strategy to be tougher on the high-risk areas.
The FMEA Scoring System: Calculating the Risk Priority Number (RPN)
The core of the FMEA is calculating a Risk Priority Number (RPN) for each potential failure mode. This number helps to objectively rank the risks. The formula is:
$$ \text{RPN} = \text{Severity (S)} \times \text{Occurrence (O)} \times \text{Detection (D)} $$
Each factor is typically scored on a scale of 1 to 10. The higher the RPN, the higher the risk, and the more intense your testing for that scenario should be.
| Factor | Description | Example Scoring (1 = Low, 10 = High) |
|---|---|---|
| Severity (S) | How catastrophic would the consequences be if this failure occurred? |
|
| Occurrence (O) | How likely is this failure to happen? |
|
| Detection (D) | How likely are we to detect the failure *before* it reaches the patient? |
|
Masterclass Example: Applying FMEA to a New CPOE Feature
Let’s apply this to a real-world scenario: implementing a new order set for Patient-Controlled Analgesia (PCA) pumps.
| Failure Mode (What could go wrong?) |
Potential Effect (What is the consequence?) |
Severity (S) |
Occurrence (O) |
Detection (D) |
RPN (S x O x D) |
Resulting Test Strategy |
|---|---|---|---|---|---|---|
| The order set defaults to mcg instead of mg for morphine concentration. | Patient receives a 1000-fold overdose, leading to respiratory arrest and death. | 10 | 3 | 6 | 180 | Maximum Intensity: Multiple, scripted test cases using different users and patient types. Negative testing to ensure the unit cannot be changed. Independent double-check of all build configurations. |
| The order does not correctly transmit the “4-hour limit” to the pharmacy system. | The pharmacy might prepare the bag without the clinical context, but the pump itself has a hard limit, preventing overdose. Risk of confusion. | 5 | 5 | 4 | 100 | High Intensity: Dedicated integration test cases to verify data flow between CPOE and pharmacy system. Test across multiple orders to confirm consistency. |
| The printed MAR from the order set is poorly formatted and hard to read. | Nurse frustration. Potential for misinterpretation, but likely to be caught during standard verification. Low risk of direct harm. | 3 | 7 | 3 | 63 | Medium Intensity: A single test case to verify MAR appearance. Solicit feedback from nurse testers. Considered a “usability” bug, not a safety-critical one. |
By performing this FMEA *before* you even start writing test cases, you have already identified your highest-risk areas. The PCA concentration error (RPN=180) demands far more rigorous testing than the MAR formatting issue (RPN=63). Your test plan should explicitly state that the intensity of testing will be proportional to the RPN scores identified in the project’s risk analysis. This is how you build a defensible, efficient, and patient-safe validation strategy.