Software Testing Theory and Functional Testing Methodologies
Theoretical Foundations of Program Testing: Goodenough and Gerhart's Theory
The formal theory of program testing proposed by John B. Goodenough and Susan L. Gerhart in their seminal 1975 IEEE Transactions on Software Engineering (TSE) paper establishes:
A fundamental conceptual framework for software testing.
A rigorous taxonomy identifying categories and sources of program errors.
A mathematical structure governing reliable test data selection.
Core principles of the Goodenough-Gerhart framework:
In order to discover test data that reliably exposes program faults, a tester must systematically:
Identify every condition relevant to the correct operation of the target program.
Select test data configured to exercise all possible combinations of these identified conditions.
Core terminology and definitions:
Test Data: Actual concrete values selected from a program's input domain that collectively satisfy an established selection criterion.
Test Predicate: A formal description of conditions and combinations of conditions relevant to the correct operation of the program.
Test predicates define what aspects of a program must be tested.
Test data serve as the operational mechanism causing those aspects to be tested.
Test predicates constitute the primary motivating force driving test data selection.
Components of test predicates originate first and foremost from the program specification; as implementation details and design structures are examined, additional internal conditions and predicates are integrated.
Fundamental mathematical formulation of program execution:
Let denote a program.
Let denote the complete input domain for program .
Let denote an individual input element such that .
Let denote a test set such that .
The execution of program on input element produces an output denoted as .

Reliability, Validity, and Completeness in Test Selection
Predicate definitions for program acceptability and test success:
Acceptability Predicate (): A predicate defined over the input domain that evaluates to true if and only if the execution outcome constitutes an acceptable, correct result for the given input :
Successful Test Set (): For a test set , is successful if and only if every test case produces an acceptable outcome:
Ideal Test Set: A test set constitutes an ideal test if the acceptability of all elements in guarantees the acceptability of all elements across the entire domain :
An ideal test operates as an exhaustive surrogate: testing the sample set is sufficient to definitively conclude the correctness of the program over the entire domain .
Selection criteria attributes:
Selection Criterion (): A formal collection of predicates and properties utilized to select a specific test data subset from the input domain .
Reliable Criterion: A selection criterion is reliable if and only if all test sets selected using predicates in produce consistent results—that is, either every test set selected by is successful, or no test set selected by is successful:
Reliability measures consistency of error detection.
Valid Criterion: A selection criterion is valid if and only if whenever the program is incorrect (contains at least one fault for some ), the criterion is capable of selecting a test set that is not successful:
Validity guarantees that the criterion will not conceal existing defects.
Fundamental Theorem of Goodenough and Gerhart:
If a test selection criterion is both reliable and valid, then any test set selected using criterion constitutes an ideal test.
Practical limitation: In practical software engineering, finding a criterion that is provably reliable and valid is extremely difficult, if not mathematically impossible for arbitrary programs.
Minimal conditions required for criterion reliability:
For a test selection criterion to achieve reliability, it must satisfy four minimal structural and behavioral conditions:
Every individual branching condition in the program graph must be represented by an equivalent condition in .
Every potential termination condition within the program (such as an arithmetic overflow, underflow, or boundary break) must be represented by a condition in .
Every condition relevant to the correct operation of the program that is implied by the specification and by structural knowledge of the program must be explicitly represented as a condition in .
All test predicates included in must be mutually independent.
Theoretical and practical barriers to achieving valid and reliable criteria:
Program faults are not known a priori; therefore, proving both the reliability and validity of an arbitrary criterion before testing is impossible without selecting the entire input domain .
Debugging disrupts criterion properties: as discovered faults are removed (or new defects are introduced during repair), neither the reliability nor the validity of criterion is necessarily preserved.
Triviality under correctness: If a program is entirely correct and fault-free, any selected test set will succeed, making every selection criterion trivially reliable and valid.
Latent defect barrier: If program is incorrect, there is no generic method to know whether a criterion is ideal without already knowing the specific errors embedded in .
Definition of Test Completeness:
Let be the input domain of program .
Let denote a set of selection predicates such that for any input and predicate , evaluates to true if satisfies .
A test set is defined as complete with respect to criterion , denoted , if and only if every predicate in is satisfied by at least one test case in , and every test case in satisfies at least one predicate in :
While formalizes the thoroughness of a test set against a criterion, the formal relationship between test thoroughness and an ideal test must be established constructively through iterative refinement.
Program Fault Classification and Incremental Testing Process
Error classification taxonomy under Goodenough's theory:
Logic Faults: Flaws within the program's algorithmic and syntactic formulation, independent of physical computing resources. Subdivided into:
Requirements faults: Misunderstandings, ambiguities, or omissions originating in system requirements.
Design faults: Flaws introduced when translating specifications into functional software architectures and modules.
Construction faults: Coding, implementation, typographic, or semantic errors introduced at the source level.
Performance Faults: Failures where the program fails to satisfy operational constraints, such as execution speed, throughput, response latency, or memory consumption limits.
Classification by underlying mechanical source of faults:
Missing control-flow paths: The failure to implement necessary structural branches, such as omitting a guard condition against division by zero.
Inappropriate path selection: Implementing incorrect boolean logic in conditional statements, such as using
if (A & B) then ... else ...when the logic strictly requiresif (A) then ... else ....Inappropriate or missing actions: Executing the incorrect computational statement or omitting an indispensable state change, such as failing to initialize a variable prior to its accumulation.
Incremental refinement process toward ideal testing:
Let denote the exhaustive set of all faults present in program , which would be fully exposed by an ideal test set .
Step 1: The software tester defines an initial predicate set and constructs a test set such that holds. Executing exposes an initial subset of faults .
Step 2: The tester incrementally defines a broader, more rigorous set of predicates such that , and designs an expanded test suite such that and holds. Executing exposes a larger fault set such that .
Inductive Step: The tester continues this incremental expansion to identify predicate set and corresponding test suite satisfying , exposing fault set , such that progressively converges toward and approximates the ideal test set .
Software Reliability Growth and Failure Intensity Reduction Models
Mathematical modeling of reliability growth during execution and defect elimination:
Let denote the current failure intensity (failures per unit time).
Let denote the initial failure intensity at the start of system execution.
Let denote the average total number of failures experienced at a given point in execution time.
Let denote the total number of failures that would be observed over infinite execution time.
Primary failure intensity reduction models:
Basic Execution Time Model:
Models failure intensity as a linear decreasing function of the cumulative number of failures experienced ().
Failure intensity drops directly toward zero as cumulative failures approach the finite maximum :
Logarithmic Poisson Execution Time Model:
Models failure intensity as an exponential decay relative to cumulative failures experienced.
Accounts for the practical reality that initial faults contribute more substantially to failure intensity, whereas later faults have lower operational impact and are progressively harder to locate.
Failure intensity decreases rapidly initially and levels off asymptotically, avoiding the assumption of a finite total defect ceiling .

