Presentation is loading. Please wait.

Presentation is loading. Please wait.

WHY BOTHER TO UNIT TEST Suprinder Pujji. OVERVIEW What is Unit testing Emphasis of Unit testing Benefits of Unit Testing Popular Misconceptions Prevailing.

Similar presentations


Presentation on theme: "WHY BOTHER TO UNIT TEST Suprinder Pujji. OVERVIEW What is Unit testing Emphasis of Unit testing Benefits of Unit Testing Popular Misconceptions Prevailing."— Presentation transcript:

1 WHY BOTHER TO UNIT TEST Suprinder Pujji

2 OVERVIEW What is Unit testing Emphasis of Unit testing Benefits of Unit Testing Popular Misconceptions Prevailing Who Should Unit Test A Case Study Conclusion

3 WHAT IS UNIT TESTING Lowest level of testing performed - Individual units of software are tested – Example - –Function or subroutine in structured Programming Language –Class in an object oriented language –Menu or display in a 4GL

4 EMPHASIS OF UNIT TESTING Have to be repeated - All tests have to be maintained –

5 BENEFITS OF UNIT TESTING Test parts of a project without waiting for the other parts to be available, Achieve parallelism in testing Able to detect and remove defects at a much less cost compared to other later stages of testing, Simplifies debugging Tests internal conditions that are not easily reached by external inputs

6 Popular Misconceptions Prevailing It consumes too much time Integration Tests will catch all the Bugs Anyway I’m too good a Programmer to Need Unit tests It only proves that the code does what the code does It is not Cost Effective

7

8 Who Should do it Unit Testing focuses on implementation Should be done by Test designers Test Designers should know the System requirements and design thoroughly. Test Designer should be more experienced Should be independent

9 WORK FLOW USING TEST CASES

10 CASE STUDY Analysis of the Integration Testing and System Testing bugs was done Found that about 30 % of bugs caught in the final stages could have been caught in the early stages it self.

11 CASE STUDY Adopted concept of Static Analysis on unit test cases 15 % reduction in the number of bugs escaping to the final stages of software development.

12 CASE STUDY Logical errors contributed to only 8 %. Found that % of logical defects caught in the static analysis phase increased to about 13 %.

13 CASE STUDY Without Using Unit Test Cases

14 CASE STUDY With Unit Test Cases

15 QUESTIONS FOR EVALUATING THE UNIT TESTING FOR ADEQUACY Have all the statements been exercised by at least one test Has each conditional statement been exercised at least once each way by the tests Have all boundary cases been exercised

16 QUESTIONS FOR EVALUATING THE UNIT TESTING FOR ADEQUACY Were any design assumptions made about the operation of this unit? Have the tests demonstrated these assumptions Have the tests exercised the unit over the full range of operational conditions it is expected to address

17 CONCLUSION Unit testing can be very effective and affordable. It will result in reduction of total efforts while simultaneously increasing the quality of the product significantly also reducing in the long-term maintenance cost and the total life cycle cost.


Download ppt "WHY BOTHER TO UNIT TEST Suprinder Pujji. OVERVIEW What is Unit testing Emphasis of Unit testing Benefits of Unit Testing Popular Misconceptions Prevailing."

Similar presentations


Ads by Google