Toad World® Forums

Do we need to check "gather code coverage data" For each test case in test suite?

Hi all
I had one query. Do we need to check the "gather code coverage data" Checkbox for each test case in our suite before running the suite?

I had 3 test cases in my suite. Of which only one had the checkbox marked. And other 2 did not.

Initially coverage for one case was 5 percent. And when we added the other 2 cases without marking "gather code coverage". The coverafe reduced to 1 percent.
Does it impact the code coverage data if we not mark the checkbox?
Please help.

I think that unchecking options is not the case. Code Coverage is mainly affected by the source code formatting. If you have less lines of code, you have a greater chance to have covered code.

I guess that you had some changes in your program source code and that was the cause of reduced Code Coverage. Still, I may be wrong. In that case, you can try to create the test case in a new test definition and compare the coverage results.

It is possible that you check the gathering option at the Unit Test level. That should gather Code Coverage for all test cases in the unit test.

Best regards,