SlideShare a Scribd company logo
Unit Testing
What is Unit Testing ? Difference between Unit and System Testing.  How Developer will perform Unit Testing? Test Case Design Techniques Agenda
What is Unit Testing? A unit is the smallest testable part of an application. Unit testing refers to the practice of developers to test the Code.  Unit testing is a procedure used to validate that individual units of source code are working properly. The objective in unit testing is to isolate a unit and validate its correctness. Unit testing is typically done by the developers and not by end-users. Its also called a component level testing.
When Unit testing is performed. Requirement Phase / SRS / Prototype Designing Phase: HLD, LLD, Program Specification Coding / Creating Unit Test Cases UNIT TESTING The Unit Test Cases are created by the respective developers of the Module while performing the Unit Testing. The Tester can get the information either from all the documents or from any one document.
Hierarchy if Testing System Testing Integration Testing Functional Testing Unit Testing UAT (User Acceptance Testing)
Difference between Unit and System Testing. Unit Testing System Testing Unit testing is performed  Done by the Testers. by the developers.  Unit tests are required at    System tests are generally various sizes of Units under Test. tests of the system.    The goal of unit testing   The system tests are used  is to isolate each part of the     to verify that we deliver the  Program and show that the  correct functionality and we  Individual parts are correct.   would preferably model the    tests after the use-cases. It involves checking that each feature  System Testing is not about  specified in the "Component Design"  checking the individual parts has been implemented in the component. of the design, but about checking  the system as a whole.
Types of Unit Testing? Self Testing In Self Testing, Unit testing shall be performed by the developer for the module which he has developed. Peer testing In Peer Testing, Unit testing shall be performed by the peer developer for the module which other developers have developed. Positive Testing Test cases should be designed to show that the unit under test does what it is supposed to do. The test designer should walk through the relevant specifications; each test case should test one or more statements of specification.    Suitable techniques : Equivalence partitioning Negative Testing Existing test cases should be enhanced and further test cases should be designed to show that the software does not do anything that it is not specified to do. This step depends primarily upon error guessing, relying upon the experience of the test designer to anticipate problem areas. Suitable techniques : Boundary Value Analysis
Test Case Design Techniques Test case design techniques can be broadly split into two main  categories. Black box techniques use the interface to a unit and a description of functionality, but do not need to know how the inside of a unit is built. White box techniques make use of information about how the inside of a unit works. There are also some other techniques which do not fit into either of the above categories. Error guessing falls into this category. Black box (functional)  White box (structural)  Equivalence partitioning Path Coverage  Boundary value analysis   Data flow bases testing
Test Case Design Techniques.....Cont. Equivalence Class  Partitioning Input values to a program are partitioned into equivalence classes.  Generally adopt the following strategy: If the input is a range, define one valid and two invalid classes. If the input is a specific value, define one valid and two invalid cases. Two inputs are in the same Equivalence Class if they are handled similarly by system. eg. data field valid value in 1-50 So, 20, 38, 1, 47 belong to the same Equivalence Class. no need to test multiple values from same Equivalent Class. test valid and invalid equivalence classes.
Test Case Design Techniques…..Cont. If the input data to the program is specified by a range of values: e.g. numbers between 1 to 5000.  one valid and two invalid equivalence classes are defined.  1 5000 If input is an enumerated set of  values:  e.g. {a,b,c}, one equivalence class for valid input values  another equivalence class for invalid input values should be defined.  There are three equivalence classes:  the set of negative integers, set of integers in the range of 1 and 5000,  integers larger than 5000.  The test suite must include: representatives from each of the three equivalence classes: a possible test suite can be: {-5,500,5001}. 1 5000
Test Case Design Techniques….Cont. Boundary Testing : a black box testing technique special class of equivalence testing assumption is that the developers often fail to look at the boundaries of the equivalence classes. Boundary value analysis: select test cases at the boundaries of different equivalence classes.  In the Previous Example the Boundry Value Analysis will be : test cases must include the values: {0,1,5000,5001}. 1 5000
Best Practices  Thank you

More Related Content

PPTX
Equivalence class testing
PPTX
White box testing
PPT
Black box testing
PPTX
Test design techniques
PPTX
Black box testing or behavioral testing
PPTX
5 black box and grey box testing
PPTX
Black box software testing
DOC
Black box testing
Equivalence class testing
White box testing
Black box testing
Test design techniques
Black box testing or behavioral testing
5 black box and grey box testing
Black box software testing
Black box testing

