2

I have used JaCoco for line coverage in a previous project. Although line coverage in IClassCoverage just gives you a ICounter which has only the counts just like the branch coverage, IClassCoverage inherits ISourceNode which has information for each line, which makes the line coverage a bit of special among the others. So the only way I can think of to match the branches in JaCoco is tampering the JaCoco instrumentation procedure which I think is over-killing. I'd rather use Wala to get the control flow graph and match the line coverage from JaCoco. Is there any tool that can tell me about the exact branches?

  • OK, we're going to repeat the vocabulary discussion we had at SO. (You're making a mistake of not being careful about the rules for good questions). What exactly are you looking for? You need to provide a concrete example. – Ira Baxter Mar 21 '16 at 18:49
  • @IraBaxter Plz give me paper/book references to all YOUR literature so that I could tell you what I need in your words. Otherwise it would be endless. – huoenter Mar 21 '16 at 18:58
  • Let's start with this page for basic vocabulary, and hope your request is one defined there: en.wikipedia.org/wiki/Code_coverage If not, I'll get out a bigger reference. A concrete example would still be helpful. – Ira Baxter Mar 21 '16 at 22:07
  • @IraBaxter "Branch coverage - Has each branch (also called DD-path) of each control structure (such as in if and case statements) been executed?" Okay, so my question is: Is there any tool that can not only tell you whether each branch has been executed but also which branches have been executed? – huoenter Mar 21 '16 at 22:19
  • @IraBaxter I have to assume you really really want to give me an answer but just really really don't think my question is clear enough. If not, I don't think you have to worry about other viewers. – huoenter Mar 21 '16 at 22:22
0

If a tool knows whether a specific branch has been executed, it knows the set of all branches that have been executed, trivially by enumerating every branch and asking if it has been executed.

Here is a tool (from my company) that knows exactly what branches have been covered; there's even a tab to select exactly that list.

http://semanticdesigns.com/Products/TestCoverage/JavaTestCoverage.html

It can also produce a list of covered branches, and the associated line numbers for each covered branch.

  • Thanks. Really appreciate it. – huoenter Mar 22 '16 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.