UNIT Testing VS Integration Testing

images

There seem to be lot of confusion around Unit Testing Vs Integration Testing. So I thought, I should be writing something about it, to clarify on it:

Unit Testing

The main purpose of unit testing is testing the smallest part of logical unit or behavior of the system. Logical unit can extend to single method to entire class or collaboration of multiple classes.

Integration Testing

the idea of integration testing is to test the larger piece of module to make sure that combination of all units works together, so Integration test identify the problem when units are combined.

Let me give you a simple example, which would be easier to related with above definitions:

Let’s say you want to test the calculator, so if you test sum, multiply, etc functions individually of it then we can call it Unit Testing and when you are try to combine different behavior of calculator where multiple classes are involved like adding and multiplying two numbers and subtracting with some other number called the Integration Testing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: