Unit testing is important but when aiming at the quality it's limited. An alternative is functional test coverage through test automation, which tracks whether tests execute important values corresponding to software features.
Code Coverage As Part Of Continuous Testing
Is your application developing unknown bugs with each sprint for unknown reasons? Not sure if your product is market-ready?
Implementing code coverage by means of unit tests have long been the answer to the above questions. This helped to avoid unknown bugs, but to an extent.
With the inception of agile methodologies, teams started working in small sprints. Automated testing became popular and unit tests were eventually pushed to the back seat. Today, we have tools that perform code coverage from automated functional tests, regressions suites, exploratory testing and even unit testing.
These tools provide a good overview of a continuously evolving code through tables and graphs in dashboards, hence providing a commendable release confidence. The tools perform both unit and automated functional testing coverage on app’s code. Comparison from both verticals is now possible which lets a tester analyze the production release.
A Second Thought On The Traditional Ways Of Code Coverage
New Trends In Code Coverage
As mentioned above, unit tests are limited when aiming at quality through code coverage. So, one must consider integration tests, acceptance tests and even manual tests as a criteria. This is now possible through SeaLights and even JaCoCo now offers the code coverage through functional tests.
SeaLights: This is a continuous testing platform. It integrates with the test environment and measures test coverage across all types of tests. SeaLights provides insights on the extent of the tests and the risk involved with untested code changes.
Features
- Code Coverage through automated functional tests and manual tests
- Test GAP Analytics
- Release Quality Analytics
- Quality Trends, Charts, and Dashboards to analyze results
- Integrates with Jenkins and Maven
Benefits
- Clear stats depicting what application code has been covered through QA automation
- QA can focus on automation areas which are untouched
- QA can see the result trends for existing code coverage
- Helps QA team to calculate functional test coverage
- Learn more
JaCoCo: JaCoCo is a code coverage tool that calculates coverage based on unit tests. It’s developed in Java language and provides support for Groovy as well. It provides good reports of code coverage metrices and calculates the percentage of code covered based on methods/branches/lines. JaCoCo adds the lines of code for coverage calculation in byte code of the Java class. When executed, it instruments the class files used in the test with the coverage information. This produces a jacoco.exec file which is then used to generate the code coverage report.
Features
- An open source tool
- Written in Java and works on covering methods, branches, and lines
- Can be executed and integrated with Ant, Maven, Jenkins, and TeamCity
- Provides report for last execution of tests
- Learn more
Tips To Implement Code Coverage