KarthigaGunasekaran1
8,083 views
12 slides
Jun 26, 2019
Slide 1 of 12
1
2
3
4
5
6
7
8
9
10
11
12
About This Presentation
Unit testing is often automated but it can also be done manually. Debugging is a process of line by line execution of the code/ script with the intent of finding errors/ fixing the defects.
Size: 84.34 KB
Language: en
Added: Jun 26, 2019
Slides: 12 pages
Slide Content
UNIT TESTING AND DEBUGGING K.Haripritha II- MSc (Info Tech) Nadar Saraswathi College o f Arts and Science. Theni
Static analysis is used to investigate the structural properties of source code. Dynamic test cases are used to investigate the behavior of source code by executing the program on the test data UNIT TESTING AND DEBUGGING
Unit testing comprises the set of tests performed by an individual programmer prior to integration of the unit into a larger system. The situation is illustrated as follows: Coding & debugging- > unit testing -> integration testing UNIT TESTING
A program unit is usually small enough that the programmer who developed it can test it in great detail, and certainly in greater detail than will be possible when the unit is integrated into an evolving software product. There are four categories of tests programmer : 1. Functional tests 2. Performance tests 3. Stress tests 4. Structure tests
FUNCTIONAL TEST: It cases involve exercising the code with nominal input values for which the expected results are known, as well as boundary values and special values. PERFORMANCE TEST: It determines the amount of execution time spent in various parts of the unit, program throughput, response time, and device utilization by the program unit.
STRESS TEST: It those tests designed to intentionally break the unit. A great deal can be learned about the strengths and limitations of a program by examining the manner in which a program unit breaks. STRUCTURE TEST: It concerned with exercising the internal logic of a program and traversing particular execution paths.
This can be seen by examining the program segment . N P 0 2 1 4 2 8 10 2048 P =2N+ 1
Debugging is the process of isolating and correcting the causes of known errors . Success at debugging requires highly developed problem-solving skills. Commonly used debugging methods include : induction, deduction, backtracking (BR073, MYE79).
Debugging by induction involves the following steps: 1. Collect the available information. 2. Look for patterns. 3. Form one or more hypotheses 4. Prove or disprove each hypothesis. 5. Implement the appropriate corrections 6. Verify the correction.
Debugging by deduction proceeds as follows: 1. List possible causes for the observed failure. 2. Use the available information to eliminate various hypotheses. 3. Elaborate the remaining hypotheses. 4. Prove or disprove each hypothesis. 5. Determine the appropriate corrections. 6. Verify the corrections.
Debugging by backtracking: It involves working backward in the source code from the point where the error was observed in an attempt to identify the exact point where the error occurred. Traditional debugging: This techniques utilize diagnostic output statements, snap-shot dumps, selective traces on data values and control flow, and instruction-dependent breakpoints. Modern debugging tools utilize assertion-controlled breakpoints and execution histories.