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

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

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

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

  • Beyond Microservices: The Emerging Post-Monolith Architecture for 2025
  • The Cypress Edge: Next-Level Testing Strategies for React Developers
  • AI-Assisted Coding for iOS Development: How Tools like CursorAI Are Redefining the Developer Workflow
  • How Clojure Shapes Teams and Products
  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!