100 likes | 210 Views
Informatics 43 – May 29, 2014. Restatement of G oals for Testing. Want to verify software’s correctness Need to test Need to decide on test cases No set of test cases is sufficient
E N D
Restatement of Goals for Testing Want to verify software’s correctness Need to test Need to decide on test cases No set of test cases is sufficient What is a systematic approach to the selection of test cases that will lead to accurate, thorough, repeatable identification of bugs?
The Testing Process Model • Decide what to test. • Select a test case input. • Determine the expected output E. • Run the system with the test case input. • Capture the actual output A. • Compare E and A. • Different? Inform programmer. • Loop back to 1 or 2, if time permits.
Back to Black box test case selection • Equivalence Class Partitioning – a systematic approach. • Identify the set of all possible inputs (to what is being tested). • Identify a basis for subdividing the set of inputs. • size, order, structure • correctness • stated requirements • your smarts • Use this basis for dividing the set of all possible inputs into subsets (domain into subdomains). • From each subset/subdomain, select a representative.
Equivalence Class Partitioning?? What is being partitioned? The set of all inputs to whatever is being tested. What is a partition? A collection of parts, subsets, subdomains, classes. Can the partitions overlap? (Can one item be a member of more than one partition?) Some say, “no.” (See textbook, p. 206.) Informatics 43 says, “who cares?”
Equivalence Class Partitioning?? What is “equivalent”? From the textbook, p. 205: “Equivalence class partitioning is based on dividing the input into several classes that are deemed equivalent for the purposes of finding errors.” Does that mean that every member of the class will give an equivalent output? Does that mean that every member of the class will find (or not find) a bug?
Equivalence Class Partitioning?? ECP is based on an interesting idea: We don’t search for the best single test case. We search for the best collection of test cases. What makes a good test case? What makes a good collection of test cases?
Equivalence Class Partitioning?? From the textbook, p. 205, 206: “If a program fails for one member of the equivalence class, then we expect it to fail for all other members; conversely, if it is correct for one member of the class, we expect it to be correct for all members.”
Equivalence Class Partitioning?? From the textbook, p. 205, 206: “If a program fails for one member of the equivalence class, then we expect it to fail for all other members; conversely, if it is correct for one member of the class, we expect it to be correct for all members.”
Equivalence Class Partitioning and • your phone’s Contact’s “search” function. Identify the set of all possible inputs. Identify a basis for subdividing the set of inputs. Use this basis for dividing the set of all possible inputs into subsets (domain into subdomains). From each subset/subdomain, select a representative.