Gourlay's Mathematical Theory of Testing Systems
Core assumptions and foundational entities:
Program specifications () are assumed to be correct and serve as the absolute, sole arbiter of software correctness.
A program is defined to be correct if and only if it satisfies its corresponding specification .
Gourlay's theory formalizes the mathematical relationships among three distinct fundamental sets of entities:
The set of all Specifications (, with specific specification ).
The set of all Programs (, with specific program ).
The set of all Tests (, with specific test ).
Predicate extensions in Gourlay's model:
Extended acceptability predicate : Evaluates to true if and only if the execution of program on test is judged acceptable and successful with respect to specification .
Program correctness predicate : Program is correct with respect to specification if and only if evaluates to true for every test in the test domain :
Formal architecture of testing systems:
A testing system is formally defined as a 5-tuple:
Where for every , , and , the condition holds that .
Structural derived testing systems:
Set Construction Testing System:
Given a base testing system , a derived system is defined where is the set of all subsets (power set) of ().
The composite predicate holds if and only if every individual trial is acceptable:
Models exhaustive trial suites: test success requires universal success across all components; the failure of a single test run invalidates the entire test suite.
Choice Construction Testing System:
Given a base system , a derived system is defined where .
The choice predicate holds if and only if at least one test case is acceptable:
Models alternative testing pathways: represents scenarios where an engineer has multiple distinct but theoretically equivalent methods to verify an operation, where any single successful path confirms the condition.
Formalization of test methods:
A test method is a mapping function that consumes a program and a specification to generate a concrete test set:
Classification of test methods by primary dependency:
Program-Dependent Methods (): Structural or white-box testing; test selection depends strictly on program code, control-flow paths, and implementation logic.
Specification-Dependent Methods (): Functional or black-box testing; test selection depends strictly on requirements, interfaces, and functional specs, completely independent of source code.
Expectation-Dependent Methods (): Acceptance testing; test selection depends on customer expectations, operational environments, and external perspectives denoted by .
Power and Comparison of Testing Methods
Mathematical formulation of investigative power:
Let and be two distinct testing methods.
Let and denote the sets of program faults discoverable by methods and , respectively.
Method is defined to be at least as good as (possesses investigative power greater than or equal to) method if and only if whenever method discovers a fault, method is guaranteed to discover that fault:
Comparative classification of investigative power:
Case 1: Direct Inclusion of Test Sets ()
If method generates a test set that contains all test cases generated by method (), then method subsumes method .
Method is structurally guaranteed to be at least as good as method ().

Case 2: Overlapping Test Sets ()
In scenarios where and overlap but does not completely contain , direct structural subsumption cannot be claimed.
To determine relative power, program is executed against both suites to yield empirical fault sets and .
Method is judged to be at least as good as method if and only if .

Principles of Functional and Black-Box Testing
Mathematical view of software components:
Any program is modeled mathematically as a function mapping inputs to outputs:
Program inputs form the function's Domain.
Program outputs form the function's Range.
The core objective of functional testing is to leverage knowledge of the program's functional mapping to identify optimal, representative test cases without inspecting internal code structures.
While functional testing historically focuses on the input domain, high-reliability engineering requires supplementing input domain analysis with test cases derived from the output range.
Boundary Value Analysis (BVA)
Underlying rationale and operational principles:
Boundary Value Analysis centers test selection directly on the extreme edges and boundaries of the input space.
Empirical justification: Programming errors cluster with high density near extreme boundaries of input variables due to faulty inequalities, off-by-one loops, indexing errors, and unhandled boundary conditions.
Candidates: Programs written in weakly typed languages benefit significantly from BVA because the execution environment lacks type-enforced boundary checks.
Geometric representation of the input space:
For a function accepting two variables bounded by and , the inequalities define a bounded two-dimensional rectangular input region.
For input variables bounded by equivalent inequalities, the valid input space forms an -dimensional hyper-rectangle.

Five-value selection strategy per input variable:
Minimum boundary value ():
Value just above the minimum ():
Nominal mid-range value ():
Value just below the maximum ():
Maximum boundary value ():
The Single Fault Assumption:
Foundational heuristic: Operational software failures rarely result from the simultaneous occurrence of two or more independent faults.
Operational implementation: Hold all input variables except one at their nominal values, and allow the remaining single variable to assume its five boundary values.
Test suite cardinality: For an arbitrary function with input variables, standard BVA generates exactly test cases.
Geometric distribution for two variables (, test cases):

