Importance of code coverage tool in automation
A code coverage tool is used to get a basic idea of coverage of application code by the regression test suite. When a complete test suite finishes it's execution, the integrated code coverage tool gives us a report of different types of code coverage e.g. line coverage , branch coverage and cyclomatic complexity .So first of all if we implement a code coverage tool in initial stage of developing automation suite we can get an idea of the covered code after implementing each feature or test.
The other advantage of code coverage tool is when there is a code refactoring in application and the entire application needs regressed our code coverage report can tell that if it has changed since the last run. Also if our code coverage is as per expectation and all the tests were passed in the regression run then we can be assured that there were no damage done by the code change and thus we can take a decision to deploy the changes to production with no risk.
Thus implementing a code coverage tool has great advantage and it provides us a way to determine in which area we need to create more tests to get improved code coverage .
Jacoco is a free code coverage library which is basically a java agent and easily integrated with a java project and it gives a very good report after completion of tests with coverage details of the application classes.
Hope you enjoyed this post. I will come up with more details on Jacoco library and it's implementation .
Happy learning.
No comments:
Post a Comment