Header Ads Widget

Unit Testing

Unit Testing:

  • Unit testing is the first level of testing done before integration testing.
  • It is a WhiteBox testing technique that is usually performed by the developer.
  • It is defined as a type of software testing where individual units or components of a software are tested
  • Though, in a practical world due to time crunch or reluctance of developers to test, QA engineers also do unit testing.
  • Unit Testing is important because software developers sometimes try saving time doing minimal unit testing and this is a myth because inappropriate unit testing leads to high cost Defect fixing during System TestingIntegration Testing and even Beta Testing after application is built.
  • If proper unit testing is done in early development, then it saves time and money in the end.

Myths about Unit Testing:

Truth is Unit testing increases the speed of development.Programmers think that Integration Testing will catch all errors and not execute the unit test. Once units are integrated, very simple errors which could have very easily found and fixed in unit tested take a very long time to be traced and fixed

Advantages:

  • Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly (i.e. Regression testing). 
  • The procedure is to write test cases for all functions and methods so that whenever a change causes a fault, it can be quickly identified and fixed.

Disadvantages:

  • Unit testing by its very nature focuses on a unit of code. Hence it can't catch integration errors or broad system level errors

Post a Comment

0 Comments