After completing this unit, you should be able to: Introduce various testing techniques including black-box testing, white-box testing, unit testing, integration testing, and system testing; present and explain the value of inspections and code reviews; introduce techniques for developing effective and efficient test cases such as statement coverage, path coverage, and equivalence partitioning. | Testing and Debugging Testing Fundamentals Test as you develop Easier to find bugs early rather than later Prototyping helps identify problems early Categories of bugs software crashes or data corruption failure to meet or satisfy the specification poor or unacceptable performance hard or difficult to use Testing fundamentals Impossible to test a program completely Three distinct paths through the program If the loop executes 20 times, there are 320 different sequences of executions Reviews and inspections Inspections Formal process of reviewing code First employed by IBM in 1976 Early work showed that design and review inspections remove 60 percent of the bugs in a product Reviews and inspections Roles of participants Moderator Runs the inspection Ensure that the process moves along Referees the discussion Ensures action items done Inspector Someone other than author Some interest in the code Carefully review code before inspection meeting Author Minor role May answer questions about | Testing and Debugging Testing Fundamentals Test as you develop Easier to find bugs early rather than later Prototyping helps identify problems early Categories of bugs software crashes or data corruption failure to meet or satisfy the specification poor or unacceptable performance hard or difficult to use Testing fundamentals Impossible to test a program completely Three distinct paths through the program If the loop executes 20 times, there are 320 different sequences of executions Reviews and inspections Inspections Formal process of reviewing code First employed by IBM in 1976 Early work showed that design and review inspections remove 60 percent of the bugs in a product Reviews and inspections Roles of participants Moderator Runs the inspection Ensure that the process moves along Referees the discussion Ensures action items done Inspector Someone other than author Some interest in the code Carefully review code before inspection meeting Author Minor role May answer questions about code Reviews and inspections Roles of participants Scribe Record all errors detected Keep list of action items Reviews and inspections Inspection process Planning Code to review chosen Moderator assigns task Checklists created Moderator assigns a presenter (usually one of the inspectors) Overview Author describes high-level aspects of project that affected the design or code Sometimes skipped (if all participants are knowledgeable) Reviews and inspections Inspection process Preparation Working alone, each inspector reviews code noting problems or questions Shouldn’t take more than a couple of hours Inspection meeting Presenter walks through the code Problems are discussed Scribe records all errors and action items Errors are not fixed at this time Inspection report Moderator prepares a written report Black-box and white-box testing White-box testing indicates that we can “see” or examine the code as we develop test cases Block-box testing indicates that we cannot examine the code as .