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 DD 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 PP denote a program.

    • Let DD denote the complete input domain for program PP.

    • Let dd denote an individual input element such that d∈Dd \in D.

    • Let TT denote a test set such that T⊆DT \subseteq D.

    • The execution of program PP on input element dd produces an output denoted as P(d)P(d).

Goodenough and Gerhart Fundamental Testing Model

Reliability, Validity, and Completeness in Test Selection

  • Predicate definitions for program acceptability and test success:

    • Acceptability Predicate (OK(d)OK(d)): A predicate defined over the input domain that evaluates to true if and only if the execution outcome P(d)P(d) constitutes an acceptable, correct result for the given input dd:

    • OK(d)  ⟺  P(d) is acceptableOK(d) \iff P(d) \text{ is acceptable}

    • Successful Test Set (SUCCESSFUL(T)SUCCESSFUL(T)): For a test set T⊆DT \subseteq D, TT is successful if and only if every test case t∈Tt \in T produces an acceptable outcome:

    • SUCCESSFUL(T)  ⟺  (∀t∈T)(OK(t))SUCCESSFUL(T) \iff (\forall t \in T)(OK(t))

    • Ideal Test Set: A test set T⊆DT \subseteq D constitutes an ideal test if the acceptability of all elements in TT guarantees the acceptability of all elements across the entire domain DD:

    • (∀t∈T)(OK(t))  ⟹  (∀d∈D)(OK(d))(\forall t \in T)(OK(t)) \implies (\forall d \in D)(OK(d))

    • An ideal test operates as an exhaustive surrogate: testing the sample set TT is sufficient to definitively conclude the correctness of the program over the entire domain DD.

  • Selection criteria attributes:

    • Selection Criterion (CC): A formal collection of predicates and properties utilized to select a specific test data subset TT from the input domain DD.

    • Reliable Criterion: A selection criterion CC is reliable if and only if all test sets selected using predicates in CC produce consistent results—that is, either every test set selected by CC is successful, or no test set selected by CC is successful:

    • Reliability measures consistency of error detection.

    • Valid Criterion: A selection criterion CC is valid if and only if whenever the program PP is incorrect (contains at least one fault for some d∈Dd \in D), the criterion CC is capable of selecting a test set TT 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 CC is both reliable and valid, then any test set TT selected using criterion CC 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 CC.

    • Every potential termination condition within the program (such as an arithmetic overflow, underflow, or boundary break) must be represented by a condition in CC.

    • 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 CC.

    • All test predicates included in CC 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 DD.

    • Debugging disrupts criterion properties: as discovered faults are removed (or new defects are introduced during repair), neither the reliability nor the validity of criterion CC is necessarily preserved.

    • Triviality under correctness: If a program PP 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 PP is incorrect, there is no generic method to know whether a criterion is ideal without already knowing the specific errors embedded in PP.

  • Definition of Test Completeness:

    • Let DD be the input domain of program PP.

    • Let CC denote a set of selection predicates such that for any input d∈Dd \in D and predicate c∈Cc \in C, c(d)c(d) evaluates to true if dd satisfies cc.

    • A test set TT is defined as complete with respect to criterion CC, denoted COMPLETE(C,T)COMPLETE(C, T), if and only if every predicate in CC is satisfied by at least one test case in TT, and every test case in TT satisfies at least one predicate in CC:

    • COMPLETE(C,T)  ⟺  (∀c∈C)(∃t∈T)(c(t))∧(∀t∈T)(∃c∈C)(c(t))COMPLETE(C, T) \iff (\forall c \in C)(\exists t \in T)(c(t)) \wedge (\forall t \in T)(\exists c \in C)(c(t))

    • While COMPLETE(C,T)COMPLETE(C, T) 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 requires if (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 BB denote the exhaustive set of all faults present in program PP, which would be fully exposed by an ideal test set TIT_I.

    • Step 1: The software tester defines an initial predicate set C1C_1 and constructs a test set T1T_1 such that COMPLETE(C1,T1)COMPLETE(C_1, T_1) holds. Executing T1T_1 exposes an initial subset of faults B1⊆BB_1 \subseteq B.

    • Step 2: The tester incrementally defines a broader, more rigorous set of predicates C2C_2 such that C1⊂C2C_1 \subset C_2, and designs an expanded test suite T2T_2 such that T1⊂T2T_1 \subset T_2 and COMPLETE(C2,T2)COMPLETE(C_2, T_2) holds. Executing T2T_2 exposes a larger fault set B2B_2 such that B1⊆B2B_1 \subseteq B_2.

    • Inductive Step: The tester continues this incremental expansion to identify predicate set CkC_k and corresponding test suite TkT_k satisfying COMPLETE(Ck,Tk)COMPLETE(C_k, T_k), exposing fault set BkB_k, such that TkT_k progressively converges toward and approximates the ideal test set TIT_I.

Software Reliability Growth and Failure Intensity Reduction Models

  • Mathematical modeling of reliability growth during execution and defect elimination:

    • Let λ\lambda denote the current failure intensity (failures per unit time).

    • Let λ0\lambda_0 denote the initial failure intensity at the start of system execution.

    • Let μ\mu denote the average total number of failures experienced at a given point in execution time.

    • Let v0v_0 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 (μ\mu).

    • Failure intensity drops directly toward zero as cumulative failures approach the finite maximum v0v_0:

      • λ(μ)=λ0(1−μv0)\lambda(\mu) = \lambda_0 \left(1 - \frac{\mu}{v_0}\right)

    • 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 v0v_0.

Failure Intensity Reduction Models: Basic versus Logarithmic

Gourlay's Mathematical Theory of Testing Systems

  • Core assumptions and foundational entities:

    • Program specifications (SS) are assumed to be correct and serve as the absolute, sole arbiter of software correctness.

    • A program PP is defined to be correct if and only if it satisfies its corresponding specification SS.

    • Gourlay's theory formalizes the mathematical relationships among three distinct fundamental sets of entities:

    • The set of all Specifications (S\mathcal{S}, with specific specification s∈S⊆Ss \in S \subseteq \mathcal{S}).

    • The set of all Programs (P\mathcal{P}, with specific program p∈P⊆Pp \in P \subseteq \mathcal{P}).

    • The set of all Tests (T\mathcal{T}, with specific test t∈T⊆Tt \in T \subseteq \mathcal{T}).

  • Predicate extensions in Gourlay's model:

    • Extended acceptability predicate OK(p,t,s)OK(p, t, s): Evaluates to true if and only if the execution of program pp on test tt is judged acceptable and successful with respect to specification ss.

    • Program correctness predicate CORR(p,s)CORR(p, s): Program pp is correct with respect to specification ss if and only if OK(p,t,s)OK(p, t, s) evaluates to true for every test tt in the test domain TT:

    • CORR(p,s)  ⟺  (∀t∈T)(OK(p,t,s))CORR(p, s) \iff (\forall t \in T)(OK(p, t, s))

  • Formal architecture of testing systems:

    • A testing system is formally defined as a 5-tuple:

    • ⟨P,S,T,CORR,OK⟩\langle P, S, T, CORR, OK \rangle

    • Where for every p∈Pp \in P, s∈Ss \in S, and t∈Tt \in T, the condition holds that CORR(p,s)  ⟹  OK(p,t,s)CORR(p, s) \implies OK(p, t, s).

  • Structural derived testing systems:

    • Set Construction Testing System:

    • Given a base testing system ⟨P,S,T,CORR,OK⟩\langle P, S, T, CORR, OK \rangle, a derived system ⟨P,S,T′′,CORR,OK′⟩\langle P, S, T'', CORR, OK' \rangle is defined where T′′T'' is the set of all subsets (power set) of TT (T′′=P(T)T'' = \mathcal{P}(T)).

    • The composite predicate OK′(p,s,T)OK'(p, s, T) holds if and only if every individual trial t∈Tt \in T is acceptable:

      • OK′(p,s,T)  ⟺  (∀t∈T)(OK(p,t,s))OK'(p, s, T) \iff (\forall t \in T)(OK(p, t, s))

    • 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 ⟨P,S,T,CORR,OK⟩\langle P, S, T, CORR, OK \rangle, a derived system ⟨P,S,T′′,CORR,OK′⟩\langle P, S, T'', CORR, OK' \rangle is defined where T′′=P(T)T'' = \mathcal{P}(T).

    • The choice predicate OK′(p,s,T)OK'(p, s, T) holds if and only if at least one test case t∈Tt \in T is acceptable:

      • OK′(p,s,T)  ⟺  (∃t∈T)(OK(p,t,s))OK'(p, s, T) \iff (\exists t \in T)(OK(p, t, s))

    • 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 MM that consumes a program and a specification to generate a concrete test set:

    • M:P×S→TM: P \times S \to T

    • Classification of test methods by primary dependency:

    • Program-Dependent Methods (T=M(P)T = M(P)): Structural or white-box testing; test selection depends strictly on program code, control-flow paths, and implementation logic.

    • Specification-Dependent Methods (T=M(S)T = M(S)): Functional or black-box testing; test selection depends strictly on requirements, interfaces, and functional specs, completely independent of source code.

    • Expectation-Dependent Methods (T=M(S′)T = M(S')): Acceptance testing; test selection depends on customer expectations, operational environments, and external perspectives denoted by S′S'.

Power and Comparison of Testing Methods

  • Mathematical formulation of investigative power:

    • Let MM and NN be two distinct testing methods.

    • Let FMF_M and FNF_N denote the sets of program faults discoverable by methods MM and NN, respectively.

    • Method MM is defined to be at least as good as (possesses investigative power greater than or equal to) method NN if and only if whenever method NN discovers a fault, method MM is guaranteed to discover that fault:

    • FN⊆FMF_N \subseteq F_M

  • Comparative classification of investigative power:

    • Case 1: Direct Inclusion of Test Sets (TN⊆TMT_N \subseteq T_M)

    • If method MM generates a test set TMT_M that contains all test cases generated by method NN (TNT_N), then method MM subsumes method NN.

    • Method MM is structurally guaranteed to be at least as good as method NN (FN⊆FMF_N \subseteq F_M).

Gourlay Testing Power Case 1: Direct Subset Inclusion
  • Case 2: Overlapping Test Sets (TN⊈TMT_N \not\subseteq T_M)

  • In scenarios where TNT_N and TMT_M overlap but TMT_M does not completely contain TNT_N, direct structural subsumption cannot be claimed.

  • To determine relative power, program PP is executed against both suites to yield empirical fault sets FNF_N and FMF_M.

  • Method MM is judged to be at least as good as method NN if and only if FN⊆FMF_N \subseteq F_M.

Gourlay Testing Power Case 2: Overlapping Test Suites

Principles of Functional and Black-Box Testing

  • Mathematical view of software components:

    • Any program PP 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 f(y1,y2)f(y_1, y_2) accepting two variables bounded by a≤y1≤ba \le y_1 \le b and c≤y2≤dc \le y_2 \le d, the inequalities define a bounded two-dimensional rectangular input region.

    • For nn input variables bounded by equivalent inequalities, the valid input space forms an nn-dimensional hyper-rectangle.

Two-Dimensional Bounded Input Space
  • Five-value selection strategy per input variable:

    • Minimum boundary value (min⁡\min): aa

    • Value just above the minimum (min⁡+\min+): a+1a + 1

    • Nominal mid-range value (nom\text{nom}): a+b2\frac{a + b}{2}

    • Value just below the maximum (max⁡−\max-): b−1b - 1

    • Maximum boundary value (max⁡\max): bb

  • 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 nn input variables, standard BVA generates exactly 4n+14n + 1 test cases.

  • Geometric distribution for two variables (n=2n = 2, 4(2)+1=94(2) + 1 = 9 test cases):

    • T={⟨y1nom,y2min⟩,⟨y1nom,y2min+⟩,⟨y1nom,y2nom⟩,⟨y1nom,y2max-⟩,⟨y1nom,y2max⟩,⟨y1min,y2nom⟩,⟨y1min+,y2nom⟩,⟨y1max-,y2nom⟩,⟨y1max,y2nom⟩}T = \{\langle y_{1\text{nom}}, y_{2\text{min}} \rangle, \langle y_{1\text{nom}}, y_{2\text{min+}} \rangle, \langle y_{1\text{nom}}, y_{2\text{nom}} \rangle, \langle y_{1\text{nom}}, y_{2\text{max-}} \rangle, \langle y_{1\text{nom}}, y_{2\text{max}} \rangle, \langle y_{1\text{min}}, y_{2\text{nom}} \rangle, \langle y_{1\text{min+}}, y_{2\text{nom}} \rangle, \langle y_{1\text{max-}}, y_{2\text{nom}} \rangle, \langle y_{1\text{max}}, y_{2\text{nom}} \rangle\}

Boundary Value Analysis Test Point Distribution
  • Concrete BVA application: The Triangle Problem

    • Function taking three side inputs a,b,ca, b, c where each side is bounded within [1,200][1, 200].

    • Nominal value for each dimension: 100100.

    • Variable parameter values: min⁡=1\min = 1, min⁡+=2\min+ = 2, nom=100\text{nom} = 100, max⁡−=199\max- = 199, max⁡=200\max = 200.

    • Suite size: 4(3)+1=134(3) + 1 = 13 unique test points (expanding to 15 cases when evaluating full single-variable sweeps across each dimension):

Case #

Side aa

Side bb

Side cc

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 4n+14n + 1.

    • 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 (min⁡−\min-) and a value slightly above the maximum (max⁡+\max+).

    • Seven-value set per variable: min⁡−\min-, min⁡\min, min⁡+\min+, nom\text{nom}, max⁡−\max-, max⁡\max, max⁡+\max+.

    • Under the single fault assumption, testing nn variables requires exactly 6n+16n + 1 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.

Robustness Testing Point Distribution
  • 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 nn dimensions.

    • Total test suite cardinality: 5n5^n test cases.

    • Most appropriate for mission-critical, high-consequence systems where variables interact heavily and operational failure carries extreme cost.

Worst-Case Testing Point Distribution
  • 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 nn dimensions.

    • Total test suite cardinality: 7n7^n test cases.

    • Provides maximum boundary combinatoric coverage at very high test execution cost.

Robust Worst-Case Testing Point Distribution

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 (4n+14n + 1 or 6n+16n + 1) and multiple fault assumption (5n5^n or 7n7^n) 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 = $45.00\$45.00

    • Stock = $30.00\$30.00

    • Barrel = $25.00\$25.00

    • Monthly operational sales constraints:

    • Each salesperson must sell at least one complete rifle per month (min⁡=1\min = 1 lock, 11 stock, 11 barrel).

    • Maximum monthly production limits per salesperson: 7070 locks, 8080 stocks, and 9090 barrels.

    • Sales orders were telegraphed to the Missouri facility after visiting each town, with the number of towns visited constrained by 1≤towns≤101 \le \text{towns} \le 10 per month.

    • Tiered commission calculation rules:

    • 10%10\% on total sales amounts up to and including $1000.00\$1000.00.

    • 15%15\% on the subsequent $800.00\$800.00 of sales (the portion of sales spanning from $1000.01\$1000.01 to $1800.00\$1800.00).

    • 20%20\% on any sales volume strictly in excess of $1800.00\$1800.00.

  • Output boundary value test suite:

    • Test cases designed around the critical output boundaries of the commission tiers ($100.00\$100.00 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 PP with three input variables a,b,ca, b, c possessing input domains A,B,CA, B, C.

    • Let partitions be defined such that:

    • A=A1∪A2∪A3A = A_1 \cup A_2 \cup A_3

    • B=B1∪B2B = B_1 \cup B_2

    • C=C1∪C2∪C3∪C4C = C_1 \cup C_2 \cup C_3 \cup C_4

    • Select representative values ai∈Aia_i \in A_i, bj∈Bjb_j \in B_j, ck∈Ckc_k \in C_k (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:

      • Test Count=max⁡(∣Ai∣,∣Bj∣,∣Ck∣)\text{Test Count} = \max(|A_i|, |B_j|, |C_k|)

    • For partitions with sizes 3, 2, and 4, Weak Normal testing produces exactly 4 test cases:

Test Case

Variable aa

Variable bb

Variable cc

WE1

a1a_1

b1b_1

c1c_1

WE2

a2a_2

b2b_2

c2c_2

WE3

a3a_3

b1b_1

c3c_3

WE4

a1a_1

b2b_2

c4c_4

  • 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:

    • Test Count=∏i=1n∣Classes(Vi)∣\text{Test Count} = \prod_{i=1}^n |\text{Classes}(V_i)|

    • For partitions with sizes 3, 2, and 4, Strong Normal testing generates 3×2×4=243 \times 2 \times 4 = 24 distinct test cases, thoroughly testing all combinations of valid representative values:

Test Case #

Variable aa

Variable bb

Variable cc

SE1

a1a_1

b1b_1

c1c_1

SE2

a1a_1

b1b_1

c2c_2

SE3

a1a_1

b1b_1

c3c_3

SE4

a1a_1

b1b_1

c4c_4

SE5

a1a_1

b2b_2

c1c_1

SE6

a1a_1

b2b_2

c2c_2

SE7

a1a_1

b2b_2

c3c_3

SE8

a1a_1

b2b_2

c4c_4

SE9

a2a_2

b1b_1

c1c_1

SE10

a2a_2

b1b_1

c2c_2

SE11

a2a_2

b1b_1

c3c_3

SE12

a2a_2

b1b_1

c4c_4

SE13

a2a_2

b2b_2

c1c_1

SE14

a2a_2

b2b_2

c2c_2

SE15

a2a_2

b2b_2

c3c_3

SE16

a2a_2

b2b_2

c4c_4

SE17

a3a_3

b1b_1

c1c_1

SE18

a3a_3

b1b_1

c2c_2

SE19

a3a_3

b1b_1

c3c_3

SE20

a3a_3

b1b_1

c4c_4

SE21

a3a_3

b2b_2

c1c_1

SE22

a3a_3

b2b_2

c2c_2

SE23

a3a_3

b2b_2

c3c_3

SE24

a3a_3

b2b_2

c4c_4

  • 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 nn-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_1,whilekeepingallother, while keeping all othern - 1variablesatvalidvalues.Ifexecutionfails,thefailureisdefinitivelyisolatedtovariablevariables at valid values. If execution fails, the failure is definitively isolated to variablex_1.\n - **Step 3:** Repeat Step 2 systematically for each remaining variable from x_2throughthroughx_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 a∣Side| Sideb∣Side| Sidec | 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 > c,,a + c > b,,b + 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_6intoboundaryequalityinto boundary equalityD_6' = {\langle a, b, c \rangle \mid a = b + c}andstrictinequalityand strict inequalityD_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 (Xoror-):** 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 nbinaryconditions,thisisbinary conditions, this is2^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 krulesconstructedoverrules constructed overnbinaryconditions,theresultingtestsuitecontainsatleastbinary conditions, the resulting test suite contains at leastktestcasesandatmosttest cases and at most2^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 a∣Side| Sideb∣Side| Sidec | 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_1:30−day,: 30-day,M_2:31−day,: 31-day,M_3:February),4dayclasses(: February), 4 day classes (D_1: 1..28,,D_2: 29,,D_3: 30,,D_4: 31),and3yearclasses(), and 3 year classes (Y_1: 1900,,Y_2:leapyear,: leap year,Y_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_1(30−day),(30-day),M_2(31−dayexceptDecember),(31-day except December),M_3(December),(December),M_4 (February).\n - Days: D_1 (1..27),,D_2 (28),,D_3 (29),,D_4 (30),,D_5 (31).\n - Years: Y_1(leapyear),(leap year),Y_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^nforforn$$ 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.