DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3
  • Understanding and Learning NoSQL Databases With Java: Three Key Benefits
  • Achieving Inheritance in NoSQL Databases With Java Using Eclipse JNoSQL
  • From J2EE to Jakarta EE

Trending

  • A Complete Guide to Modern AI Developer Tools
  • Automating Data Pipelines: Generating PySpark and SQL Jobs With LLMs in Cloudera
  • 5 Subtle Indicators Your Development Environment Is Under Siege
  • Customer 360: Fraud Detection in Fintech With PySpark and ML
  1. DZone
  2. Coding
  3. Frameworks
  4. Java Code Coverage in Eclipse

Java Code Coverage in Eclipse

We often think of using code coverage only for testing. In this post, we take a quick look at a new way of making use of such a tool in your Eclipse instance.

By 
Leo Ufimtsev user avatar
Leo Ufimtsev
·
Oct. 23, 17 · Tutorial
Likes (14)
Comment
Save
Tweet
Share
120.5K Views

Join the DZone community and get the full member experience.

Join For Free

People often think that Java code coverage tools are only used for testing. I beg to differ. I was recently investigating a JVM crash issue and had been interested in seeing which lines of code among those that were run could have had an influence on the crash.

To help with this, I used a tool that I recently discovered and have been using ever since called the EclEmma Java code coverage plugin. It’s for Eclipse and it’s free.

It’s very simple and intuitive and has all you would expect from a code coverage tool. With it, you can:

  • See code coverage for a java application that you’ve run (and potentially merge multiple run instances)
  • See code coverage for jUnit tests and maven tests
  • See which classes have which amount of coverage.
  • And more!

To use it, you can either right-click on a class and then find and click Code Coverage > Run As, or you can just hit the Run As Code Coverage button that looks like the regular Run button (shown here):

In the screenshot below, the colors are fairly self-explanatory. The color yellow means that it ran into a conditional (if/select/try) and only executed one branch.

To install EclEmma, just search for ‘eclemma’ in the marketplace:

If you decide to try this plugin out, I recommend you read the EclEmma user guide to get acquainted with all of its features (it’s fairly short, only 15 mins of reading).

Code coverage Java (programming language) Eclipse

Published at DZone with permission of Leo Ufimtsev, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3
  • Understanding and Learning NoSQL Databases With Java: Three Key Benefits
  • Achieving Inheritance in NoSQL Databases With Java Using Eclipse JNoSQL
  • From J2EE to Jakarta EE

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!