Hacker News new | past | comments | ask | show | jobs | submit login

You actually brought to my attention a metric that I hadn't previously considered but now desperately want: branch coverage. I don't need 90% of lines covered, because one cannot measure coverage of missing lines

  /* BadImpl.java */
  if (theFile.exists()) {
      doTheAwesome(theFile);
  }
  // uh, and else ... what?

  /* BadImplTest.java */
  @Test
  public void looksGoodTestCoverage() {
    theFile.create();
    instance.runIt();
    println("hurray, 100% coverage");
  }
versus if the coverage tool was able to artificially rewrite the code to be this way, it would show up as not covered:

  if (theFile.exists()) {
    ...
  } else {
  }





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: