1.38k likes | 1.58k Views
Black-Box Testing Techniques III. Software Testing and Verification Lecture 6. Prepared by Stephen M. Thebaut, Ph.D. University of Florida. Black-Box Test Case Design Techniques Considered. Partition testing Combinatorial Approaches Boundary Value Analysis Intuition & Experience.
E N D
Black-Box Testing Techniques III Software Testing and Verification Lecture 6 Prepared by Stephen M. Thebaut, Ph.D. University of Florida
Black-Box Test Case Design Techniques Considered • Partition testing • Combinatorial Approaches • Boundary Value Analysis • Intuition & Experience
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
What are the “Effects”? The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
What are the “Effects”? The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
What are the “Causes”? The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
What are the “Causes”? The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Causes and Effects Causes:Effects: (1) 2 no. chars 8 (31) store in table A (2) 1stchar is letter (32) store in table B (3) 1stchar is $ (33) output msg J11 (4) other charsonly letters/digits (34) output msg J12 only (35) output msgs J11 and J12
Boolean Graphs [2,8] let $ (1) (2) (3) (4) (31) (32) −> A −> B E others let/dig
Boolean Graphs [2,8] let $ (1) (2) (3) (4) (31) (32) −> A −> B E others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (31) (32) −> A −> B E others let/dig
Boolean Graphs [2,8] let $ (1) (2) (3) (4) (31) (32) −> A −> B E others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (31) (32) −> A −> B E Л others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (31) (32) −> A −> B E Л others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (33) (34) (35) J11 only J12 only J11 & J12 E others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (33) (34) (35) J11 only J12 only J11 & J12 E others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Another Cause-Effect Example: Symbol Table Storage Specification The conditions for storing an identifier in one of two symbol tables are: (a) must be from 2 to 8 characters in length; (b) first character must be a letter or “$”; (c) other characters must be a letter or digit. If the first character is a letter, the identifier will be stored in symbol table A. If the first character is “$”, it will be stored in symbol table B. If the first character is neither a letter nor “$”, or if condition (c) is not satisfied, error message J11 is output. If condition (a) is not satisfied, error message J12 is output.
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л E (A) V (B) others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л Л E (A) V (B) others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л Л E (A) V (B) others let/dig
Boolean Graphs (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л Л E (A) V (B) Л others let/dig
A Variation on Test Case Selection Strategy #3 • Test case selection “Strategy #3” considers ALLfeasible combinations of connected Cause values that result in each Effect being True. • For complex specifications, this can be impractical. • We now consider a variation on this strategy which “culls” all but the combinations “of greatest interest”.
A Variation on Test Case Selection Strategy #3 • Test case selection “Strategy #3” considers ALLfeasible combinations of connected Cause values that result in each Effect being True. • For complex specifications, this can be impractical. • We now consider a variation on this strategy which “culls” all but the combinations “of greatest interest”.
A Variation on Test Case Selection Strategy #3 • Test case selection “Strategy #3” considers ALLfeasible combinations of connected Cause values that result in each Effect being True. • For complex specifications, this can be impractical. • We now consider a variation on this strategy which “culls” all but the combinations “of greatest interest”.
Test Case Selection Strategy #3 Plus “Culling Rules” REPEAT Select the next (initially, the first) Effect. Tracing back through the graph (right to left), find all feasible combinations of connected Cause values that result in the Effect being True, subject to the following culling rules: • When encountering an nth-degree OR-node that must be True, consideronly those n combinations for which exactly one incoming edge is True.
Test Case Selection Strategy #3 Plus “Culling Rules” REPEAT Select the next (initially, the first) Effect. Tracing back through the graph (right to left), find all feasible combinations of connected Cause values that result in the Effect being True, subject to the following culling rules: • When encountering an nth-degree OR-node that must be True, consideronly those n combinations for which exactly one incoming edge is True.
Test Case Selection Strategy #3 Plus “Culling Rules” (cont’d) • When encountering an nth-degree AND-node that must be False, consider only those n combinations for which exactly one incoming edge is False. For each new such combination found: Determine values of all other Effects, and Enter values for each Cause and Effect in a new column of the test case coverage matrix. UNTIL each Effect has been selected.
Test Case Selection Strategy #3 Plus “Culling Rules” (cont’d) • When encountering an nth-degree AND-node that must be False, consider only those n combinations for which exactly one incoming edge is False. For each new such combination found: Determine values of all other Effects, and Enter values for each Cause and Effect in a new column of the test case coverage matrix. UNTIL each Effect has been selected.
Rationale for these Culling Rules? • Number of combinations decreases by a factor of O(2) to O(n) at each true OR node and each false AND node. • Idea: cover only the minimally sufficient conditions for the desired result. n ( ( V Л T F
Applying Strategy #3 Plus Culling Rules [2,8] let $ (1) (2) (3) (4) Л (31) (32) −> A −> B E Л others let/dig
Applying Strategy #3 Plus Culling Rules [2,8] let $ (1) (2) (3) (4) Л (31) (32) −> A −> B E Л others let/dig
Applying Strategy #3 Plus Culling Rules (cont’d) [2,8] let $ (1) (2) (3) (4) Л (31) (32) −> A −> B E Л others let/dig
Applying Strategy #3 Plus Culling Rules (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л Л E (A) V (B) Л others let/dig
Applying Strategy #3 Plus Culling Rules (cont’d) (33) 1, B
Applying Strategy #3 Plus Culling Rules (cont’d) [2,8] let $ (1) (2) (3) (4) Л (33) (34) (35) J11 only J12 only J11 & J12 Л Л E (A) V (B) Л others let/dig