Scripted Testing

Jane was toast, and not the light buttery kind, nay, she was the kind that's been charred and blackened in the bottom of the toaster and has to be thrown away because no matter how much of the burnt part you scrape off with a knife, there's always more blackened toast beneath, the kind that not even starving birds in winter will eat, that kind of toast.

— Beth Knutson

Introduction

For scripted testing to be understood, it must be understood in its historical context. Scripted testing emerged as one of the component parts of the Waterfall model of software development. The Waterfall model defines a number of sequential development phases with specific entry and exit criteria, tasks to be performed, and deliverables (tangible work products) to be created. It is a classic example of the "plan your work, work your plan" philosophy. Typical Waterfall phases include:

  1. System Requirements - Gathering the requirements for the system.
  2. Software Requirements - Gathering the requirements for the software portion of the system.
  3. Requirements Analysis - Analyzing, categorizing, and refining the software requirements.
  4. Program Design - Choosing architectures, modules, and interfaces that define the system.
  5. Coding - Writing the programming code that implements the design.
  6. Testing - Evaluating whether the requirements were properly understood (Validation) and the design properly implemented by the code (Verification).
  7. Operations - Put the system into production.

Interesting Trivia

A Google search for "plan your work" and "work your plan" found 3,570 matches including:

This model was first described in 1970 in a paper entitled "Managing the Development of Large Scale Systems" by Dr. Winston W. Royce. Royce drew the following diagram showing the relationships between development phases:

Figure 12-1: The Waterfall life cycle model.

What process was used before Waterfall? It is a process known as "Code & Fix." Programmers simply coded. Slogans like "Requirements? Requirements? We don't need no stinkin' Requirements!" hung on the walls of programmers' offices. Development was like the scene in the movie Raiders of the Lost Ark. Our hero, Indiana Jones, is hiding from the bad guys. Indy says, "I'm going to get that truck." Marion, our heroine, turns to him and asks, "How are you going to get that truck?" Indy replies, "I don't know. I'm making this up as I go." If we substituted "build that system" for "get that truck" we'd have the way real men and real women built software systems in the good old days.

Curious Historical Note

Today, Winston Royce is known as the father of the Waterfall model of software development. In fact, in his paper he was actually proposing an iterative and incremental process that included early prototyping - something many organizations are just now discovering.

Today we take a different view of scripted testing. Any development methodology along the spectrum from Waterfall to Rapid Application Development (RAD) may use scripted testing. Whenever repeatability, objectivity, and auditability are important, scripted testing can be used.

Repeatability means that there is a definition of a test (from design through to detailed procedure) at a level of detail sufficient for someone other than the author to execute it in an identical way. Objectivity means that the test creation does not depend on the extrordinary (near magical) skill of the person creating the test but is based on well understood test design principles. Auditability includes traceability from requirements, design, and code to the test cases and back again. This enables formal measures of testing coverage.

"Plan your work, work your plan." No phrase so epitomizes the scripted testing approach as does this one, and no document so epitomizes the scripted testing approach as does IEEE Std 829-1998, the "IEEE Standard for Software Test Documentation."

This standard defines eight documents that can be used in software testing. These documents are:

Figure 12-2 shows the relationships between these documents. Note that the first four documents that define the test plan, test designs, and test cases are all created before the product is developed and the actual testing is begun. This is a key idea in scripted testing—plan the tests based on the formal system requirements.

Figure 12-2: The IEEE 829 Test Documents

Curiously, the IEEE 829 standard states, "This standard specifies the form and content of individual test documents. It does not specify the required set of test documents." In other words, the standard does not require you to create any of the documents described. That choice is left to you as a tester, or to your organization. But, the standard requires that if you choose to write a test plan, test case specification, etc., that document must follow the IEEE 829 standard.

The IEEE 829 standard lists these advantages for its use:

IEEE 829 Document Descriptions

The IEEE 829 standard defines eight different documents. Each document is composed of a number of sections.

Test Plan

Test Design Specification

Test Case Specification

Test Procedure Specification

Test Item Transmittal Report (a k a Release Notes)

Test Log

Test Incident Report (a k a Bug Report)

Test Summary Report

Advantages of Scripted Testing

  1. Scripted testing provides a division of labor—planning, test case design, test case implementation, and test case execution that can be performed by people with specific skills and at different times during the development process.
  2. Test design techniques such as equivalence class partitioning, boundary value testing, control flow testing, pairwise testing, etc. can be integrated into a formal testing process description that not only guides our testing but that could also be used to audit for process compliance.
  3. Because scripted tests are created from requirements, design, and code, all important attributes of the system will be covered by tests and this coverage can be demonstrated.
  4. Because the test cases can be traced back to their respective requirements, design, and code, coverage can be clearly defined and measured.
  5. Because the tests are documented, they can be easily understood and repeated when necessary without additional test analysis or design effort.
  6. Because the tests are defined in detail, they are more easily automated.
  7. Because the tests are created early in the development process, this may free up additional time during the critical test execution period.
  8. In situations where a good requirements specification is lacking, the test cases, at the end of the project, become the de facto requirements specification, including the results that demonstrate which requirements were actually fulfilled and which were not.
  9. Scripted tests, when written to the appropriate level of detail, can be run by people who would otherwise not be able to test the system because of lack of domain knowledge or lack of testing knowledge.
  10. You may have special contractual requirements that can only be met by scripted testing.
  11. There may be certain tests that must be executed in just the same way, every time, in order to serve as a kind of benchmark.
  12. By creating the tests early in the project we can discover what we don't know.
  13. By creating the tests early we can focus on the "big picture."

In his book Software System Testing and Quality Assurance, Boris Beizer summarizes in this way:

"Testing is like playing pool. There's real pool and kiddie pool. In kiddie pool, you hit the balls and whatever pocket they happen to fall into, you claim as the intended pocket. It's not much of a game and although suitable to ten-year-olds it's hardly a challenge. The object of real pool is to specify the pocket in advance. Similarly for testing. There's real testing and kiddie testing. In kiddie testing, the tester says, after the fact, that the observed outcome was the intended outcome. In real testing the outcome is predicted and documented before the test is run."

Disadvantages of Scripted Testing

  1. Scripted testing is very dependent on the quality of the system's requirements. Will the requirements really be complete, consistent, unambiguous, and stable enough as the foundation for scripted testing? Perhaps not.
  2. Scripted testing is, by definition, inflexible. It follows the script. If, while testing, we see something curious, we note it in a Test Incident Report but we do not pursue it. Why not? Because it is not in the script to do so. Many interesting defects could be missed with this approach.
  3. Scripted testing is often used to "de-skill" the job of testing. The approach seems to be, "Teach a tester a skill or two and send them off to document mountains of tests. The sheer bulk of the tests will probably find most of the defects."

Summary

References

Beizer, Boris (1984). Software System Testing and Quality Assurance. Van Nostrand Reinhold.

"IEEE Standard for Software Test Documentation," IEEE Std 829-1998. The Institute of Electrical and Electronics Engineers, Inc. ISBN 0-7381-1443-X

Royce, Winston W. "Managing the Development of Large Software Systems," Proceedings of the 9th International Conference on Software Engineering, Monterey, CA, IEEE Computer Society Press, Los Alamitos, CA, 1987. http://www.ipd.bth.se/uodds/pd&agile/royce.pdf

Категории