Test Case Derivation Methodology
This document describes a systematic approach to deriving exhaustive test case specifications from requirements and architectural blueprints. Apply this workflow at the start of any implementation task to ensure all edge cases and qualifiers are covered before writing code.
1. Identify Testing Layers
Section titled “1. Identify Testing Layers”Analyze the architectural blueprint to identify the layers that require verification. In a standard Arda-style data authority module, these typically include:
- Business Logic (POJO): Internal invariants and property-level validations.
- Mutation Behaviors (Service Layer): Logic driven by operation qualifiers (e.g., STRICT, LAX, UPDATE).
- Cross-Entity Propagation: Side effects in linked services (e.g., role creation, record linking).
- Universal Constraints (Universe/Persistence): Multi-record constraints like uniqueness and bitemporal integrity.
- Transactional Integrity: Error handling and rollback behavior.
2. Deriving Test Cases (Exhaustive Criteria)
Section titled “2. Deriving Test Cases (Exhaustive Criteria)”Use the following criteria to determine which tests are needed.
A. Invariant Testing (Positive and Negative)
Section titled “A. Invariant Testing (Positive and Negative)”For every “Requirement” or “Invariant” in the domain model:
- Create a test that satisfies the condition (Positive).
- Create a test for every way the condition can be violated (Negative).
B. Matrix Selection (Combinatorial Mutations)
Section titled “B. Matrix Selection (Combinatorial Mutations)”If the requirements use a “Mutation Behavior” table (Input vs. State vs. Qualifier):
- Every cell in the table represents at least one test case.
- If a cell has nested conditions (e.g., “if found… otherwise…”), test both branches.
C. Side-Effect Verification
Section titled “C. Side-Effect Verification”Identify every “Propagation” outcome (e.g., “Create BusinessRole”, “Update Parent”) and create cases where:
- The side effect should happen and succeed.
- The side effect should happen but fails (verify atomicity and rollback).
- The side effect should not happen.
D. Universal and Persistence Constraints
Section titled “D. Universal and Persistence Constraints”- Test uniqueness constraints across multiple records.
- Test metadata validation (e.g., ensuring child records match parent EIds).
3. Determining “How Many Are Enough”
Section titled “3. Determining “How Many Are Enough””A test suite is considered sufficient when it satisfies the Complete Coverage Heuristic:
- All Logic Paths: Every
if/whenbranch in the Service Layer implementation corresponds to a test case. - All Error Types: Every
AppErrortype produced by the code (NotFound, ArgumentValidation, Duplicate) is triggered at least once. - Boundary Conditions: Null vs. Not-Null inputs are tested for every optional parameter.
- Bitemporal Logic: (If applicable) Both “Create” and “Update” are tested against the bitemporal coordinates (
asOftime).
4. Specification Format
Section titled “4. Specification Format”Organize test cases chronologically or by layer in a *-test-case-spec.md file using the following format:
- ID:
TC-[Layer]-[Sequence](e.g.,TC-IM-01for Item Mutation). - Name: Brief description of the scenario.
- Expectation: Clear statement of the expected outcome (e.g., “Expect: Success”, “Expect: Failure with AppError.NotFound”).
5. Implementation Strategy
Section titled “5. Implementation Strategy”- Draft the Spec: Write the test case list before writing the implementation code.
- Review Against Requirements: Check every line of the requirements document; if a line specifies a behavior, there must be a corresponding test ID.
- Execution: Implement tests alongside code. Use the spec as a checklist for the Final Build Verification.
Copyright: © Arda Systems 2025-2026, All rights reserved