Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6318227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:36:58+00:00 2026-05-24T15:36:58+00:00

I have a situation where I need to know what methods are being called

  • 0

I have a situation where I need to know what methods are being called from a single JUnit test. For example, if I have the following pseudo-code:

public class UnitTest {    
  public main() {
    Circle c = new Circle()
    c.getArea()
  }
} 

public class Circle {
  public Circle() {
    ...
  }    
  public getArea() {
    ...
    getRadius()
  }
  private getRadius() {
    ...
  }
}

The method calls of the UnitTest class follow this order (though for my purposes I don’t need to preserve order, or to know of the caller’s method):

  1. UnitTest.main
  2. Circle.Circle
  3. Circle.getArea
  4. Circle.getRadius

Essentially, I want to know what part of the program is actually being exercised in the JUnit tests. I figure I can dynamically figure this out, but I am having trouble finding a tool or approach. The main problem with some of the tools I have found is that they are often very visual (require user interaction to extract the required data). I am looking for something that gives me just a list of the methods (xml, text, etc…) without the GUI aspect. In the end I am trying to automate this for test suites via a scripting approach.

The approaches I am thinking of using would be either:

  • Using a Java Agent to print out the class.method at every method call.
  • Tracing using Aspects like this

If there is a tool which already does this that would be great. If not, does it seem like I am on track to solve my problem using one of the approaches I’ve specified.

Any help/suggestions would be appreciated.

UPDATE-SOLVED
I decided to use Emma with the following commands to extract the information of method calls (just need to parse report for any method over a 0% coverage):

emmarun -r xml                 // To output to XML
  -Dreport.sort=-method        // Sort method coverage in descending order
  -Dverbosity.level=silent     // Minimize script output
  -Dreport.metrics=method:1    // Flag any method with a 0% coverage
  -Dreport.columns=method,name // Only show the method and name columns
  -Dreport.depth=method        // Consider the data of method coverage
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:36:59+00:00Added an answer on May 24, 2026 at 3:36 pm

    Are you looking for a “Coverage” tool, such as Emma or Cobertura?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have a situation where you need to know where a boolean value
I have a situation where I need to be able to load assemblies in
I have a situation where I need to work with a datagrid and adding
I have a situation where i need to debug a Windows CE application in
I have a situation where I need to add an arbitrary unique id to
So, I have this situation where I need to see if an object is
I have an interesting situation where I need to deploy an ASP.NET MVC app
I have a situation where in a web application a user may need a
Situation: I have a simple XML document that contains image information. I need to
Here's the situation: we have an Oracle database we need to connect to to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.