O'Reilly logo

Quality Code: Software Testing Principles, Practices, and Patterns by Stephen Vance

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Prefer Complete over Partial Verification

Many highly encapsulated systems hide internal state that they prefer not to let their client code manipulate. If such state is transient or implementation specific, that is probably the right decision. Sometimes developers hide these attributes as a matter of security instead. Security creates a compelling reason to hide, but should it be done at the expense of verification of relevant consequences? Getter-only access and cloned returns are two ways to provide visibility without weakening many security motivations, allowing more complete verification.

Another common category of incomplete verification is the use of substrings, collection membership, and other subsetting techniques to verify results. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required