top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between a unit test and a functional/integration test?

+3 votes
437 views
What is the difference between a unit test and a functional/integration test?
posted Aug 12, 2015 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When a module is developed by developer and it is tested for functionality then it is known as Unit testing. Once all modules are developed and integrated with other modules then Integration testing is to be carried out to discover the issues arise when different modules are interacting with each other to build overall system.

Now lets see each one in more detail

Unit Tests
These tests the smallest unit of functionality, typically a method/function and focussed on one particular feature (e.g., calling the pop method when the stack is empty should throw an InvalidOperationException). Or in short, unit tests are as simple as possible, easy to debug, reliable (due to reduced external factors), fast to execute and help to prove that the smallest building blocks of your program function as intended before they're put together.

Integration Tests
Integration tests build on unit tests by combining the units of code and testing that the resulting combination functions correctly. This can be either the innards of one system, or combining multiple systems together to do something useful. Also, another thing that differentiates integration tests from unit tests is the environment. Integration tests can and will use the different environment changes will work correctly. The main advantage is that it will find bugs that unit tests can't such as integration bugs between two module and environment bugs etc.

Functional Tests
Functional tests check a particular feature for correctness by comparing the results for a given input against the specification. Functional tests don't concern themselves with intermediate results or side-effects, just the result (they don't care that after doing x, object y has state z). They are written to test part of the specification such as, "calling function Square(x) with the argument of 2 returns 4".

answer Aug 12, 2015 by Varuna Magar
...