What's hot (20)

PPT
Black box testing lecture 11
PPTX
Se (techniques for black box testing ppt)
PPTX
Test Case Design and Technique
PPTX
Test case techniques
PPTX
Blackbox
PPTX
Boundary value analysis and equivalence partitioning
PPTX
An Insight into the Black Box and White Box Software Testing
PPTX
Unit 2 - Test Case Design
PPT
Dynamic analysis in Software Testing
PDF
Black Box Testing
PPTX
Structural and functional testing
PPTX
Black Box Testing Techniques by Sampath M
PPTX
Software Testing Foundations Part 4 - Black Box Testing
PPS
Testing techniques
PPT
Black Box Testing
PPS
Test case design_the_basicsv0.4
PPTX
White box black box & gray box testing
PPTX
Sorfware engineering presentation (software testing)
PPT
12 functional-system-testing
PDF
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
Black box testing lecture 11
Se (techniques for black box testing ppt)
Test Case Design and Technique
Test case techniques
Blackbox
Boundary value analysis and equivalence partitioning
An Insight into the Black Box and White Box Software Testing
Unit 2 - Test Case Design
Dynamic analysis in Software Testing
Black Box Testing
Structural and functional testing
Black Box Testing Techniques by Sampath M
Software Testing Foundations Part 4 - Black Box Testing
Testing techniques
Black Box Testing
Test case design_the_basicsv0.4
White box black box & gray box testing
Sorfware engineering presentation (software testing)
12 functional-system-testing
Whitepaper Test Case Design and Testing Techniques- Factors to Consider
Ad

Similar to Unit testing (20)

PPT
<p>Software Testing</p>
PPT
An overview to Software Testing
PPT
Test Levels & Techniques
PPT
Defect Testing in Software Engineering SE20
PPTX
Software testing strategies
PPT
Types of Software Testing
PPS
Boundary and equivalnce systematic test design
PPT
Testing
DOCX
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
PPT
4.3_Unit Testing.ppt gfdfghhhhhhhhhhhhh
PPTX
Comprehensive Testing Strategies for Reliable and Quality Software Developmen...
PPTX
Software Testing strategies, their types and Levels
PPT
5.Black Box Testing and Levels of Testing.ppt
PPTX
Software Testing
PPTX
software testing types jxnvlbnLCBNFVjnl/fknblb
PPT
DOCX
Unit iii
PDF
black-box-1.pdf
PPS
Lesson 2....PPT 1
<p>Software Testing</p>
An overview to Software Testing
Test Levels & Techniques
Defect Testing in Software Engineering SE20
Software testing strategies
Types of Software Testing
Boundary and equivalnce systematic test design
Testing
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
4.3_Unit Testing.ppt gfdfghhhhhhhhhhhhh
Comprehensive Testing Strategies for Reliable and Quality Software Developmen...
Software Testing strategies, their types and Levels
5.Black Box Testing and Levels of Testing.ppt
Software Testing
software testing types jxnvlbnLCBNFVjnl/fknblb
Unit iii
black-box-1.pdf
Lesson 2....PPT 1
Ad

More from medsherb (11)

PDF
Unknown facts about sanitary pads
PPT
Qtp 9.2 examples
PPT
Severity & priority in software testing
PPT
Basic software-testing-concepts
PPT
Qtp with descriptive programming
PPT
Using correlation in loadrunner 80
PPT
Qtp 9.2 tutorials
PPT
Load runner 8.0
PPT
Loadrunner presentation
PPT
Testcase training
PPT
Qtp 8.0 basic
Unknown facts about sanitary pads
Qtp 9.2 examples
Severity & priority in software testing
Basic software-testing-concepts
Qtp with descriptive programming
Using correlation in loadrunner 80
Qtp 9.2 tutorials
Load runner 8.0
Loadrunner presentation
Testcase training
Qtp 8.0 basic

Recently uploaded (20)

PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Introduction-to-Social-Work-by-Leonora-Serafeca-De-Guzman-Group-2.pdf
PDF
Open folder Downloads.pdf yes yes ges yes
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Basic Mud Logging Guide for educational purpose
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Week 4 Term 3 Study Techniques revisited.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Introduction-to-Social-Work-by-Leonora-Serafeca-De-Guzman-Group-2.pdf
Open folder Downloads.pdf yes yes ges yes
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cardiovascular Pharmacology for pharmacy students.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPH.pptx obstetrics and gynecology in nursing
Basic Mud Logging Guide for educational purpose
STATICS OF THE RIGID BODIES Hibbelers.pdf
Insiders guide to clinical Medicine.pdf
O7-L3 Supply Chain Operations - ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
master seminar digital applications in india

