Tagged Questions
0
votes
1answer
45 views
Code Coverage in Android - Java and native C/C++ [closed]
I've been tasked with a new assignment on the project I'm working on. We need functioning code coverage tools in Android - both for Java code, and for native C/C++ code. This seems like an area that ...
1
vote
1answer
51 views
Identify and count lines of Java code in JSPs to help drive unit testing
I'm trying to increase unit testing for a large code base that several different teams actively work on. Much of the code was inherited, and none of it had unit tests to begin with. Additionally, it ...
0
votes
1answer
47 views
Code Coverage Tool That Supports Annotation of JUnit Tests To Specify Which Method The UnitTest Covers
I'm looking for something like PHPUnit's "Specifying Covered Methods" for Java. That means a code coverage tool that comes with annotations for my JUnit tests so that I can specify which method is ...
2
votes
5answers
50 views
How to check code coverage with tests for methods with specified level of complexity in Java
I want to be able to check test coverage of those of my methods that have complexity above some given level.
Are there any plugins for Eclipse, Sonar, Hudson for that?
Thanks!
4
votes
0answers
105 views
Java code coverage tools which support source line exclusions [closed]
I currently use Clover to measure the code coverage of my Java code. One feature which I rely on is the ability to exclude arbitrary sections of code from coverage reports:
///CLOVER:OFF because this ...
0
votes
1answer
33 views
Where Sonar is storing test results?
I was working with Sonar and I was confused, when I've connected to Sonar DB. I was trying to find scan results (for example, code coverage or test success %) and I've failed with that. As my sonar ...
1
vote
0answers
51 views
Is there a tool to get the code coverage for each JUnit test of a project
Does anybody know a way to get a report of the code(java) covered by each JUnit test in a project (or a file) ?
I was interested in JaCoCo, but it does'nt deal with tests case by case.
If someone ...
0
votes
1answer
62 views
Merging jUnit coverage reports with EclEMMA plugin
I am measuring the code coverage in my project using the EclEmma plugin for Eclipse. This involves running the coverage for the whole project. But due to some dependency issues tests in some packages ...
0
votes
1answer
69 views
Clover 3.1.7 does not support java 7 diamond
My Clover instrumentation fails with the error:
> /path/to/MyClass.java:138:28:unexpected token: >
On the line:
return new HashSet<>();
This is despite executing clover ...
0
votes
2answers
84 views
Why code coverage is different when measured by eCobertura and EclEmma?
When using eCobertura and EclEmma resp. I found the code coverage come out as different in each case for the same project.
Interested to know why?
Emma stat
eCobertura stat
1
vote
0answers
109 views
Jenkins and JaCoCo with sbt
I have a project in Jenkins that I want to create a JaCoCo code coverage report.
If I run jacoco:test then jacoco:report locally it creates the correct files (.exec, .classes and sources) in ...
0
votes
0answers
64 views
NetBeans Java: run code coverage on single test?
I've got the default EMMA code coverage running in NetBeans and have modified the build target to also generate the HTML report but this only runs when I run the tests for the entire project, which is ...
1
vote
1answer
63 views
Method coverage in an android application without source code
Can someone give me an ide about method coverage in android apks without having the source code?
I heard that there is an android specific version of emma project that can give method coverage ...
0
votes
0answers
16 views
How to use createInvoke()?
How do I use createInvoke() for the following method call?
I'm instrumenting a class.
currentThread().getStackTrace()[1].getLineNumber()
2
votes
1answer
68 views
Ignore code coverage for unit tests in EclEmma
I have configured EclEmma not to instrument my unit tests which works fine. However, the editor still highlights the test code as not covered. I want no highlighting in unit tests because they are not ...
3
votes
1answer
110 views
Eclipse, Maven and code coverage
Is there any Eclipse plug-in that gives the code coverage directly within the Eclipse JAVA editor, just like eCobertura or EclEmma, but that launches the tests using the Maven goal test (i.e. mvn ...
1
vote
0answers
83 views
Can Cobertura instrument custom java annotations?
I have a simple annotation like this:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface FragmentConfiguration {
public static enum ViewMode {
WithActionBar, ...
-1
votes
1answer
113 views
View method calls in android apk files runtime
Hi i need to do some coverage testing on android apk files. I do not have access to the source. Are there any such tools that will allow me to view the method calls in the apk file run-time? so that I ...
1
vote
2answers
77 views
Java: String to 7 bits hashing
I had a requirement where I have a set of Strings which are not known beforehand (for e.g. "phy", "link", "maca")
and I have 2 programs where I have only 7 bits to send across to communicate about ...
0
votes
3answers
78 views
Control the execution of a java program from my java program
public class LineNum1 extends Thread{
public synchronized void run()
{
try {
Hello.main(null);
System.out.println("Stack Trace of thread"+ ...
0
votes
1answer
76 views
Program Counter values of an executing Java Program [duplicate]
Possible Duplicate:
Program Counter register values for a Java program
Is it possible to obtain the program counter (PC) register values of a running Java application?
1
vote
3answers
146 views
Logging line numbers of the java code which has executed
I am developing an application. As a part of this, when the Java program executes, we want to display line numbers of the source of the Java program where the code has executed. I'm using the Code ...
0
votes
0answers
48 views
Accessing the LineNumberTable from .class file
LineNumber[] ln = new LineNumber[300];
LineNumberTable lnt = new LineNumberTable(LineNumberTable c);
ln = lnt.getLineNumberTable();
Query 1 : I don't know what I should be passing as parameter for ...
0
votes
1answer
39 views
log line numbers of executed java code…won't this slow down the execution?
I have referred this link and my question is based on it.
Log line numbers of executed java code
I was very happy with Edwin Buck's answer. My doubt is that wont checking the code line by line make ...
0
votes
1answer
88 views
How to print Line numbers as and when java code is executed
H All,
I want to trace which lines are executed in my code so that I can highlight those lines. Due to this i am able to trace the code which is not tested.
i found out that JDB is way through which ...
2
votes
1answer
214 views
Code coverage for Java: dead or paid?
I'm looking for an answer on code coverage tools. I know variations on this question have been asked before:
Code coverage tools in Java
What is your favourite code coverage tool(s)? (Free and ...
2
votes
1answer
227 views
Open source code coverage libraries for JDK7?
It seems like both Cobertura and Emma are outdated now. They don't cope with Java 7 byte code. Running instrumented tests with Cobertura results in verification errors
java.lang.VerifyError: ...
0
votes
1answer
195 views
Cobertura code coverage for Freemarker auto-generated code
I am trying to set up Cobertura code coverage on a project which includes auto-generated code, created from templates using Freemarker (explicitly, using the fmpp maven plugin).
I then have unit ...
3
votes
3answers
203 views
Can fully covered code have an EclEmma coverage rating of less than 100%?
I just wrote some simple sample code to make sure that I had EclEmma installed correctly. I'm not getting 100% coverage, and I don't understand why. The highlighting implies that it has to do with the ...
1
vote
2answers
91 views
Java code coverage : method level unit test
Are there some tools or Eclipse plugin that could detect that a method hasn't been subject to a unit test (JUnit/TestNg)?
Thx in advance.
13
votes
5answers
215 views
Log line numbers of executed java code
I am writing part of a PHP web application (which will be used in a high school bug finding contest) where the user must find bugs in a given Java program. As a part of this, when the Java program ...
0
votes
0answers
86 views
How to make jmockit-coverage count untested classes in coverage report?
Let's say my application has 2 classes, and my unit tests cover 100% of the first class and 0% of the second. When reporting the coverage, jmockit-coverage will report "100%" on the first class, "?" ...
0
votes
0answers
307 views
EMMA [MAIN_METHOD_NOT_FOUND]
Am trying to use Emma for checking the code coverage of my application and
am trying to run like this
D:\bin>java -cp val.jar;emma.jar emmarun -r html -cp . com.val.ui.ValidatorClient
EMMA: ...
1
vote
1answer
279 views
Can I exclude auto generated code from Eclemma code coverage tool Java?
Is it possible to hide some of my code (for example autogenerated code) from eclemma code coverage tool. In c# there is an option to do it the option described here , do we have something like this in ...
1
vote
0answers
310 views
Filtering junit test classes from Emma Code Coverage Report
I have a project where I have the emma code coverage script (using ant) building and generating the tests correctly.
I have two packages
com.myproject.abc
test.com.myproject.abc
All of the ...
2
votes
0answers
357 views
Can't run EMMA code coverage
I have Java SE Development Kit 7u3 installed
I've been through some of the topics similar to this (e.x. "java" succeeds," java emmarun" fails) but my problem is that EMMA doesn't ...
2
votes
1answer
97 views
Planning to get started code coverage tool
Looking for books or other references that discuss actually to write a code coverage tool in Java; some of the various techniques or tricks - source vs. byte code instrumentation. This is for a ...
-1
votes
1answer
71 views
Manual code coverage using jetty
Is there way for measure code coverage during unit testing/development. I am using jetty and would be possible to measure coverage in this?
thanks,
Mu2
5
votes
2answers
153 views
Coverage vs reachable code
Q: how to detect real test coverage ?
I've noticed one problem with code coverage metric and test quality: 100% code coverage doesn't mean that code is really tested.
Sometimes test gives 100% ...
1
vote
2answers
613 views
java.lang.RuntimeException: Stub! - Android Code Coverage?
I was using EclEmma coverage tool to test my code coverage. But whenever I run my test cases, It gives me the following error. Can you please tell me how can I solve this error.
1
vote
2answers
67 views
WSServletContextLi stener contextDestroyed while deploying war using cobertura
Hi I am new to cobertura , i created a war using cobertura while deploying this war in tomcat i am getting below error message
INFO: Initializing Mojarra 2.0.4 (FCS b09) for context '/victor'
Apr 02, ...
4
votes
1answer
469 views
Get JaCoCo Integration Coverage from Sonar
I am developing an application using sonar Java web service client API. I would like to get Integration Test code coverage per class from the JaCoCo plugin. Can this be done with this API?
1
vote
1answer
597 views
Branches missed in testing JUnit and EclEmma
I'm using EclEmma to test the coverage of the test class I have written (JUnit testing). I have enabled the assertions in Java using -ea. After running the coverage test, where I have used Java ...
1
vote
1answer
111 views
Should annotations be included in code coverage?
Well the questions is fairly self-explanatory.
How do various (java) code coverage tools treat annotations? Are they considered as code and included in coverage reports? They are not "executable" ...
2
votes
2answers
448 views
JUnit 3, how to find which tests covered my lines of code? (RTC…maybe?)
The scenario is: I've run JUnit code coverage in eclipse with RTC installed.
I have this view called "Coverage" that I am not sure about, but it seems to show me the code coverage of my JUnit tests. ...
0
votes
0answers
69 views
How to monitor the coverage of my code using emma
I will be calling a bunch of commands and each command will in turn call a jar file and execute it. After running through all the commands is there any way which can tell me the total code coverage ...
1
vote
1answer
282 views
How to use emma for jar files
How do I run use emma with a jar file. I downloaded emma.jar and another jar for testing purpose (MySQLConnector.jar). I placed both the jars in the same folder and tried to give this command
java ...
2
votes
1answer
82 views
Cobertura Check & Validation
I see that Cobertura has a <cobertura:check> task that can be used to enforce coverage at build-time (if coverage metrics dip below a certain value, the build fails). The website shows examples ...
2
votes
2answers
734 views
Cobertura Instrumentation
I am trying to get Cobertura working with my Ant build, and specifically just want it to give me a coverage report on my unit tests. I'm using the following directory structure:
src/main/java --> ...
1
vote
1answer
198 views
Configuring Cobertura with Ant
I'm trying to get Cobertura working for my project's Ant build, and all I have to work with are the documentation/FAQs and a sample build.xml that uses cobertura, but apparently never worked (ha!).
...