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.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.