title: What kind of test coverage criteria Eclipse uses?
body: <p>I am trying to understand what type of test coverage metric Eclipse uses.</p>
  
  <p>I wrote two simple functions as follows:</p>
  
  <pre><code>public class Hello {
    public void f(int a, int b) {
        int sum = a + b;
        if (sum &gt; 0)
            print("blue");
        else if (sum &lt; 0)
            print("red");
        print("done");
    }
  
    void print(String s) {
        System.out.println(s);
    }
  
  
    public void g(int x, int y) {
        if (x == 0 || y &gt; 0) {
            print("red");
        } else {
            print("blue");
        }
    }
  }
  </code></pre>
  
  <p>Then I called the functions from the unit tests like this:</p>
  
  <pre><code>import org.junit.jupiter.api.Test;
  
  class TestHello {
  
    @Test
    void test_f() {
        new Hello().f(2, 4);
        new Hello().f(-1, -2);
        new Hello().f(-1, 1);
    }
  
    @Test
    void test_g() {
        new Hello().g(0, 5);
        new Hello().g(5, 0);
        new Hello().g(0, 0);
        //new Hello().g(5, 5);
    }
  }
  </code></pre>
  
  <p>As a result, for the function <em>g</em>, Eclipse says that "1 of 4 branches missed" and marks the line <em>18</em> yellow.</p>
  
  <p><a href="https://i.stack.imgur.com/9vmfB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9vmfB.jpg" alt="Source code line 18 marked yellow"></a></p>
  
  <p>On the other hand, the coverage window shows that the function <em>g</em> is 100% covered while the green bar on the first column is not as long as the function <em>f</em> one where I thought these bars showed how much close you are to 100%.</p>
  
  <p><a href="https://i.stack.imgur.com/hcMQV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hcMQV.jpg" alt="Coverage shown"></a></p>
  
  <p>So I am trying to make sense out of all of this. Does Eclipse use:</p>
  
  <ul>
  <li>branch coverage</li>
  <li>condition coverage</li>
  <li>branch and condition coverage</li>
  <li>modified condition / decision coverage (mc/dc)</li>
  <li>multiple condition coverage (mcc) </li>
  <li>something else?</li>
  </ul>
  
  <p>According to %100 coverage shown on the coverage window, it may be using branch and condition coverage. However, the yellow marked line may tell me that it uses something stronger like mc/dc or mcc. Then, there is progress-bar looking-like green bar which I am not sure what is trying to tell me?</p>
  
  <p>I appreciate if someone more knowledgeable than me can make sense out of all these observations and can explain what metric Eclipse is using and what the progress bar means compared to the percentage?</p>