Unformatted text preview:

Page 1 of 7 CEN 6070 Software Quality Assurance and Testing Summer 2004 Exam 1 - Solutions Answer all questions on the exam sheets. Use backs of pages as needed Name: Solutions First Part. Questions from the Galin Text. (5 points each) I. a. Galin states the SQA environment has five different characteristics. One is required teamwork. List and briefly describe three others. Pages 7-8: Contractual conditions, Subjection to customer-supplier relationship, required teamwork, cooperation and coordination with other software teams, and interfaces with other software systems. b. Briefly discuss the difference between quality control and quality assurance. Pages 28-29: Quality control is a set of activities designed to evaluate the quality of a developed or manufactured product. The main objective of quality assurance is to minimize the cost of guaranteeing quality by a variety of activities performed throughout the development and manufacturing processes/stages. c. McCall’s factor model classifies all software requirements into 11 software quality factors. The eleven factors a re grouped into three categories – product operation, product revision, and product transition. One factor in each category is: i. Product operation factors: Correctness, reliability, efficiency, integrity, usability. ii. Product revision factors: Maintainability, flexibility, testability. iii. Product transition factors: Portability, reusability, interoperability. List at least one other factor in each of the three categories. (see above) Pages 37-38.Page 2 of 7 d. Galin lists six management responsibilities in SQA. One is definition of the quality policy. List three others. Pages 70-71. Effective follow-up of quality policy implementation Allocation of sufficient resources to implement quality policy Assignment of adequate staff Follow-up of compliance of quality assurance procedures Solutions of schedule, budget, and customer relations difficulties e. Galin lists four factors important in deciding the extent of contract review efforts. One is Degree of staff acquaintance with experience in the project area. List at least one more. Pages 82-83. Project magnitude; Project technical complexity; Project organizational complexity. Second Part– Questions from the Lectures and Notes I. From Mr. Greg Jackson’s lecture (2 points each). One correct answer for each question. 1. What problems result from printing test results to the standard output stream? a. Does not test the methods API. b. Requires human judgment to analyze results. c. Scroll blindness. d. B and C e. All of the above. 2. What is a JUnit test fixture? a. The resources, primitive variables, and objects required to run a test. b. A collection of related test cases. c. A method to release resources that were part of a test case. d. A and B e. All of the above. 3. What calls the JUnit TestCase setUp() method? a. Each test method explicitly calls setUp(). b. The JUnit framework calls setUp() prior to each test method. c. The test fixture calls the setUp() method. d. The TestSuite calls the setUp() method once for each TestCase. e. None of the above. 4. The JUnit TestCase assertEquals(String expected, String actual) method: a. Tests that the value of expected equals the value of actual. b. Tests that the Object expected is the same Object as the actual Object. c. Only displays a message on the JUnit console when the assert passes. d. Displays a message on the JUnit console when the assert passes or fails. e. B and D.Page 3 of 7 5. When a JUnit TestCase requires data to be initialized in a database prior to running a test; the following is true: a. The data can be initialized in the TestCase setUp() method. b. The database should be returned to its original state by using the TestCase setUp() method. c. A JUnit TestDecorator can be used to initialize the data. d. A and C. e. All of the above. II. Using mathematical induction prove 1 + 3 + 5 +…+ (2n-1) = n2, n>=1. (10 points) i) n=1; [(2(1)-1] = 2 – 1 = 1 = 12 = 1 ii). Assume 1 + 3 + 5 +…+ (2n-1) = n2; Show 1 + 3 + 5 +…+ (2n-1) + [2(n + 1) – 1] = (n + 1)2 1 + 3 + 5 +…+ (2n-1) + [2(n + 1) – 1] = n2 + [2(n + 1) – 1] by the Inductive Hypothesis = n2 + 2n + 1 = (n + 1)2 III. In class, we considered the informal specification “Consider a search function that accepts an array of integers and some integer key of its parameters. The array members are sorted in increasing order. The function returns the array index of the member of the array whose value is equal to that of the key. The original input is unchanged. If the key is not matched, return an array index that is one number larger than the array's maximum index.” The formal specification below seems to adequately capture the intended computation. function Search (X: INTEGER-ARRAY; Key: INTEGER) return INTEGER; Pre: exists i in X'FIRST...X'LAST:X(i)=Key and for-all i,j in X'FIRST...X'LAST: i<j implies X(i)<=X(j) Post: X''(Search (X, Key))=Key and X=X'' Error: Search (X, Key)=X'LAST + 1Page 4 of 7 Using a similar approach, construct a formal specification for the informal specification: “Consider a function that accepts an array of integers and determines if the numbers are all unique (no two or more have the same value). If they are unique, the function returns the value Boolean TRUE. Otherwise, it returns the Boolean value FALSE. The array is not altered”. (10 points) function Are-They-Equal (X: INTEGER-ARRAY); return BOOLEAN; Pre: for-all i,j in X'FIRST...X'LAST: X(i)=X(j) implies i= j; Post: Are-They-Equal (X)) = True and X=X'' Error: Are-They-Equal (X) =FalsePage 5 of 7 IV. Consider the following program flow graph G. 1. Calculate V(G) (cyclomatic number) three equivalent ways. Show all calculations and formulae. (5 points) • V(G) = # Regions = 5 • V(G) = E – N +2 = 12 – 9 + 2 = 5 • V(G) = P + 1 = 4 + 1 = 5 (counts nodes 1, 2, 4, and 5) 2. Discover a set of independent paths, with number of members <= V(G), that covers the flow graph (i.e., covers each edge at least once). Use the notation form 1-2-5-6 to indicate a path. (5 points) 1-2-6-7-1 1-2-5-7 1-2-5-9 1-3-4-9 1-3-4-8-1 1 3 2 5 6 4 8 9 R4 R3 R2 R5 7 R1Page 6 of 7 3. Can any nodes in G be combined without affecting V(G)? If so, which ones? (5 points) Nodes 3 and 4 clearly can be combined. Nodes


View Full Document

UNF CEN 6070 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?