Concrete BVA application: The Triangle Problem
Function taking three side inputs where each side is bounded within .
Nominal value for each dimension: .
Variable parameter values: , , , , .
Suite size: unique test points (expanding to 15 cases when evaluating full single-variable sweeps across each dimension):
Case # | Side | Side | Side | Expected Output |
|---|---|---|---|---|
1 | 100 | 100 | 1 | Isosceles |
2 | 100 | 100 | 2 | Isosceles |
3 | 100 | 100 | 100 | Equilateral |
4 | 100 | 100 | 199 | Isosceles |
5 | 100 | 100 | 200 | Not a Triangle |
6 | 100 | 1 | 100 | Isosceles |
7 | 100 | 2 | 100 | Isosceles |
8 | 100 | 100 | 100 | Equilateral |
9 | 100 | 199 | 100 | Isosceles |
10 | 100 | 200 | 100 | Not a Triangle |
11 | 1 | 100 | 100 | Isosceles |
12 | 2 | 100 | 100 | Isosceles |
13 | 100 | 100 | 100 | Equilateral |
14 | 199 | 100 | 100 | Isosceles |
15 | 200 | 100 | 100 | Not a Triangle |
Generalizations and inherent limitations of BVA:
Generalization vectors:
By dimension: scales linearly at .
By range typology: language-dependent ranges, bounded discrete ranges, unbounded discrete ranges (lacking clear structural boundaries), and logical variables.
Limitations:
Highly effective when input variables represent independent physical quantities (e.g., mass, length, temperature).
Utterly blind to the semantic meaning of variables and functional code logic.
Ineffective when variables exhibit strong logical interdependencies: if input variables are mutually dependent, boundary points selected under the independence assumption may miss critical failure requirements.
Extensions of Boundary Value Testing: Robustness and Worst-Case Testing
Robustness Testing:
Extends standard BVA beyond valid limits to assess exception handling and system survivability.
Incorporates two additional out-of-bound values per input variable: a value slightly below the minimum () and a value slightly above the maximum ().
Seven-value set per variable: , , , , , , .
Under the single fault assumption, testing variables requires exactly test cases.
Strongly typed languages may throw fatal compilation or runtime type violations when given values outside predefined bounds; robustness testing verifies explicit logic handling for invalid inputs in weakly typed environments.

Worst-Case Testing:
Explicitly rejects the single fault assumption, anticipating that catastrophic failures often occur when multiple variables assume extreme values simultaneously.
Employs the full Cartesian product of the five standard BVA values across all dimensions.
Total test suite cardinality: test cases.
Most appropriate for mission-critical, high-consequence systems where variables interact heavily and operational failure carries extreme cost.

Robust Worst-Case Testing:
Combines the multi-fault assumption with robustness testing.
Evaluates the complete Cartesian product of all seven boundary and out-of-bounds values across all dimensions.
Total test suite cardinality: test cases.
Provides maximum boundary combinatoric coverage at very high test execution cost.

