jeudi 1 septembre 2016

Why is this test not tautological?

This is not about explicit code, so apologies if it should have been posted elsewhere. It is, however, solidly within the domain of testing, which I assume you guys to be right at home in.

I'm reading the provocatively titled paper "Why Most Unit Testing is Waste" (21 pages) and came across this passage:

The third tests to throw away the tautological ones. [...] Testing for this being non-null on entry to a method is, by the way, not a tautological test — and can be very informative [...]

This really piqued my curiosity -- why would this ever be null on purpose? How would you even write such code?

Aucun commentaire:

Enregistrer un commentaire