Solved

Java Negative test cases not adding up to the ECLEmma java code coverage

Posted on 2014-12-02
6
252 Views
Last Modified: 2015-03-04
When I run sonar code coverage for a set of integration test cases then the code coverage gives high value with positive and valid test cases.
After that I add few more negative test cases for same set of java classes and the code coverage drops drastically by 10 to 20%.
I checked the surefire-reports and logs but I am not sure what is going wrong and how is it impacting.

I want to understand mechanism of Sonar reads sure fire reports.
0
Comment
Question by:jgdvishnu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 

Author Comment

by:jgdvishnu
ID: 40478585
why is it neglected. Please help
0
 
LVL 21

Accepted Solution

by:
MogalManic earned 500 total points
ID: 40478930
Need more information.  If could be that there is something in the tests that you  added that changed the state of something.

You could also try commenting out the new rests to determine that was the actual cause. If it was,then reintroduce them one at a time.
0
 

Author Comment

by:jgdvishnu
ID: 40481489
code coverage values are erratic and inconsistent.
I wanted to understand how the sonar reads sure fire reports for any test cases(positive and negative).
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:jgdvishnu
ID: 40566877
how does sure fire report is read by sonar. what is the mechanism.
Perhaps that gives idea about it.
0
 

Assisted Solution

by:jgdvishnu
jgdvishnu earned 0 total points
ID: 40636397
This was due to 3 reasons:-
1) Sure Fire just lists if there was error or not. there was an error happening in the last method that was lowering the coverage count. We need to check target/classes/sure-fire report.

2) step to test the code coverage is.
mvn clean
mvn install without test case
mvn test // look that there is no error.
then when we restart sonar server
then look for issues in
mvn sonar:sonar.
0
 

Author Closing Comment

by:jgdvishnu
ID: 40644189
my step gives more detail and i donot take credit for it.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
use lov values 2 72
Java basic valueOf question 1 33
Eclipse with various Java releases 7 47
Coding for the first time 9 67
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question