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

If you're talking about coverage in the usual sense (% of lines that were executed), it's pretty much useless. Here's an example of 100% test coverage in that sense:

  add a b = 2
  test_add = assert_equals (add 1 1) 2
A more useful definition of coverage would be the entire possible state of the program, but this is tantamount to a proof, which is a really hard problem for programs in general. Property based testing, e.g. QuickCheck[1], gets us close, but it is often hard to come up with the right properties.

[1]: https://hackage.haskell.org/package/QuickCheck




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

Search: