CS 3302 Summer, 1998 Assignment: 2 Percentage of Final grade: 5 percent. Due: By email Thursday, July 9th at beginning of class. This is an individual assignment. 1. Derive a set of black-box test cases for EACH of the following components: (a) A function that takes a line of text as input and counts the number of non-blank characters in the line. (b) A function that examines a line of text and replaces sequences of spaces with a single space. Each test case in your answer should consist of an input, the expected output for that input, and a phrase describing the equivalence class or boundary value that the test case represents. You may assume that the functions are written in a strongly-typed language and that their inputs are guaranteed to be strings of characters. For invalid input strings, make assumptions about what the function should do in those cases and base your test cases on those assumptions. 2. Suppose that the functions above are among a larger number of editing functions provided by a TextLine abstract data type that is about 1 KLOC (thousand lines of code) long. Two testers, A and B, working independently design and apply their test cases to the TextLine ADT. Tester A finds 10 faults in the ADT, and tester B finds 12. Seven of the identified faults are common to Tester A and B. (a) What is your best estimate of the number of faults remaining in the ADT? Explain any simplifying assumptions that you make to arrive at your estimate. (b) Would you be satisfied to release the code in its current state? Justify your answer. If you would not release the code yet, when would you? (c) Under what circumstances do you think it would be good professional practice to use metrics derived from the above data (e.g. defects per KLOC written or defects detected per person-day of testing) to assess the job performance of individual programmers and testers or of programming and testing teams? (d) Explain in no more than one paragraph what you would do if your project manager insisted that the ADT be included in the current software release once the known defects had been corrected. (You may assume that correcting the known defects did not result in any new ones.)