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

State and Behavioral Testing

Classifying the testing task at hand aids in identifying the best approach in writing the tests. Determining whether a test will verify state or behavior usefully steers the testing process.

Pure state verification exercises the code and examines the resulting changes in data values associated with the operation. Mathematical functions that simply transform inputs to outputs exemplify the target of state verification. In a functional model, verification simply determines that the return values correlate correctly with the input parameters. In an object-oriented model, you additionally verify that the attributes of the object have changed (or not changed!) appropriately. State verification tests typically supply inputs ...

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