Unit testing

  • 2. What is Unit Testing ? Difference between Unit and System Testing. How Developer will perform Unit Testing? Test Case Design Techniques Agenda
  • 3. What is Unit Testing? A unit is the smallest testable part of an application. Unit testing refers to the practice of developers to test the Code. Unit testing is a procedure used to validate that individual units of source code are working properly. The objective in unit testing is to isolate a unit and validate its correctness. Unit testing is typically done by the developers and not by end-users. Its also called a component level testing.
  • 4. When Unit testing is performed. Requirement Phase / SRS / Prototype Designing Phase: HLD, LLD, Program Specification Coding / Creating Unit Test Cases UNIT TESTING The Unit Test Cases are created by the respective developers of the Module while performing the Unit Testing. The Tester can get the information either from all the documents or from any one document.
  • 5. Hierarchy if Testing System Testing Integration Testing Functional Testing Unit Testing UAT (User Acceptance Testing)
  • 6. Difference between Unit and System Testing. Unit Testing System Testing Unit testing is performed Done by the Testers. by the developers. Unit tests are required at System tests are generally various sizes of Units under Test. tests of the system. The goal of unit testing The system tests are used is to isolate each part of the to verify that we deliver the Program and show that the correct functionality and we Individual parts are correct. would preferably model the tests after the use-cases. It involves checking that each feature System Testing is not about specified in the "Component Design" checking the individual parts has been implemented in the component. of the design, but about checking the system as a whole.
  • 7. Types of Unit Testing? Self Testing In Self Testing, Unit testing shall be performed by the developer for the module which he has developed. Peer testing In Peer Testing, Unit testing shall be performed by the peer developer for the module which other developers have developed. Positive Testing Test cases should be designed to show that the unit under test does what it is supposed to do. The test designer should walk through the relevant specifications; each test case should test one or more statements of specification. Suitable techniques : Equivalence partitioning Negative Testing Existing test cases should be enhanced and further test cases should be designed to show that the software does not do anything that it is not specified to do. This step depends primarily upon error guessing, relying upon the experience of the test designer to anticipate problem areas. Suitable techniques : Boundary Value Analysis
  • 8. Test Case Design Techniques Test case design techniques can be broadly split into two main categories. Black box techniques use the interface to a unit and a description of functionality, but do not need to know how the inside of a unit is built. White box techniques make use of information about how the inside of a unit works. There are also some other techniques which do not fit into either of the above categories. Error guessing falls into this category. Black box (functional) White box (structural) Equivalence partitioning Path Coverage Boundary value analysis Data flow bases testing
  • 9. Test Case Design Techniques.....Cont. Equivalence Class Partitioning Input values to a program are partitioned into equivalence classes. Generally adopt the following strategy: If the input is a range, define one valid and two invalid classes. If the input is a specific value, define one valid and two invalid cases. Two inputs are in the same Equivalence Class if they are handled similarly by system. eg. data field valid value in 1-50 So, 20, 38, 1, 47 belong to the same Equivalence Class. no need to test multiple values from same Equivalent Class. test valid and invalid equivalence classes.
  • 10. Test Case Design Techniques…..Cont. If the input data to the program is specified by a range of values: e.g. numbers between 1 to 5000. one valid and two invalid equivalence classes are defined. 1 5000 If input is an enumerated set of values: e.g. {a,b,c}, one equivalence class for valid input values another equivalence class for invalid input values should be defined. There are three equivalence classes: the set of negative integers, set of integers in the range of 1 and 5000, integers larger than 5000. The test suite must include: representatives from each of the three equivalence classes: a possible test suite can be: {-5,500,5001}. 1 5000
  • 11. Test Case Design Techniques….Cont. Boundary Testing : a black box testing technique special class of equivalence testing assumption is that the developers often fail to look at the boundaries of the equivalence classes. Boundary value analysis: select test cases at the boundaries of different equivalence classes. In the Previous Example the Boundry Value Analysis will be : test cases must include the values: {0,1,5000,5001}. 1 5000
  • 12. Best Practices Thank you