Tuesday, September 15, 2009

 

Elements of Testing and Checking

In the last couple of weeks, I've been very gratified by the response to the testing-vs.-checking distinction. Thanks to all who have grabbed on to the idea and to those who have questioned it.

There's a wonderful passage in Chapter 4 of Jerry Weinberg's Perfect Software and Other Illusions About Testing in which he breaks down the activities of a programmer engaged in testing activities—testing for discovery, discovering an unexpected problem, pinpointing the problem in the behaviour of the product, locating the problem in the source code, determining the significance of the problem, repairing the problem, troubleshooting, and testing to learn (or hacking, or reverse engineering). He points out that confusion among the differences in these different aspects of testing can lead to conflict, resentment, and failed projects.

I brought up the test-vs.-check idea because, like Jerry, I think that the word "test" lumps a large number of concepts into a single word, and (as any programmer will tell you) not knowing or noticing what's going on inside an encapsulation can lead to trouble. I wanted to raise the issue that (as Dale Emery has helped me to articulate) excellent testing requires us to generate new knowledge, in addition to whatever confirmations we generate. Moreover, tests that generate new knowledge and tests (or checks) that confirm existing knowledge have different motivations, and therefore have different standards of excellence.

A test is a question (or set of questions) that we want to ask of the program. It might consist of a single idea, or many ideas. Designing a test requires us to model the test space (or consider the scope of the question we want to ask), and to determine the oracles we'll use, the coverage we hope to obtain, and the test procedures that we intend to follow. These are the elements of test design. Performing the test requires us to configure, operate, observe, and evaluate the system, and then to report on what we've done, what we've observed, and our evaluation. These are the elements of test execution.

A check is a component of a confirmatory approach to testing. As James Bach and I reckoned, a check itself has three elements:

1) It involves an observation.
2) The observation is linked to a decision rule.
3) Both the observation and the decision rule can be performed without sapience (that is, without a human brain).

Although you can execute a check without sapience, you can't design, implement, or interpret a check without sapience. What needs to be done to make a check happen and to respond to it?
In future posts, I'll be talking about how we can put this miniature task analysis to work for us, which I hope in turn will help us to consider important issues in the quality of our testing.

Next: Testing, Checking, and Changing the Language

The Testing vs. Checking Series

1. Testing vs. Checking
2. Transpection and the Three Elements of Checking
3. Pass vs. Fail vs. Is There a Problem Here?
4. Elements of Testing and Checking
5. Testing, Checking, and Changing the Language
6. Tests vs. Checks: The Motive for Distinguishing
7. A Tester Asks About Checking
8. Tests vs. Checks: Should We Call Test-Driven Development Something Else?

Related: James Bach on Sapience and Blowing People's Minds

Comments:

Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?