Code coverage – pitfalls

Problem Statement: Code coverage 100%. There are x number of bugs. What happened?

Code coverage 100% doesn’t mean that test coverage 100%.
Sample code

public int add(int a, int b)
{
   return a+b;
}

we can have simple unit test case and it can show 100% code coverage.
But it is not talking about business.
i.e It should support float, double and other data types.
Boundary checks..etc

We need to make sure that we have all unit test cases according to business requirements.
Code coverage 100%, doesn’t mean that code is bug free.
-o-

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