Unit Testing | Software Testing

Prerequisite – Types of Software Testing
Unit Testing is a software testing technique by means of which individual units of software i.e. group of computer program modules, usage procedures and operating procedures are tested to determine whether they are suitable for use or not. It is a testing method using which every independent modules are tested to determine if there are any issue by the developer himself. It is correlated with functional correctness of the independent modules.

Unit Testing is defined as a type of software testing where individual components of a software are tested.
Unit Testing of software product is carried out during the development of an application. An individual component may be either an individual function or a procedure. Unit Testing is typically performed by the developer.

In SDLC or V Model, Unit testing is first level of testing done before integration testing. Unit testing is such type of testing technique that is usually performed by the developers. Although due to reluctance of developers to tests, quality assurance engineers also do unit testing.



Objective of Unit Testing:
The objective of Unit Testing is:

  1. To isolate a section of code.
  2. To verify the correctness of code.
  3. To test every function and procedure.
  4. To fix bug early in development cycle and to save costs.
  5. To help the developers to understand the code base and enable them to make changes quickly.
  6. To help for code reuse.

Types of Unit Testing:
There are 2 type of Unit Testing: Manual, and Automated.

Workflow of Unit Testing:

Unit Testing Tools:
Here are some commonly used Unit Testing tools:
1. Jtest
2. Junit
3. NUnit
4. EMMA
5. PHPUnit

Advantages of Unit Testing:

  • Unit Testing allows developers to learn what functionality is provided by a unit and how to use it to gain a basic understanding of the unit API.
  • Unit testing allows the programmer to refine code and make sure the module works properly.
  • Unit testing enables to test parts of the project without waiting for others to be completed.


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.