Solved

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

Posted on 2014-12-02
6
231 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
  • 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 68
json format text only 4 65
micro services vs rest web services 16 53
Problem to start Neon 20 54
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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 …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now