Unit Tests are conducted by developers and test the unit of code( aka module, component) he or she developed. It is a testing method by which individual units of source code are tested to determine if they are ready to use. It helps to reduce the cost of bug fixes since the bugs are identified during the early phases of development life cycle.
Integration testing is executed by testers and tests integration between software modules. It is a software testing technique where individual units of a program are combined and tested as a group. Test stubs and test drivers are used to assist in Integration Testing. Integration test is performed in two way, they are bottom-up method and the top-down method.
Below is a detailed comparison between the two-
The idea behind unit testing is to test each part of the program and show that the individual parts are correct.
The idea behind Integration testing is to combine modules in the application and test as a group to see that they are working fine
It is kind of White Box Testing
It is kind of both Black Box Testing both
It can be performed at any time
It usually carried out after Unit Testing and before System Testing
Unit testing tests only the functionality of the units themselves and may not catch integration errors, or other system-wide issues
Integrating testing may detect errors when modules are integrated to build the overall system
It starts from the module specification
It starts from the interface specification
It pays attention to the behavior of single modules
It pays attention to integration among modules
Unit test does not verify whether your code works with external dependencies correctly.
Integration tests verifies that your code works with external dependencies correctly.