Re: Tests self-diagnostic

Date: 2020-08-29 08:12 am (UTC)
From: [personal profile] sassa_nf
It's a bug in the specification. It happens sometimes. But the tests only test the correspondence between the test and the code, not between the code and the intention.

Say:
fn is_even(x: u32) -> bool {
   is_odd(x + 1)
}

fn is_odd(x: u32) -> bool {
   x != 0 && is_even(x + 1)
}
the bug in the intention is not very easy to see. (And, by the way, is_odd(2) produces 100% code coverage, which says something about that metric).
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 2nd, 2025 03:04 am
Powered by Dreamwidth Studios