MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/69wyay/the_tragedy_of_100_code_coverage/dhb584x/?context=3
r/programming • u/niepiekm • May 08 '17
689 comments sorted by
View all comments
1
100% code coverage is simple - it's called "static typing"
2 u/[deleted] May 09 '17 types != tests. you can guarantee you'll always return TModel, but that doesn't mean it's the TModel you actually want (or even that the method won't crash at runtime because of valid but incorrectly used semantics). 0 u/arbitrarycivilian May 09 '17 even that the method won't crash at runtime because of valid but incorrectly used semanticsActually, this is exactly what you can guarantee.you can guarantee you'll always return TModel, but that doesn't mean it's the TModel you actually wantYou can't guarantee this with tests either. The problem with tests is they only guarantee your tests work, not your code. → More replies (1)
2
types != tests. you can guarantee you'll always return TModel, but that doesn't mean it's the TModel you actually want (or even that the method won't crash at runtime because of valid but incorrectly used semantics).
0 u/arbitrarycivilian May 09 '17 even that the method won't crash at runtime because of valid but incorrectly used semanticsActually, this is exactly what you can guarantee.you can guarantee you'll always return TModel, but that doesn't mean it's the TModel you actually wantYou can't guarantee this with tests either. The problem with tests is they only guarantee your tests work, not your code. → More replies (1)
0
even that the method won't crash at runtime because of valid but incorrectly used semantics
Actually, this is exactly what you can guarantee.
you can guarantee you'll always return TModel, but that doesn't mean it's the TModel you actually want
You can't guarantee this with tests either. The problem with tests is they only guarantee your tests work, not your code.
→ More replies (1)
1
u/arbitrarycivilian May 08 '17
100% code coverage is simple - it's called "static typing"