Special Value Testing and Boundary Value Guidelines
Special Value Testing:
The most widely practiced, intuitive, and least uniform functional testing technique.
Relies on tester domain knowledge, engineering intuition, and past defect history to target identified "soft spots" in software logic.
Highly subjective, but consistently more effective at revealing complex, subtle program faults than purely mechanical boundary generation.
Engineering guidelines for boundary-based testing:
Assess whether inputs are truly independent versus mutually coupled; if coupled, BVA must be supplemented with equivalence partitioning or decision tables.
Determine whether normal boundaries or robust (out-of-range) inputs are required based on language type systems and error handling requirements.
Decide between the single fault assumption ( or ) and multiple fault assumption ( or ) based on system criticality and execution cost.
Apply boundary value principles to output ranges (e.g., detecting edge cases in computed displays and error messages) and internal program variables (e.g., loop counters, array indices, memory pointers, and internal buffer limits).
Case Study: The Commission Problem
Specification details:
Sales representatives in the historical Arizona Territory sold rifle components (locks, stocks, and barrels) produced by a gunsmith in Missouri.
Component sales prices:
Lock =
Stock =
Barrel =
Monthly operational sales constraints:
Each salesperson must sell at least one complete rifle per month ( lock, stock, barrel).
Maximum monthly production limits per salesperson: locks, stocks, and barrels.
Sales orders were telegraphed to the Missouri facility after visiting each town, with the number of towns visited constrained by per month.
Tiered commission calculation rules:
on total sales amounts up to and including .
on the subsequent of sales (the portion of sales spanning from to ).
on any sales volume strictly in excess of .
Output boundary value test suite:
Test cases designed around the critical output boundaries of the commission tiers ( minimum complete rifle order, \\$1000.00 tier threshold, and surrounding border points):
Case # | Locks | Stocks | Barrels | Total Sales (\) | Commission (\) | Boundary Comment |
|---|---|---|---|---|---|---|
1 | 1 | 1 | 1 | 100 | 10.00 | Minimum valid complete rifle |
2 | 10 | 10 | 9 | 975 | 97.50 | Lower border of first tier (border-) |
3 | 10 | 9 | 10 | 970 | 97.00 | Lower border of first tier (border-) |
4 | 9 | 10 | 10 | 955 | 95.50 | Lower border of first tier (border-) |
5 | 10 | 10 | 10 | 1000 | 100.00 | Exact boundary of first tier (border) |
6 | 10 | 10 | 11 | 1025 | 103.75 | Upper border crossing into tier 2 (border+) |
7 | 10 | 11 | 10 | 1030 | 104.50 | Upper border crossing into tier 2 (border+) |
8 | 11 | 10 | 10 | 1045 | 106.75 | Upper border crossing into tier 2 (border+) |
Output special value test suite:
Test cases targeting structural breakpoints at the \\$1000.00 and \\$1800.00 tier transitions:
Case # | Locks | Stocks | Barrels | Total Sales (\) | Commission (\) | Boundary Comment |
|---|---|---|---|---|---|---|
1 | 10 | 11 | 9 | 1005 | 100.75 | Border just above \\$1000.00 threshold (border+) |
2 | 18 | 17 | 19 | 1795 | 219.25 | Border just below \\$1800.00 threshold (border-) |
3 | 18 | 19 | 17 | 1805 | 221.00 | Border just above \\$1800.00 threshold (border+) |
Equivalence Class Testing Foundations and Taxonomy
Mathematical definition and partitioning motivations:
Equivalence class testing partitions an input or output set into mutually disjoint subsets whose collective union equals the entire set.
Testing implications:
Completeness: Because the union of all equivalence classes encompasses the entire domain, all operational scenarios are represented.
Non-Redundancy: Because all classes in a partition are pairwise disjoint, testing one representative value per class prevents redundant tests.
Operational premise: Any single representative value within an equivalence class is functionally interchangeable with any other value in the same class.
Mathematical formulation of partitioning:
Consider program with three input variables possessing input domains .
Let partitions be defined such that:
Select representative values , , (such as interval midpoints).
The Four-Quadrant Taxonomy of Equivalence Testing:
Derived from two independent dimensions:
Single fault vs. multiple fault assumption (yields Weak vs. Strong distinction).
Handling of invalid data (yields Normal vs. Robust distinction).
Detailed taxonomy variants:
Weak Normal Equivalence Testing:
Enforces the single fault assumption on valid inputs only.
Selects one representative value from each valid equivalence class across test cases.
The minimum number of test cases equals the cardinality of the partition containing the largest number of subsets:
For partitions with sizes 3, 2, and 4, Weak Normal testing produces exactly 4 test cases:
Test Case | Variable | Variable | Variable |
|---|---|---|---|
WE1 | |||
WE2 | |||
WE3 | |||
WE4 |
Strong Normal Equivalence Testing:
Enforces the multiple fault assumption on valid inputs.
Based on the complete Cartesian product of all valid partition subsets across all input domains:
For partitions with sizes 3, 2, and 4, Strong Normal testing generates distinct test cases, thoroughly testing all combinations of valid representative values:
Test Case # | Variable | Variable | Variable |
|---|---|---|---|
SE1 | |||
SE2 | |||
SE3 | |||
SE4 | |||
SE5 | |||
SE6 | |||
SE7 | |||
SE8 | |||
SE9 | |||
SE10 | |||
SE11 | |||
SE12 | |||
SE13 | |||
SE14 | |||
SE15 | |||
SE16 | |||
SE17 | |||
SE18 | |||
SE19 | |||
SE20 | |||
SE21 | |||
SE22 | |||
SE23 | |||
SE24 |
Weak Robust Equivalence Testing:
Evaluates both valid and invalid input classes under the single fault assumption.
For valid test cases, inputs are selected as in weak normal testing.
For invalid test cases, each test contains exactly one invalid value from an invalid equivalence class, while all other inputs are held at valid nominal values.
Strong Robust Equivalence Testing:
Evaluates the complete Cartesian product of all equivalence classes—both valid and invalid—across every input dimension.
Fully tests multi-fault interactions among invalid and valid input sets simultaneously.
Traditional Equivalence Class Testing Strategy
The traditional view defines equivalence classes by segmenting each variable's domain into valid and invalid ranges:
Valid inputs represent the expected operational conditions.
Invalid inputs represent all values outside the acceptable boundaries.
Systematic procedure for an -variable program F(x_1, x_2, \dots, x_n)$:\n - **Step 1:** Formulate test cases containing valid values for all n variables simultaneously (Weak Normal form).\n - **Step 2:** Formulate a test case containing an invalid value for variable x_1n - 1x_1.\n - **Step 3:** Repeat Step 2 systematically for each remaining variable from x_2x_n.\n - Subsumption relationship: If variable ranges are explicitly bounded, traditional equivalence test cases form a direct subset of the test cases generated by robustness testing.\n\n- Practical challenges of the traditional approach:\n - Requirements specifications frequently fail to document the expected outputs or system behaviors for invalid inputs.\n - Strongly typed programming languages enforce type constraints at compile time, eliminating the operational need to test certain invalid inputs.\n\n- Concrete traditional equivalence application: Size and Weight\n - Program taking two inputs: `size` and `weight`.\n - Valid ranges:\n - S_1: 0 < \text{size} < 200\n - W_1: 0 < \text{weight} < 1500\n - Invalid ranges:\n - S_2: \text{size} \ge 200\n - S_3: \text{size} \le 0\n - W_2: \text{weight} \ge 1500\n - W_3: \text{weight} \le 0\n - Derived traditional test suite (TE1 to TE5):\n\n| Test Case | `size` | `weight` | Expected Output |\n| :--- | :--- | :--- | :--- |\n| TE1 | 100 | 750 | Valid normal output |\n| TE2 | 100 | -1 | invalid input |\n| TE3 | 100 | 1500 | invalid input |\n| TE4 | -1 | 750 | invalid input |\n| TE5 | 200 | 750 | invalid input |\n\n\n# Equivalence Class Testing Case Studies: Triangle and NextDate Problems\n\n- Case Study 1: The Triangle Problem\n - **Output (Range) Equivalence Partitioning:**\n - Partitions the domain based on the four possible functional output classifications:\n - R_1 = {\langle a, b, c \rangle \mid \text{triangle is equilateral}}\n - R_2 = {\langle a, b, c \rangle \mid \text{triangle is isosceles}}\n - R_3 = {\langle a, b, c \rangle \mid \text{triangle is scalene}}\n - R_4 = {\langle a, b, c \rangle \mid \text{sides } a, b, c \text{ do not form a triangle}}\n - Derived output test suite (OE1 to OE4):\n\n| Test Case | Side abc | Expected Output |\n| :--- | :--- | :--- | :--- | :--- |\n| OE1 | 5 | 5 | 5 | Equilateral |\n| OE2 | 2 | 2 | 3 | Isosceles |\n| OE3 | 3 | 4 | 5 | Scalene |\n| OE4 | 4 | 1 | 2 | Not a Triangle |\n\n- **Input Domain Equivalence Partitioning:**\n - Produces a richer, more comprehensive set of equivalence partitions based on side equality relationships:\n - D_1 = {\langle a, b, c \rangle \mid a = b = c}\n - D_2 = {\langle a, b, c \rangle \mid a = b, a e c}\n- D_3 = {\langle a, b, c \rangle \mid a = c, a e b}\n- D_4 = {\langle a, b, c \rangle \mid b = c, a e b}\n- D_5 = {\langle a, b, c \rangle \mid a e b, a e c, b e c}\n - Partitions based on violation of the triangle inequality property (a + b > ca + c > bb + c > a):\n - D_6 = {\langle a, b, c \rangle \mid a \ge b + c}\n - D_7 = {\langle a, b, c \rangle \mid b \ge a + c}\n - D_8 = {\langle a, b, c \rangle \mid c \ge a + b}\n - Note: Boundary conditions can be refined further by splitting D_6D_6' = {\langle a, b, c \rangle \mid a = b + c}D_6'' = {\langle a, b, c \rangle \mid a > b + c}.\n\n- Case Study 2: The NextDate Problem\n - Function of three variables: `month`, `day`, and `year`, with valid input ranges:\n - 1 \le \text{month} \le 12\n - 1 \le \text{day} \le 31\n - 1812 \le \text{year} \le 2012\n - **Traditional Boundary-Derived Equivalence Classes:**\n - Valid classes: M_1 = {m \mid 1 \le m \le 12}D_1 = {d \mid 1 \le d \le 31}Y_1 = {y \mid 1812 \le y \le 2012}.\n - Invalid classes: M_2 = {m \mid m < 1}M_3 = {m \mid m > 12}D_2 = {d \mid d < 1}D_3 = {d \mid d > 31}Y_2 = {y \mid y < 1812}Y_3 = {y \mid y > 2012}.\n - Traditional test suite (TE1 to TE7):\n\n| Case ID | Month | Day | Year | Expected Output |\n| :--- | :--- | :--- | :--- | :--- |\n| TE1 | 6 | 15 | 1912 | 6/16/1912 |\n| TE2 | -1 | 15 | 1912 | Invalid |\n| TE3 | 13 | 15 | 1912 | Invalid |\n| TE4 | 6 | -1 | 1912 | Invalid |\n| TE5 | 6 | 32 | 1912 | Invalid |\n| TE6 | 6 | 15 | 1811 | Invalid |\n| TE7 | 6 | 15 | 2013 | Invalid |\n\n- **Refined Equivalence Classes Based on Calendar Logic:**\n - Careful consideration of month lengths and leap years produces more effective equivalence classes:\n - *Month classes:*\n - M_1 = {\text{month} \mid \text{month has 30 days (April, June, September, November)}}\n - M_2 = {\text{month} \mid \text{month has 31 days (January, March, May, July, August, October, December)}}\n - M_3 = {\text{month} \mid \text{month is February}}\n - *Day classes:*\n - D_1 = {\text{day} \mid 1 \le \text{day} \le 28}\n - D_2 = {\text{day} \mid \text{day} = 29}\n - D_3 = {\text{day} \mid \text{day} = 30}\n - D_4 = {\text{day} \mid \text{day} = 31}\n - *Year classes:*\n - Y_1 = {\text{year} \mid \text{year} = 1900 \text{ (century common year)}}\n - Y_2 = {\text{year} \mid 1812 \le \text{year} \le 2012 \wedge \text{year} e 1900 \wedge \text{year} \equiv 0 \pmod 4 \text{ (leap year)}}\n- Y_3 = {\text{year} \mid 1812 \le \text{year} \le 2012 \wedge \text{year} ot\equiv 0 \pmod 4 \text{ (common year)}}\n- Weak equivalence test cases using refined classes (WE1 to WE4):\n\n| Case ID | Month | Day | Year | Expected Output |\n| :--- | :--- | :--- | :--- | :--- |\n| WE1 | 6 | 14 | 1900 | 6/15/1900 |\n| WE2 | 7 | 29 | 1912 | 7/30/1912 |\n| WE3 | 2 | 30 | 1913 | Invalid |\n| WE4 | 6 | 31 | 1900 | Invalid |\n\n- Strong equivalence test suite (3 \times 4 \times 3 = 36 test cases, SE1 to SE36):\n\n| CASE ID | Month | Day | Year | Output |\n| :--- | :--- | :--- | :--- | :--- |\n| SE1 | 6 | 14 | 1900 | 6/15/1900 |\n| SE2 | 6 | 14 | 1912 | 6/15/1912 |\n| SE3 | 6 | 14 | 1913 | 6/15/1913 |\n| SE4 | 6 | 29 | 1900 | 6/30/1900 |\n| SE5 | 6 | 29 | 1912 | 6/30/1912 |\n| SE6 | 6 | 29 | 1913 | 6/30/1913 |\n| SE7 | 6 | 30 | 1900 | 7/1/1900 |\n| SE8 | 6 | 30 | 1912 | 7/1/1912 |\n| SE9 | 6 | 30 | 1913 | 7/1/1913 |\n| SE10 | 6 | 31 | 1900 | ERROR |\n| SE11 | 6 | 31 | 1912 | ERROR |\n| SE12 | 6 | 31 | 1913 | ERROR |\n| SE13 | 7 | 14 | 1900 | 7/15/1900 |\n| SE14 | 7 | 14 | 1912 | 7/15/1912 |\n| SE15 | 7 | 14 | 1913 | 7/15/1913 |\n| SE16 | 7 | 29 | 1900 | 7/30/1900 |\n| SE17 | 7 | 29 | 1912 | 7/30/1912 |\n| SE18 | 7 | 29 | 1913 | 7/30/1913 |\n| SE19 | 7 | 30 | 1900 | 7/31/1900 |\n| SE20 | 7 | 30 | 1912 | 7/31/1912 |\n| SE21 | 7 | 30 | 1913 | 7/31/1913 |\n| SE22 | 7 | 31 | 1900 | 8/1/1900 |\n| SE23 | 7 | 31 | 1912 | 8/1/1912 |\n| SE24 | 7 | 31 | 1913 | 8/1/1913 |\n| SE25 | 2 | 14 | 1900 | 2/15/1900 |\n| SE26 | 2 | 14 | 1912 | 2/15/1912 |\n| SE27 | 2 | 14 | 1913 | 2/15/1913 |\n| SE28 | 2 | 29 | 1900 | ERROR |\n| SE29 | 2 | 29 | 1912 | 3/1/1912 |\n| SE30 | 2 | 29 | 1913 | ERROR |\n| SE31 | 2 | 30 | 1900 | ERROR |\n| SE132 | 2 | 30 | 1912 | ERROR |\n| SE33 | 2 | 30 | 1913 | ERROR |\n| SE34 | 2 | 31 | 1900 | ERROR |\n| SE35 | 2 | 31 | 1912 | ERROR |\n| SE36 | 2 | 31 | 1913 | ERROR |\n\n\n# Equivalence Class Testing Guidelines and Considerations\n\n- Relative comprehensiveness:\n - Weak equivalence forms (both normal and robust) are substantially less thorough than corresponding strong forms.\n - In strongly typed programming languages where out-of-range inputs trigger compile-time or runtime errors, robust forms are unnecessary; however, if error-handling logic is a primary quality requirement, robust testing is essential.\n\n- Suitability and domain characteristics:\n - Equivalence class testing is suitable when input data is defined over numerical intervals or discrete sets of values, particularly when invalid inputs can lead to system faults.\n - The approach is strengthened when combined with Boundary Value Testing into a hybrid strategy, reusing the effort invested in defining equivalence classes to identify boundary points.\n\n- Complex logic and variable dependencies:\n - Highly indicated when program logic is complex: intricate program functionality helps identify meaningful equivalence classes.\n - Strong equivalence class testing presumes variable independence; if variables are mutually dependent, the Cartesian product will inevitably generate invalid or impossible combinations, leading to redundant error cases.\n\n- Equivalence relation discovery and heuristics:\n - Finding the optimal equivalence relation often requires iterative refinement. When the natural relation is not immediately obvious, testers should apply the **Competent Programmer Hypothesis**—anticipating how a competent software developer would structure the implementation logic.\n - The operational distinction between strong and weak forms provides a useful separation between test types: strong forms are suited for forward-moving progression testing, while weak forms are effective for regression testing.\n\n\n# Decision Table Based Testing: Concepts and Structure\n\n- Concept and utility:\n - Decision tables provide a rigorous, concise tabular representation for modeling complex logical relationships and boolean conditions.\n - Unlike standard conditional statements (`if-then-else`, `switch-case`), decision tables clearly map combinations of multiple independent conditions to one or more corresponding actions.\n - Ensure complete coverage by making all condition combinations and their resulting actions explicit.\n - Support two testing applications (logic-based testing):\n - *Structural testing*: Applied directly to internal execution paths and control flowgraphs.\n - *Functional testing*: Applied directly to requirements specifications.\n\n- Structural components of a decision table:\n - **Condition Stub:** Upper-left quadrant listing all input conditions, relations, or predicates.\n - **Condition Entries (Alternatives):** Upper-right quadrant defining the truth values (True, False, or Don't Care) for each condition across rules.\n - **Action Stub:** Lower-left quadrant listing all possible operations, procedures, or output states.\n - **Action Entries:** Lower-right quadrant indicating whether an action executes (marked with an `X`, `Yes`, or blank/`No`), and optionally specifying execution order.\n\n- Decision table formats:\n - **Limited Entry Decision Tables:** Condition entries are strictly binary boolean values (`True`/`False` or `Yes`/`No`).\n - **Extended Entry Decision Tables:** Conditions can take on multiple discrete values from a defined set.\n - **Don't Care Entry (X-):** Indicates that the state of a particular condition has no effect on the action triggered by that rule.\n - **Default Rules:** Specify fallback actions to take when an input combination satisfies none of the explicit rules; when decision tables are used for test case design, all default rules and their predicates must be stated explicitly.\n\n- Generic structure of a 4-rule limited-entry decision table:\n\n| Elements | Rule 1 | Rule 2 | Rule 3 | Rule 4 |\n| :--- | :--- | :--- | :--- | :--- |\n| **Condition 1** | Yes | Yes | No | No |\n| **Condition 2** | Yes | X | No | X |\n| **Condition 3** | No | Yes | No | X |\n| **Condition 4** | No | Yes | No | Yes |\n| **Action 1** | Yes | Yes | No | No |\n| **Action 2** | No | No | Yes | No |\n| **Action 3** | No | No | No | Yes |\n\n- Explicit default action representation (Rules 5 through 8):\n\n| Elements | Rule 5 | Rule 6 | Rule 7 | Rule 8 |\n| :--- | :--- | :--- | :--- | :--- |\n| **Condition 1** | X | No | Yes | Yes |\n| **Condition 2** | X | Yes | X | No |\n| **Condition 3** | Yes | X | No | No |\n| **Condition 4** | No | No | Yes | X |\n| **Default Action** | Yes | Yes | Yes | Yes |\n\n- Concrete system example: Printer Troubleshooting Decision Table\n - Three conditions, five actions, and eight unique decision rules:\n\n| Conditions / Rules | R1 | R2 | R3 | R4 | R5 | R6 | R7 | R8 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| Printer does not print | Y | Y | Y | Y | N | N | N | N |\n| A red light is flashing | Y | Y | N | N | Y | Y | N | N |\n| Printer is unrecognized | Y | N | Y | N | Y | N | Y | N |\n| **Actions** | | | | | | | | |\n| Check the power cable | | | X | | | | | |\n| Check the printer-computer cable | X | | X | | | | | |\n| Ensure printer software is installed | X | | X | | X | | X | |\n| Check/replace ink | X | X | | | X | X | | |\n| Check for paper jam | | X | | X | | | | |\n\n- Concrete system example: Employee Payroll Decision Table\n - Two conditions (Employee type: Salaried `S` vs. Hourly `H`; Hours worked: `<40`, `40`, `>40`) generating six operational rules:\n\n| Conditions / Rules | Rule 1 | Rule 2 | Rule 3 | Rule 4 | Rule 5 | Rule 6 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: |\n| **Employee type** | S | H | S | H | S | H |\n| **Hours worked** | <40 | <40 | 40 | 40 | >40 | >40 |\n| **Actions** | | | | | | |\n| Pay base salary | X | | X | | X | |\n| Calculate hourly wage | | X | | X | | X |\n| Calculate overtime | | | | | | X |\n| Produce Absence Report | X | | | | | |\n\n\n# Decision Table Development Methodology and Applicability Criteria\n\n- Seven-step decision table development methodology:\n - **Step 1:** Identify and determine all operational conditions and their acceptable values.\n - **Step 2:** Calculate the theoretical maximum number of rules (for n2^n).\n - **Step 3:** Identify all possible actions and system outputs.\n - **Step 4:** Encode the valid condition combinations across the rule columns.\n - **Step 5:** Assign the appropriate action or sequence of actions to each rule column.\n - **Step 6:** Verify the decision table logic against the requirements policy for correctness.\n - **Step 7:** Simplify the decision table by combining rules that produce identical actions using Don't Care entries, reducing the total column count.\n\n- Operational applicability criteria:\n - The order in which conditions or predicates are evaluated must not alter the rule's interpretation or the resulting actions.\n - The order in which rules are evaluated must not affect the outcome.\n - Once a rule is satisfied and its actions are triggered, no subsequent rules need to be evaluated (rules are mutually exclusive).\n - The sequence in which triggered actions execute must not affect correctness.\n\n- Table verification: Completeness and Consistency\n - **Completeness:** The decision table is complete if and only if every possible combination of condition truth values—including all default cases—is accounted for across the rules.\n - **Consistency:** The decision table is consistent if and only if every unique combination of condition truth values maps to exactly one set of actions, avoiding contradictory execution behavior.\n\n\n# Test Case Design Using Decision Tables: Triangle and NextDate Case Studies\n\n- Mapping decision tables to test suites:\n - Conditions are mapped directly to input values or input equivalence classes.\n - Actions are mapped directly to expected program outputs or processing states.\n - Each individual rule column is translated directly into an executable test case.\n - For a table with knk2^n test cases (if uncompressed).\n\n- Case Study 1: The Triangle Problem Decision Table\n - Six conditions based on the triangle inequality and side equality checks:\n - C_1: a < b + c\n - C_2: b < a + c\n - C_3: c < a + b\n - C_4: a = b\n - C_5: a = c\n - C_6: b = c\n - Five actions:\n - A_1: \text{Not a Triangle}\n - A_2: \text{Scalene}\n - A_3: \text{Isosceles}\n - A_4: \text{Equilateral}\n - A_5: \text{Impossible}\n - The compiled decision table:\n\n| Conditions | R1 | R2 | R3 | R4 | R5 | R6 | R7 | R8 | R9 | R10 | R11 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| C_1: a < b + c? | F | T | T | T | T | T | T | T | T | T | T |\n| C_2: b < a + c? | - | F | T | T | T | T | T | T | T | T | T |\n| C_3: c < a + b? | - | - | F | T | T | T | T | T | T | T | T |\n| C_4: a = b? | - | - | - | T | T | T | T | F | F | F | F |\n| C_5: a = c? | - | - | - | T | T | F | F | T | T | F | F |\n| C_6: b = c? | - | - | - | T | F | T | F | T | F | T | F |\n| **Actions** | | | | | | | | | | | |\n| A_1: \text{Not a Triangle} | X | X | X | | | | | | | | |\n| A_2: \text{Scalene} | | | | | | | | | | | X |\n| A_3: \text{Isosceles} | | | | | | | X | | X | X | |\n| A_4: \text{Equilateral} | | | | X | | | | | | | |\n| A_5: \text{Impossible} | | | | | X | X | | X | | | |\n\n- Derived test cases (DT1 to DT11):\n\n| Case ID | Side abc | Expected Output |\n| :--- | :--- | :--- | :--- | :--- |\n| DT1 | 4 | 1 | 2 | Not a Triangle |\n| DT2 | 1 | 4 | 2 | Not a Triangle |\n| DT3 | 1 | 2 | 4 | Not a Triangle |\n| DT4 | 5 | 5 | 5 | Equilateral |\n| DT5 | ? | ? | ? | Impossible (a=b \wedge a=c \wedge b e c) |\n| DT6 | ? | ? | ? | Impossible (a=b \wedge a e c \wedge b=c) |\n| DT7 | 2 | 2 | 3 | Isosceles |\n| DT8 | ? | ? | ? | Impossible (a e b \wedge a=c \wedge b=c) |\n| DT9 | 2 | 3 | 2 | Isosceles |\n| DT10 | 3 | 2 | 2 | Isosceles |\n| DT11 | 3 | 4 | 5 | Scalene |\n\n- Case Study 2: The NextDate Problem Decision Table\n - **First Iteration:**\n - Uses 3 month classes (M_1M_2M_3D_1: 1..28D_2: 29D_3: 30D_4: 31Y_1: 1900Y_2Y_3: common year).\n - Decision Table Part 1 (Rules 1 to 8: 30-day and 31-day months):\n\n| Conditions | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| C_1: \text{month in} | M1 | M1 | M1 | M1 | M2 | M2 | M2 | M2 |\n| C_2: \text{day in} | D1 | D2 | D3 | D4 | D1 | D2 | D3 | D4 |\n| C_3: \text{year in} | - | - | - | - | - | - | - | - |\n| Rule count | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 |\n| **Actions** | | | | | | | | |\n| A_1: \text{Impossible} | | | | X | | | | |\n| A_2: \text{Increment day} | X | X | | | X | X | X | |\n| A_3: \text{Reset day} | | | X | | | | | X |\n| A_4: \text{Increment month}| | | X | | | | | ? |\n| A_5: \text{Reset month} | | | | | | | | ? |\n| A_6: \text{Increment year} | | | | | | | | ? |\n\n- Decision Table Part 2 (Rules 9 to 16: February conditions):\n\n| Conditions | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| C_1: \text{month in} | M3 | M3 | M3 | M3 | M3 | M3 | M3 | M3 |\n| C_2: \text{day in} | D1 | D1 | D1 | D2 | D2 | D2 | D3 | D3 |\n| C_3: \text{year in} | Y1 | Y2 | Y3 | Y1 | Y2 | Y3 | - | - |\n| Rule count | 1 | 1 | 1 | 1 | 1 | 1 | 3 | 3 |\n| **Actions** | | | | | | | | |\n| A_1: \text{Impossible} | | | | X | | X | X | X |\n| A_2: \text{Increment day} | | X | | | | | | |\n| A_3: \text{Reset day} | X | | X | | X | | | |\n| A_4: \text{Increment month}| X | | X | | X | | | |\n| A_5: \text{Reset month} | | | | | | | | |\n| A_6: \text{Increment year} | | | | | | | | |\n\n - Limitations of the first attempt: Rule 8 contains ambiguities (question marks) because December 31 requires resetting the month to 1 and incrementing the year, whereas other 31-day months only increment the month. Additionally, February 28 requires checking whether the year is a leap year before deciding whether to increment the day or reset it.\n\n- **Second Iteration (Refined):**\n - Isolates December and separates day 28 from day 29 to handle calendar logic cleanly:\n - Months: M_1M_2M_3M_4 (February).\n - Days: D_1 (1..27)D_2 (28)D_3 (29)D_4 (30)D_5 (31).\n - Years: Y_1Y_2 (common year).\n - Refined Decision Table Part 1 (Rules 1 to 10: 30-day months and 31-day non-December months):\n\n| Conditions | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| C_1: \text{month in} | M1 | M1 | M1 | M1 | M1 | M2 | M2 | M2 | M2 | M2 |\n| C_2: \text{day in} | D1 | D2 | D3 | D4 | D5 | D1 | D2 | D3 | D4 | D5 |\n| C_3: \text{year in} | - | - | - | - | - | - | - | - | - | - |\n| **Actions** | | | | | | | | | | |\n| A_1: \text{Impossible} | | | | | X | | | | | |\n| A_2: \text{Increment day} | X | X | X | | | X | X | X | X | |\n| A_3: \text{Reset day} | | | | X | | | | | | X |\n| A_4: \text{Increment month}| | | | X | | | | | | X |\n| A_5: \text{Reset month} | | | | | | | | | | |\n| A_6: \text{Increment year} | | | | | | | | | | |\n\n- Refined Decision Table Part 2 (Rules 11 to 22: December and February logic):\n\n| Conditions | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |\n| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| C_1: \text{month in} | M3 | M3 | M3 | M3 | M3 | M4 | M4 | M4 | M4 | M4 | M4 | M4 |\n| C_2: \text{day in} | D1 | D2 | D3 | D4 | D5 | D1 | D2 | D2 | D3 | D3 | D4 | D5 |\n| C_3: \text{year in} | - | - | - | - | - | - | Y1 | Y2 | Y1 | Y2 | - | - |\n| **Actions** | | | | | | | | | | | | |\n| A_1: \text{Impossible} | | | | | | | | | | X | X | X |\n| A_2: \text{Increment day} | X | X | X | X | | X | X | | | | | |\n| A_3: \text{Reset day} | | | | | X | | | X | X | | | |\n| A_4: \text{Increment month}| | | | | | | | X | X | | | |\n| A_5: \text{Reset month} | | | | | X | | | | | | | |\n| A_6: \text{Increment year} | | | | | X | | | | | | | |\n\n\n# Decision Table Testing Guidelines and Evaluation\n\n- Best practical applications for decision table testing:\n - Software displaying extensive decision-making workflows.\n - Applications with significant, complex logical dependencies connecting input variables.\n - Programs where calculations depend on specific subsets of input variables.\n - Systems characterized by distinct cause-and-effect mappings between inputs and outputs.\n - Modules with high cyclomatic complexity and deep branching structures.\n\n- Practical constraints and scalability considerations:\n - Scalability limit: Decision tables do not scale gracefully to large numbers of conditions due to the exponential rule explosion (2^nn$$ binary conditions).
Iterative engineering: In practice, decision tables are developed iteratively, with initial passes identifying edge-case ambiguities and subsequent refinements producing complete, consistent logic models.