Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's very useful when you're working on numerical software. Often, it's hard to figure out exactly what output your code should return (because if you knew the answer you wouldn't have to write the code), but you can easily list properties you expect.


Right, metamorphic testing in particular (which would be a special case of PBT, with metamorphic relations being properties), https://en.wikipedia.org/wiki/Metamorphic_testing, https://github.com/MattPD/cpplinks/blob/master/testing.md#pr...

One simple example (from the above) is "sin (π − x) = sin x" for the implementation of the sine function not requiring the knowledge of its specific output values. Naturally, instead of the literal equality "=" one can use a more appropriate accuracy specification as in, say, relative ulp (https://en.wikipedia.org/wiki/Unit_in_the_last_place) error bound, cf. https://members.loria.fr/PZimmermann/papers/accuracy.pdf




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

Search: