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-
Advertisement
Categories: Unit Testing
code coverage, Unit Testing



