With increasing number of tests, their execution time increases as well. Currently, various tools provide metrics of test code coverage. These metrics however do not help identify duplicate test coverage, that leads only to unnecessary increase of test execution time without any benefit to effective code coverage. Information about duplicate coverage and execution time of duplicate tests would be a valuable help for subsequent refactoring of test code base.
JaCoCo is very useful tool and with this new functionality we can provide more helpful information about the test coverage.
Possible solution:
Extend the data file format to include data about
Caller (test invoking the piece of code e.g.: line, branch, method, class,…)
Time spent in the piece of code
Enhance the code coverage tool to store information described in point 1
Enhance the tool’s reporting capabilities to present information about
Duplicate code coverage
Time spent in running tests
I have no problem to discuss about better solutions.
What I want to do:
I want to implement solution and write a bachelor thesis at my university (Faculty of Informatics, Masaryk University, Brno, Czech Republic) about this.
Expected result:
Functional solution and report capability to present information.
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/cdd5ecf2-a2b8-4488-8e13-4b3928fb0a6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ciao Jakub,
> If JaCoCo sees only Java classes, then JaCoCo only know, that these classes were triggered, but nothing more, right?
JaCoCo only see classes which have been loaded during execution. For each class probes are inserted to record which instructions and branches have been executed at least once. Our documentation gives an overview of the implementation strategies:
http://www.jacoco.org/jacoco/trunk/doc/implementation.html
http://www.jacoco.org/jacoco/trunk/doc/flow.html
Regards,
-marc
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/84599461-0ea2-428c-80b1-f6b218ef30ed%40googlegroups.com.
Hello Marc,
First, I want to apology for a delay of my response.
I started discussion about how to detect test duplication by using of JaCoCo. Maybe I didn’t describe this functionality well. The goal is to extend coverage report by source calls.
I see there two major benefits. With this new functionality we will be able to know from where was covered code called (from which tests) and we could find duplicated test scenarios easier, it can be used for pruning duplicate tests and by that, decreasing test execution time of any project using JaCoCo.
I prepared a simple demo of how to get source code call in JaCoCo run. https://github.com/jakubschwan/jacoco-demo
I know that this new feature changes JaCoCo functionality and it should be by default not activated. So this new functionality will be added as extension of JaCoCo and can be turned on and off by a system property. That means that by default JaCoCo will have the same behaviour as before.
Next steps
I will start working on changes in API based on the demo and implementing the functionality afterwards. To avoid introducing new bugs, every pull request will contain tests.
As this enhancement, when turned on, may have impact on performance, I will provide performance comparison of JaCoCo runtime before changes, after changes and after changes with functionality turn on.
Do you agree with this plan? If you have any concerns please let me know.
Best regards
Jakub Schwan
Hi Jakub,
I'm curious to see your solution or a description of the aproach.
Regards,
-marc
Hello Marc,
Here is my description of the approach.
Add the option to choose a mode of JaCoCo run. This option could be handled by a system property named e.g. org.jacoco.source.detection.enabled with possible values true or false configured in the maven pom file. Default value should be false and JaCoCo execution will be the same as before.
Identify test calling source code.
We can get this data from actual stack trace when code was visited in a coverage counters spots (places analyzed by JaCoCo). An extension of the ClassProbeAdapter and changes in org.jacoco.core.internal are needed.
Verify new functionality for all analytical methods.
Data storing
Implementation of storing extension in package org.jacoco.data.core. We need to store data about from where was code called. Saving should be fast and duplicities of calls should be ignored.
Display data
Extend actual report with data about source calling (changes in org.jacoco.report package),
Data merge - in the jacoco report we can see coverage from package to code. For a package it would be nice to display all tests. So I would like to show what tests cover each particular package.
Best regards
JakubHi Jakub,
We can get this data from actual stack trace when code was visited in a coverage counters spots (places analyzed by JaCoCo). An extension of the ClassProbeAdapter and changes in org.jacoco.core.internal are needed.
I don't think this is the correct place: ClassProbeAdapter is used at the time of instrumentation or analysis. It is not invoked at execution time (only indirectly when using on-the-fly-instrumentation and classes are loaded the first time).
Execution is recorded by bytecode probes inserted by the instrumentation process, please see http://www.jacoco.org/jacoco/trunk/doc/flow.html
Regards,
-marc
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/77d84d54-62ef-45df-94d1-ffff057f033c%40googlegroups.com.