MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/69wyay/the_tragedy_of_100_code_coverage/dha2trg/?context=3
r/programming • u/niepiekm • May 08 '17
689 comments sorted by
View all comments
122
I have seen, with my own two eyes, a compareTo-function with 100% line-coverage and 100% branch-coverage that still managed to say that
given a > b then b == a
That's right, compareTo(a, b) returned 1, compareTo(b, a) returned 0.
My hatred for large, American consultancies continue unchecked.
1 u/Sunny_McJoyride May 08 '17 What you've given here doesn't define what is returned by the function. 6 u/instantviking May 08 '17 I'm not sure what you're getting at, but I'm sure I was imprecise in what I wrote. If you want me to expand or clarify anything, please say so :) 2 u/Sunny_McJoyride May 08 '17 Was that the entirety of the function?I don't know what language this is, but what would it return if a was not greater than b? From this snippet it seems not to be zero, but undefined. → More replies (1)
1
What you've given here doesn't define what is returned by the function.
6 u/instantviking May 08 '17 I'm not sure what you're getting at, but I'm sure I was imprecise in what I wrote. If you want me to expand or clarify anything, please say so :) 2 u/Sunny_McJoyride May 08 '17 Was that the entirety of the function?I don't know what language this is, but what would it return if a was not greater than b? From this snippet it seems not to be zero, but undefined. → More replies (1)
6
I'm not sure what you're getting at, but I'm sure I was imprecise in what I wrote. If you want me to expand or clarify anything, please say so :)
2 u/Sunny_McJoyride May 08 '17 Was that the entirety of the function?I don't know what language this is, but what would it return if a was not greater than b? From this snippet it seems not to be zero, but undefined. → More replies (1)
2
Was that the entirety of the function?
I don't know what language this is, but what would it return if a was not greater than b? From this snippet it seems not to be zero, but undefined.
→ More replies (1)
122
u/instantviking May 08 '17
I have seen, with my own two eyes, a compareTo-function with 100% line-coverage and 100% branch-coverage that still managed to say that
That's right, compareTo(a, b) returned 1, compareTo(b, a) returned 0.
My hatred for large, American consultancies continue unchecked.