February 2013
Intermediate to advanced
258 pages
7h 26m
English
In the beginning of this chapter I described a primitive assertion as one that’s so cryptic because of its low abstraction level that its intent and meaning remain a mystery to the reader. A bitwise assertion is a special case of primitive assertion that I feel warrants special mention because its elements are close to home for so many programmers and far from home for equally many programmers.
Perhaps an example will help concretize this hazard.
Let’s take a look at a concrete example that exhibits this particular smell. Consider the test in this listing.
public class PlatformTest { @Test public void platformBitLength() { assertTrue(Platform.IS_32_BIT ...