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

  • Home
  • SEARCH
  • 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 4611304
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:15:00+00:00 2026-05-22T01:15:00+00:00

Before this question is marked as duplicate, please read it. ;) There are already

  • 0

Before this question is marked as duplicate, please read it. 😉
There are already several questions about coverage tools and such, however this is a bit different than the usual ones (I hope).

According to wikipedia there are several different kind of ‘coverage’ variations that affect several different aspects of the term ‘coverage’.

Here a little example:

public class Dummy {
    public int a = 0;
    public int b = 0;
    public int c = 0;

    public void doSomething() {
        a += 5;

        b += 5;

        c = b + 5;
    }
}

public class DummyTest {

    @Test
    public void testDoSomething() {
        Dummy dummy = new Dummy();

        dummy.doSomething();

        assertEquals( 10, dummy.c );
    }
}

As you can see, the test will have a coverage of 100% lines, the assertion on the value of field ‘c’ will cover this field and indirectly also cover field ‘b’, however there is no assertion coverage on field ‘a’.
This means that the test covers 100% of the code lines and assures that c contains the expected value and most probably also b contains the correct one, however a is not asserted at all and may a completely wrong value.

So… now the question: Is there a tool able to analyze the (java) code and create a report about which fields/variables/whatever have not been (directly and/or indirectly) covered by an assertion?

(ok when using getters instead of public fields you would see that getA() is not called, but well this is not the answer I’d like to hear 😉 )

  • 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-22T01:15:00+00:00Added an answer on May 22, 2026 at 1:15 am

    As you can see, the test will have a coverage of 100% lines, the assertion on the value of field ‘c’ will cover this field and indirectly also cover field ‘b’, however there is no assertion coverage on field ‘a’. This means that the test covers 100% of the code lines and assures that c contains the expected value and most probably also b contains the correct one, however a is not asserted at all and may a completely wrong value.

    Well, “cover” unfortunately means different things to different people… This test indeed exercises 100% of the code lines, but it does not test them all.

    What you’re looking for is handled well by mutation testing.

    Have a look at Jester, which uses mutation testing to report on code coverage.

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

Sidebar

Related Questions

Before this is marked as duplicate, I'm aware of this question, but in my
I asked this question before, Here however I think I presented the problem poorly,
I know this question has been asked before, but I ran into a problem.
This question has been asked before ( link ) but I have slightly different
I know this question has been asked a bit before. But looking around I
Before you answer, this question is complicated: We are developing in asp.net / asp.net
I know this specific question has been asked before , but I am not
I think the question is pretty self explanatory. Anyone done this before? UPDATE :
I have ask this kind of question before, but it seems my previous question
It's quite possible a question like this has been asked before, but I can't

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.