Unit Testing With Example

What is Unit Testing ?
Unit Testing is a type of software testing in which we test the individual unit of software application .
unit testing is a level of software testing where development team test the each and every line of code by directly looking into the source code during the development of application .the main of doing the unit testing is to validate the each unit of the software application perform as designed ,here unit means smallest testable part of application it can be (individual function , method ,module , object or procedure ).

In software development model unit testing is first level of testing which perform before the integration testing . Unit testing is a white box testing technique that is performed by development team ,Software test engineers also do the unit testing .

"Unit Testing is defined as a type of software testing where individual components of a software are tested"

Level of testing :

Why we do unit testing ?
  • The main reason of doing unit testing is to find and fix the bugs in development cycle to save the cost and isolate each unit of the system to identify, analyze and fix the defects.
  • Unit testing helps to verify the correctness of the code .
  • Unit testing helps to test every function and procedure .
  • Unit test help for code reuse .
  • Unit testing  helps the developers to understand the code base and enables them to make changes quickly.
  • Unit testing helps to Improves design and allows better refactoring of code.
When to do unit testing ?
Generally unit testing is performed at the time of application development and it is first level of testing performed before the integration testing.

Who Perform unit testing ?
Generally Unit testing is perform by the development team , developer , it may also performed by independent testers .

How to do Unit testing ?
There are two way to do the unit testing in software engineering 
  • Manual
  • Automation
Tools for unit testing ?
There are several tools are available in market for unit testing , here some of most popular unit testing tools are listed 
  • JUnit
  • JTest
  • Nunit
  • EMMA
  • PHP Unit
Unit Testing Technique 
There are Five unit testing technique in software testing which are listed below
  • Statement Coverage
  • Decision Coverage
  • Branch Coverage
  • Condition Coverage
  • Finite State Machine Coverage
Advantage of Unit testing :





Post a Comment

0 Comments