This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Software Testing, Quality Assurance & Maintenance (ECE453/CS447/SE465): Assignment 1 Solutions Patrick Lam Ive excluded solutions for questions 2, 3 and 7. Ill try to make them available later, but they wont help you with midterm preparation anyway. The CFG in this version has been slightly corrected; thanks to Daqiang Mo for pointing out an error. Question 1 (5 points) (Section 1.3, Q1): Suppose that coverage criterion C 1 subsumes coverage criterion C 2 . Also suppose that test set T 1 satisfies C 1 on program P and test set T 2 satisfies C 2 , also on P . (5 points) If P contains a fault, and T 2 reveals the fault, T 1 does not necessarily also reveal the fault. Explain. Recall that when a test suite satisfies a coverage criterion, it must address each test requirement generated by the coverage criterion. Lets say that criterion C 2 contains test requirements A , B and C . Test set T 2 satisfies C 2 and also accidentally meets test requirement Z . Criterion C 1 must contain test requirements A , B , C , and perhaps also D , but nothing requires C 1 to contain Z . If Z contains the fault, then T 1 might or might not reveal the fault; both C 1 and C 2 are silent about Z . Question 4 (5 points) (Section 2.3, Q4) Consider the pattern matching example in Figure 2.21. In particular, consider the final table of tests in Section 2.3. Consider the 1 variable iSub . Number the (unique) test cases, starting at 1, from the top of the iSub part of the table. For example, ( ab,c, 1) , which appears twice in the iSub portion of the table, should be labelled test t 4 . Give a minimal test set that satisfies all defs coverage. Give a minimal test set that satisfies all uses coverage. Give a minimal test set that satisfies all dupaths coverage. Note that Table 1 by itself is insufficient for answering this question; you need to combine Table 1 and Table 2. Recall that the textbook puts uses for conditionals on both branches; I like to put the use at the branch point, so either convention is OK, as long as youre consistent. (A couple of you onlyeither convention is OK, as long as youre consistent....
View
Full
Document
This note was uploaded on 03/19/2010 for the course CS 447 taught by Professor Lam during the Winter '10 term at Waterloo.
 Winter '10
 Lam

Click to edit the document details