Just Enough Software Test Automation / Edition 1

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $19.99
Usually ships in 1-2 business days
(Save 60%)
Other sellers (Paperback)
  • All (10) from $19.99   
  • New (7) from $35.69   
  • Used (3) from $19.99   

Overview

Just Enough Test Automation shows test developers and users how to design, implement, and manage software test automation. Learn from authors Dan Mosley and Bruce Posey how to implement a powerful data-driven testing framework; automate unit testing, integrate testing and system/regression testing; and facilitate manual testing with automated tools.
Read More Show Less

Editorial Reviews

From The Critics
Offers advice on designing and implementing a software test automation infrastructure, and identifies what current popular testing approaches can and cannot accomplish. Rejecting the automation life cycle model, the authors favor limited automation of unit, integration, and system testing. They also present a control synchronized data-driven framework to help jump-start an automation project. Examples are provided in the Rational suite test studio, and source code is available at a supporting web site. Annotation c. Book News, Inc., Portland, OR
Read More Show Less

Product Details

  • ISBN-13: 9780130084682
  • Publisher: Prentice Hall
  • Publication date: 7/28/2002
  • Series: Yourdon Press Series
  • Edition description: New Edition
  • Edition number: 1
  • Pages: 288
  • Product dimensions: 7.00 (w) x 9.00 (h) x 0.70 (d)

Meet the Author

DANIEL J. MOSLEY is founder and principal of Client-Server Software Testing Technologies and author of The Handbook of MIS Application Software Testing and Client-Server Software Testing on the Desktop and Web (Prentice Hall PTR). A Certified Software Test Engineer (CSTE), Mosley served as senior consultant and seminar leader for the Quality Assurance Institute and authored the TEST-RxTM Methodology.

BRUCE A. POSEY specializes in developing and implementing data-driven, framework-based test scripts utilizing SQA Suite/Rational Team Test. He has nearly 30 years' IT experience in diverse roles at MasterCard, Deutsche Financial Services, SBC, and other leading firms. He is owner and principal consultant of The Archer Group, which specializes in software testing and training.

Read More Show Less

Read an Excerpt

Preface

There has been a glut of test automation books on the market as of late. They all espouse different approaches to, and different levels of, software test automation implementation. There is even an attempt to describe an automated software testing life cycle in the most popular offering (see the Dustin reference in Chapter 2). Traditionally, authors of information systems (IS) industry publications typically try to force a hypothetical model to describe the processes we use. Sometimes it works and sometimes it doesn't. The problem is that there is no empirical evidence to support that the approaches put into practice in these models work in the real world. The majority of the recommended approaches in software testing and software development practices are based on anecdotal evidence and project management fads that are started by so-called experts in the IS field and perpetuated by chief information officers (CIOs) in health club steam rooms.

We do not believe in an automated testing life cycle. This is an artificial construct that we find of little use. Nor do we believe in a software testing life cycle. What we do believe is that software testing occurs as a set of integrated activities in the software development process. We also believe that good software testing requires a special form of project management and its own set of operational techniques. Testing also requires a set of tools that a test engineer can rely on during test activities. These tools can be testing artifacts such as printed test scenarios that a test engineer follows or printed test logs that the engineer fills out while executing the tests.

We are not saying that we have to wait until a body of empirical evidence has been compiled before we accept and use the tools and techniques advocated by the IS authorities. We are saying that we have to evaluate the tools and methods ourselves and weed out the fluff. The real experiment is this: which techniques work and which do not when practitioners (you and we) attempt to use the technology.

Dan Mosley, the first author, explored his first automated testing tool back in 1985 and the technology was pretty crude. He was able to obtain an evaluation copy of that product while he was teaching one of the earliest undergraduate software testing courses (Washington University in St. Louis, 1985-1992). In the mid-1990s, he had long telephone conversations with Eric Schurr, then of Software Quality Automation (SQA), now of Rational Software Corporation, which subsequently absorbed SQA and its products, concerning automated software testing tools and what, functionally, they should provide for software test engineers' use.

They discussed what a good automation tool should do and what features it should include. Because of Dan's contacts with Eric, he acquired and used copies of SQA's (now Rational's) automated testing tool, which came out after that early Version 1.0. The most current version (at the time of this writing) is Rational Suite TestStudio 2002. Dan's experiences with this product have shown that test automation is not an easy overnight fix for a faltering testing effort. Furthermore, his experiences have proven that automated testing is not a substitute for manual testing. Glen Myers published the fundamental concepts of software testing in the late 1970s. Even today his Art of Software Testing (1979) is considered the premier dialogue on software testing. We still need to apply his recommendations when we test manually and when we build an automated testing infrastructure.

Our pet peeve with test automation as it is currently practiced is the lack of emphasis on front-end test planning and test design activities. We keep repeating the classic mistake that software developers have perpetuated since the first program was written—we start testing (in the case of automated testing, writing the test scripts) without doing the proper analysis of the problem and design of the testing infrastructure. It brings to mind a cartoon from years ago—a manager is talking to the programmer: "You start writing code and I'll go find out what it is supposed to build." Automated tests that "test" the wrong things can have only one result: unsuitable tests are executed much faster.

The ultimate goal of any automation effort should be a set of planned tests that corresponds to a set of test requirements that in turn are reflected in the automated tests. Furthermore, the heart of the testing effort is not the test scripts, but the test data. This is why there is so much hype about data-driven automated testing as an automation implementation framework. The underlying premise is that data should drive the tests and should exercise the application under test's (AUT) features. The test scripts are just delivery vehicles. Automated tests are effective only when the test data are designed well.

An operational goal of an automated testing framework is to minimize test script maintenance. The traditional capture/playback model that testing tool vendors have championed for years leads to inordinately high script maintenance because the test data are hard coded in the body of the test script. Mosley's first experiences developing automated test scripts intuitively demonstrated that strictly using capture/playback is not the way to go. Furthermore, the built-in test cases the tools provided were essentially useless for anything but testing the application's graphical user interface (GUI). True functional testing requires the test engineer to write test data that probe the AUT in depth. GUI testing should be done, and it can be automated with minimal effort. In actual practice, we usually have a single test script that exercises the GUI objects. It baselines and validates the properties of all GUI objects. The test script is executed for each GUI screen.

Automating functional testing requires sophisticated test data that explore the AUT. The test data must reproduce test scenarios that exercise important system features. Consequently, automated functional testing is more complicated and difficult. It requires the test engineer to write a significant portion of the test script as opposed to recording it. It also means designing effective test data. Understanding what to test (having a documented set of test requirements) and designing test data that verify the requirements are the keys to writing valuable automated functional tests.

Understanding how to verify the test results is as important as knowing what to test. Automated test verification is also data dependent. As their primary verification method, automated tests frequently capture and store baseline data that are later compared against the same data captured during regression tests. More sophisticated tests access and manipulate database records before, during, and after the tests are executed.

A powerful automated testing framework must provide tools that address test planning, test design, test construction, test execution, and test results verification. An effective infrastructure is one that is predicated on an integrated central repository where testing artifacts can be stored and reused. The infrastructure should also provide customizable reporting capabilities.

We have a history prior to coauthoring this book. We met in 1996 when we worked together on the first really successful automated testing project we had encountered up to that point. Since then, we have worked together on a plethora of test automation projects. We have developed a sense of what is required to implement a successful automation project and what is required to propagate automated testing in an IS development and testing organization. We know as much about what won't work as we do about what will work.

Working together, we implemented a data-driven automated testing paradigm before we had even heard of this now prolific industry phrase (we were unaware of the paper that Richard Strang had given at the STAR conference in 1996; see the Chapter 1 references). We pioneered and perfected our implementations of the data-driven approach while others were just beginning to discuss and write about it. Of course, as with any new hot-button technology, it is not really new, just rediscovered. Data-driven testing is no exception. Beizer, in Software Testing Techniques (1983), described "Data-Base-Driven Test Design." This was late in the mainframe era and early in the PC revolution, so it was an idea related to testing mainframe applications. He presented it as a procedure not for testing the database, but for using the database structure to derive test data. He argued that it "is best suited to the verification of functional requirements as set down in the system specification." It is a simple step to expand this approach to include tests that are based on business rules supported by the database table structures. Add data that test the GUI objects and their behaviors and you have data-driven testing.

We also discovered structured test script writing (also known as framework-based testing) during this period. Again this is not new technology. Test scripts are programs written in modified versions of common programming languages such as Visual Basic and C. They are different in that they have special features to accommodate software testing tasks. There is a vast literature base that addresses structured programming concepts such as functional decomposition, module cohesion, module coupling, and modular (functional) reusability. As a test script constitutes a software program that tests another software program, it is subject to the same design and construction rules as the programs it is testing. Thus, structured programming concepts also apply to automated test scripts.

Because automated test scripts are also subject to the same baggage that other software programs carry, they can contain logic flaws; they can contain spaghetti (convoluted) code; they can contain hard-coded variables; and they can be implemented with both procedure and data in the test script itself. All of this adds up to increased costs related to test suite maintenance, just as there are costs associated with maintaining the software systems these test scripts test. Creating structured component-based test scripts that are separate from the data they execute is the only way to create an effective software test automation infrastructure, one that maximizes testing accuracy and that minimizes testing maintenance.

There have also been recent efforts to develop high-level test automation languages that can be used to design and implement automated tests by nontechnical personnel such as business and product analysts and system customers. These efforts are advocated as the next step in the evolution of automated testing. As yet, we have not seen an approach that simplifies test script development enough to be really useful. We can see the value of this as long as we are striving toward a set of universal script libraries that will support a common Java-like test scripting language; however, most frameworks to date have been written to support contrived high-level command languages, not object-oriented ones. In addition, the supporting libraries are as yet immature in the functionality they offer to the scriptwriter. To accomplish their testing needs, organizations have to add additional code to the existing library subroutines and functions.

Because we are practitioners, the aim of this book is to offer useful advice on test automation from the test automation developer's/user's perspective. It includes pragmatic advice on what to do and caveats concerning what not to do when designing and implementing a test automation infrastructure. It also contains advice on what current popular testing approaches can and cannot do for your testing endeavors.

Our examples were developed on the Rational Suite TestStudio platform, but we feel they can easily be adapted for use with other automated testing platforms. In addition, an FTP site (www.phptr.com/mosley) supports this book. That site contains template files from the Archer Group's Control Synchronized Data Driven Testing (CSDDT) approach (for the Rational environment), Carl Nagle's Data Driven Engine (DDE) approach (for the Rational environment), and Keith Zambelich's Totally Data-Driven approach using Mercury Interactive's WinRunner automated test tool, which is based on Zambelich's Test Plan Driven framework that uses his Toolkit For WinRunner. These resources can be used to easily jump-start your data-driven automated testing effort.

Read More Show Less

Table of Contents

Preface.

What Is Just Enough Test Automation?

No New Models, Please! A Life Cycle Is Not a Process. A Tool Is Not a Process. How Much Automation Is Enough? Testing Process Spheres. Test Planning. Test Design. Test Implementation. Support Activities. Testing Is a Team Effort. A Test Automation Group's Scope and Objectives. The Scope. Assumptions, Constraints, and Critical Success Factors for an Automated Testing Framework. Test Automation Framework Deliverables. An Automation Plan. Categories of Testing Tools. Conclusion. References.

Knowing When and What to Automate.

In General. When to Automate System Tests. Time to Automate Is Always the Number One Factor. An Extreme Example. A Quantitative Example. What to Automate. A Word About Creating Test Scripts. Conclusion. References.

Start at the Beginning, Define the Test Requirements, Design the Test Data.

Software/Test Requirements. Requirements Gathering and Test Planning Automation. From Software Requirement to Test Requirement to Test Condition: An Automated Approach. Requirements Management and Traceability. Functional Test Data Design. Black Box (Requirements-Based) Approaches. Gray Box (Both Requirements- and Code-Based) Approaches. White Box (Code-Based) Approaches. Requirements-Based Approaches. Requirements-Driven Cause-Effect Testing. Equivalence Partitioning, Boundary Analysis, and Error Guessing. Defining Boundary Conditions for Equivalence Classes. Error Guessing. Hybrid (Gray Box) Approaches. Decision Logic Tables. DLT as a Software Testing Tool. An Automated DLT Design Tool. Code-Based Approaches. Basis Testing Overview. The Basis Testing Technique. Conclusion. References.

A Look at the Development of Automated Test Scripts and at the Levels of Test Automation.

Developing Automated Test Scripts. Unit-Level Tests. System-Level Tests. Specialized System-Level Tests. Recording versus Programming Test Scripts. Conclusion. References.

Automated Unit Testing.

Introduction. Unit Testing Justification. The Unit Testing Process. A Rigorous Approach to Unit Testing. The Unit Test Specification. Unit Testing Tasks. Implementating the Unit Testing Tasks. Rules of Thumb for Unit Testing. Unit Testing Data. A Unit Testing Framework. For Object-Oriented Development Using Java. Conclusion. References.

Automated Integration Testing.

Introduction. What Is Integration Testing? The Daily Build Smoke Test. Build Smoke Test Objectives. Automated Build Smoke Test Checklist. Conclusion. References.

Automated System/Regression Testing Frameworks.

The Data-Driven Approach. Framework-Driven (Structured) Test Scripts. Developing Framework-Driven Test Scripts. The Archer Group Framework. Business Rules Test. GUI Test. Properties Test. Input Data Test. Formatting the Test Data File. Application-Level Errors. Building the External Data Input File. Data File Summary. Code Construction for the Business Rules Test. The Shell Script. The Main Script. After the Data Are Read. Keep Your Code Clean and Robust. Archer Group Summary. Carl Nagle's DDE Framework. DDE Overview. DDE Development Effort. Keith Zambelich's Test Plan Driven Testing Framework for Mercury Interactive Users. Zambelich Approach Summary. “Test Plan Driven” Method Architecture. Using TestDirector to Drive the Test Suite. Conclusion. References.

The Control Synchronized Data-Driven Testing Framework in Depth.

Creating Data-Driven Test Scripts. Implementing the CSDDT Approach. Common Problems and Solutions. Problem: Data Input. Solution: Utilize Input Data Text Files. Problem: Program Flow Changes. Solution: Let the Input Data Do the Driving. Problem: Managing Application Changes. Solution: Rerecord or Modify a Very Small Section of Code. Setting Up Common Startup and Ending Test Conditions. Modifying Recorded Code to Accept Input Data. Very Important Practices. Creating Functions for Common Operations—Isolating Command Objects. Continuing with the Program Flow. Using Multiple Input Records to Create a Test Scenario. Utilizing Dynamic Data Input—Keyword Substitution. Using Library or Include Files (*.sbh and *.sbl Files in Rational Robot). Utility Scripts. Debugging Your Scripts—When the Test(s) Uncover a Defect. Implementing the CSDDT Template Scripts. The DDScripts. SQABasic32 Include Files. Utility Scripts. An Example of the CSDDT Framework. Script File List. Library File List. Directions for Installing the Example Files. Conclusion. References.

Facilitating the Manual Testing Process with Automated Tools.

Introduction. Semiautomated Manual Testing Process Steps. Step 1. Identify and document the test objectives. Step 2. Translate the test objectives into specific test requirements. Step 3. Translate the test requirements into test conditions. Step 4. Construct the test data.. Step 5. Execute the manual tests. Using the List Box. Manual Testing Artifacts. Conclusion. References.

Managing Automated Tests.

Writing Effective Test Scripts and Test Data. Managing Manual and Automated Test Scripts. Test Suite Maintenance. Conclusion. References.

Data-Driven Automation: User Group Discussion.

Automated Testing Terms and Definitions.

Example Test Automation Project Plan Using Rational Suite TestStudio.

Introduction. Documentation References. Internal Sources. External Sources. Automation Implementation. Test Management. Test Design Phase. Test Implementation Phase. Test Execution Phase. Automation Environment. Test Development Workstations. Test Data Store Server. Test Execution Workstations. Test Application Servers. Organizational Structure. External Interfaces. Roles and Responsibilities. Roles. Responsibilities. Project Estimates.

Test Automation Project Work Plan Template.

Work Breakdown Structure. Project Start-Up Phase. Timeline. Implementation Iteration Objectives. Project Schedule. Project Resources. Budget. Project Monitoring and Control. Automation Effort Estimation. Schedule Control Plan. Budget Control Plan. Reporting Plan. Measurement Plan. Supporting Processes. Configuration Management Plan. Defect Tracking and Problem Resolution. Framework Evaluation. Framework Documentation Plan. Process Improvement.

Index.

Read More Show Less

Preface

Preface

There has been a glut of test automation books on the market as of late. They all espouse different approaches to, and different levels of, software test automation implementation. There is even an attempt to describe an automated software testing life cycle in the most popular offering (see the Dustin reference in Chapter 2). Traditionally, authors of information systems (IS) industry publications typically try to force a hypothetical model to describe the processes we use. Sometimes it works and sometimes it doesn't. The problem is that there is no empirical evidence to support that the approaches put into practice in these models work in the real world. The majority of the recommended approaches in software testing and software development practices are based on anecdotal evidence and project management fads that are started by so-called experts in the IS field and perpetuated by chief information officers (CIOs) in health club steam rooms.

We do not believe in an automated testing life cycle. This is an artificial construct that we find of little use. Nor do we believe in a software testing life cycle. What we do believe is that software testing occurs as a set of integrated activities in the software development process. We also believe that good software testing requires a special form of project management and its own set of operational techniques. Testing also requires a set of tools that a test engineer can rely on during test activities. These tools can be testing artifacts such as printed test scenarios that a test engineer follows or printed test logs that the engineer fills out while executing the tests.

We are not saying that we have to wait until a body of empirical evidence has been compiled before we accept and use the tools and techniques advocated by the IS authorities. We are saying that we have to evaluate the tools and methods ourselves and weed out the fluff. The real experiment is this: which techniques work and which do not when practitioners (you and we) attempt to use the technology.

Dan Mosley, the first author, explored his first automated testing tool back in 1985 and the technology was pretty crude. He was able to obtain an evaluation copy of that product while he was teaching one of the earliest undergraduate software testing courses (Washington University in St. Louis, 1985-1992). In the mid-1990s, he had long telephone conversations with Eric Schurr, then of Software Quality Automation (SQA), now of Rational Software Corporation, which subsequently absorbed SQA and its products, concerning automated software testing tools and what, functionally, they should provide for software test engineers' use.

They discussed what a good automation tool should do and what features it should include. Because of Dan's contacts with Eric, he acquired and used copies of SQA's (now Rational's) automated testing tool, which came out after that early Version 1.0. The most current version (at the time of this writing) is Rational Suite TestStudio 2002. Dan's experiences with this product have shown that test automation is not an easy overnight fix for a faltering testing effort. Furthermore, his experiences have proven that automated testing is not a substitute for manual testing. Glen Myers published the fundamental concepts of software testing in the late 1970s. Even today his Art of Software Testing (1979) is considered the premier dialogue on software testing. We still need to apply his recommendations when we test manually and when we build an automated testing infrastructure.

Our pet peeve with test automation as it is currently practiced is the lack of emphasis on front-end test planning and test design activities. We keep repeating the classic mistake that software developers have perpetuated since the first program was written—we start testing (in the case of automated testing, writing the test scripts) without doing the proper analysis of the problem and design of the testing infrastructure. It brings to mind a cartoon from years ago—a manager is talking to the programmer: "You start writing code and I'll go find out what it is supposed to build." Automated tests that "test" the wrong things can have only one result: unsuitable tests are executed much faster.

The ultimate goal of any automation effort should be a set of planned tests that corresponds to a set of test requirements that in turn are reflected in the automated tests. Furthermore, the heart of the testing effort is not the test scripts, but the test data. This is why there is so much hype about data-driven automated testing as an automation implementation framework. The underlying premise is that data should drive the tests and should exercise the application under test's (AUT) features. The test scripts are just delivery vehicles. Automated tests are effective only when the test data are designed well.

An operational goal of an automated testing framework is to minimize test script maintenance. The traditional capture/playback model that testing tool vendors have championed for years leads to inordinately high script maintenance because the test data are hard coded in the body of the test script. Mosley's first experiences developing automated test scripts intuitively demonstrated that strictly using capture/playback is not the way to go. Furthermore, the built-in test cases the tools provided were essentially useless for anything but testing the application's graphical user interface (GUI). True functional testing requires the test engineer to write test data that probe the AUT in depth. GUI testing should be done, and it can be automated with minimal effort. In actual practice, we usually have a single test script that exercises the GUI objects. It baselines and validates the properties of all GUI objects. The test script is executed for each GUI screen.

Automating functional testing requires sophisticated test data that explore the AUT. The test data must reproduce test scenarios that exercise important system features. Consequently, automated functional testing is more complicated and difficult. It requires the test engineer to write a significant portion of the test script as opposed to recording it. It also means designing effective test data. Understanding what to test (having a documented set of test requirements) and designing test data that verify the requirements are the keys to writing valuable automated functional tests.

Understanding how to verify the test results is as important as knowing what to test. Automated test verification is also data dependent. As their primary verification method, automated tests frequently capture and store baseline data that are later compared against the same data captured during regression tests. More sophisticated tests access and manipulate database records before, during, and after the tests are executed.

A powerful automated testing framework must provide tools that address test planning, test design, test construction, test execution, and test results verification. An effective infrastructure is one that is predicated on an integrated central repository where testing artifacts can be stored and reused. The infrastructure should also provide customizable reporting capabilities.

We have a history prior to coauthoring this book. We met in 1996 when we worked together on the first really successful automated testing project we had encountered up to that point. Since then, we have worked together on a plethora of test automation projects. We have developed a sense of what is required to implement a successful automation project and what is required to propagate automated testing in an IS development and testing organization. We know as much about what won't work as we do about what will work.

Working together, we implemented a data-driven automated testing paradigm before we had even heard of this now prolific industry phrase (we were unaware of the paper that Richard Strang had given at the STAR conference in 1996; see the Chapter 1 references). We pioneered and perfected our implementations of the data-driven approach while others were just beginning to discuss and write about it. Of course, as with any new hot-button technology, it is not really new, just rediscovered. Data-driven testing is no exception. Beizer, in Software Testing Techniques (1983), described "Data-Base-Driven Test Design." This was late in the mainframe era and early in the PC revolution, so it was an idea related to testing mainframe applications. He presented it as a procedure not for testing the database, but for using the database structure to derive test data. He argued that it "is best suited to the verification of functional requirements as set down in the system specification." It is a simple step to expand this approach to include tests that are based on business rules supported by the database table structures. Add data that test the GUI objects and their behaviors and you have data-driven testing.

We also discovered structured test script writing (also known as framework-based testing) during this period. Again this is not new technology. Test scripts are programs written in modified versions of common programming languages such as Visual Basic and C. They are different in that they have special features to accommodate software testing tasks. There is a vast literature base that addresses structured programming concepts such as functional decomposition, module cohesion, module coupling, and modular (functional) reusability. As a test script constitutes a software program that tests another software program, it is subject to the same design and construction rules as the programs it is testing. Thus, structured programming concepts also apply to automated test scripts.

Because automated test scripts are also subject to the same baggage that other software programs carry, they can contain logic flaws; they can contain spaghetti (convoluted) code; they can contain hard-coded variables; and they can be implemented with both procedure and data in the test script itself. All of this adds up to increased costs related to test suite maintenance, just as there are costs associated with maintaining the software systems these test scripts test. Creating structured component-based test scripts that are separate from the data they execute is the only way to create an effective software test automation infrastructure, one that maximizes testing accuracy and that minimizes testing maintenance.

There have also been recent efforts to develop high-level test automation languages that can be used to design and implement automated tests by nontechnical personnel such as business and product analysts and system customers. These efforts are advocated as the next step in the evolution of automated testing. As yet, we have not seen an approach that simplifies test script development enough to be really useful. We can see the value of this as long as we are striving toward a set of universal script libraries that will support a common Java-like test scripting language; however, most frameworks to date have been written to support contrived high-level command languages, not object-oriented ones. In addition, the supporting libraries are as yet immature in the functionality they offer to the scriptwriter. To accomplish their testing needs, organizations have to add additional code to the existing library subroutines and functions.

Because we are practitioners, the aim of this book is to offer useful advice on test automation from the test automation developer's/user's perspective. It includes pragmatic advice on what to do and caveats concerning what not to do when designing and implementing a test automation infrastructure. It also contains advice on what current popular testing approaches can and cannot do for your testing endeavors.

Our examples were developed on the Rational Suite TestStudio platform, but we feel they can easily be adapted for use with other automated testing platforms. In addition, an FTP site (www.phptr.com/mosley) supports this book. That site contains template files from the Archer Group's Control Synchronized Data Driven Testing (CSDDT) approach (for the Rational environment), Carl Nagle's Data Driven Engine (DDE) approach (for the Rational environment), and Keith Zambelich's Totally Data-Driven approach using Mercury Interactive's WinRunner automated test tool, which is based on Zambelich's Test Plan Driven framework that uses his Toolkit For WinRunner. These resources can be used to easily jump-start your data-driven automated testing effort.

Read More Show Less

Introduction

Preface

There has been a glut of test automation books on the market as of late. They all espouse different approaches to, and different levels of, software test automation implementation. There is even an attempt to describe an automated software testing life cycle in the most popular offering (see the Dustin reference in Chapter 2). Traditionally, authors of information systems (IS) industry publications typically try to force a hypothetical model to describe the processes we use. Sometimes it works and sometimes it doesn't. The problem is that there is no empirical evidence to support that the approaches put into practice in these models work in the real world. The majority of the recommended approaches in software testing and software development practices are based on anecdotal evidence and project management fads that are started by so-called experts in the IS field and perpetuated by chief information officers (CIOs) in health club steam rooms.

We do not believe in an automated testing life cycle. This is an artificial construct that we find of little use. Nor do we believe in a software testing life cycle. What we do believe is that software testing occurs as a set of integrated activities in the software development process. We also believe that good software testing requires a special form of project management and its own set of operational techniques. Testing also requires a set of tools that a test engineer can rely on during test activities. These tools can be testing artifacts such as printed test scenarios that a test engineer follows or printed test logs that the engineer fills out while executing the tests.

We are not saying thatwe have to wait until a body of empirical evidence has been compiled before we accept and use the tools and techniques advocated by the IS authorities. We are saying that we have to evaluate the tools and methods ourselves and weed out the fluff. The real experiment is this: which techniques work and which do not when practitioners (you and we) attempt to use the technology.

Dan Mosley, the first author, explored his first automated testing tool back in 1985 and the technology was pretty crude. He was able to obtain an evaluation copy of that product while he was teaching one of the earliest undergraduate software testing courses (Washington University in St. Louis, 1985-1992). In the mid-1990s, he had long telephone conversations with Eric Schurr, then of Software Quality Automation (SQA), now of Rational Software Corporation, which subsequently absorbed SQA and its products, concerning automated software testing tools and what, functionally, they should provide for software test engineers' use.

They discussed what a good automation tool should do and what features it should include. Because of Dan's contacts with Eric, he acquired and used copies of SQA's (now Rational's) automated testing tool, which came out after that early Version 1.0. The most current version (at the time of this writing) is Rational Suite TestStudio 2002. Dan's experiences with this product have shown that test automation is not an easy overnight fix for a faltering testing effort. Furthermore, his experiences have proven that automated testing is not a substitute for manual testing. Glen Myers published the fundamental concepts of software testing in the late 1970s. Even today his Art of Software Testing (1979) is considered the premier dialogue on software testing. We still need to apply his recommendations when we test manually and when we build an automated testing infrastructure.

Our pet peeve with test automation as it is currently practiced is the lack of emphasis on front-end test planning and test design activities. We keep repeating the classic mistake that software developers have perpetuated since the first program was written—we start testing (in the case of automated testing, writing the test scripts) without doing the proper analysis of the problem and design of the testing infrastructure. It brings to mind a cartoon from years ago—a manager is talking to the programmer: "You start writing code and I'll go find out what it is supposed to build." Automated tests that "test" the wrong things can have only one result: unsuitable tests are executed much faster.

The ultimate goal of any automation effort should be a set of planned tests that corresponds to a set of test requirements that in turn are reflected in the automated tests. Furthermore, the heart of the testing effort is not the test scripts, but the test data. This is why there is so much hype about data-driven automated testing as an automation implementation framework. The underlying premise is that data should drive the tests and should exercise the application under test's (AUT) features. The test scripts are just delivery vehicles. Automated tests are effective only when the test data are designed well.

An operational goal of an automated testing framework is to minimize test script maintenance. The traditional capture/playback model that testing tool vendors have championed for years leads to inordinately high script maintenance because the test data are hard coded in the body of the test script. Mosley's first experiences developing automated test scripts intuitively demonstrated that strictly using capture/playback is not the way to go. Furthermore, the built-in test cases the tools provided were essentially useless for anything but testing the application's graphical user interface (GUI). True functional testing requires the test engineer to write test data that probe the AUT in depth. GUI testing should be done, and it can be automated with minimal effort. In actual practice, we usually have a single test script that exercises the GUI objects. It baselines and validates the properties of all GUI objects. The test script is executed for each GUI screen.

Automating functional testing requires sophisticated test data that explore the AUT. The test data must reproduce test scenarios that exercise important system features. Consequently, automated functional testing is more complicated and difficult. It requires the test engineer to write a significant portion of the test script as opposed to recording it. It also means designing effective test data. Understanding what to test (having a documented set of test requirements) and designing test data that verify the requirements are the keys to writing valuable automated functional tests.

Understanding how to verify the test results is as important as knowing what to test. Automated test verification is also data dependent. As their primary verification method, automated tests frequently capture and store baseline data that are later compared against the same data captured during regression tests. More sophisticated tests access and manipulate database records before, during, and after the tests are executed.

A powerful automated testing framework must provide tools that address test planning, test design, test construction, test execution, and test results verification. An effective infrastructure is one that is predicated on an integrated central repository where testing artifacts can be stored and reused. The infrastructure should also provide customizable reporting capabilities.

We have a history prior to coauthoring this book. We met in 1996 when we worked together on the first really successful automated testing project we had encountered up to that point. Since then, we have worked together on a plethora of test automation projects. We have developed a sense of what is required to implement a successful automation project and what is required to propagate automated testing in an IS development and testing organization. We know as much about what won't work as we do about what will work.

Working together, we implemented a data-driven automated testing paradigm before we had even heard of this now prolific industry phrase (we were unaware of the paper that Richard Strang had given at the STAR conference in 1996; see the Chapter 1 references). We pioneered and perfected our implementations of the data-driven approach while others were just beginning to discuss and write about it. Of course, as with any new hot-button technology, it is not really new, just rediscovered. Data-driven testing is no exception. Beizer, in Software Testing Techniques (1983), described "Data-Base-Driven Test Design." This was late in the mainframe era and early in the PC revolution, so it was an idea related to testing mainframe applications. He presented it as a procedure not for testing the database, but for using the database structure to derive test data. He argued that it "is best suited to the verification of functional requirements as set down in the system specification." It is a simple step to expand this approach to include tests that are based on business rules supported by the database table structures. Add data that test the GUI objects and their behaviors and you have data-driven testing.

We also discovered structured test script writing (also known as framework-based testing) during this period. Again this is not new technology. Test scripts are programs written in modified versions of common programming languages such as Visual Basic and C. They are different in that they have special features to accommodate software testing tasks. There is a vast literature base that addresses structured programming concepts such as functional decomposition, module cohesion, module coupling, and modular (functional) reusability. As a test script constitutes a software program that tests another software program, it is subject to the same design and construction rules as the programs it is testing. Thus, structured programming concepts also apply to automated test scripts.

Because automated test scripts are also subject to the same baggage that other software programs carry, they can contain logic flaws; they can contain spaghetti (convoluted) code; they can contain hard-coded variables; and they can be implemented with both procedure and data in the test script itself. All of this adds up to increased costs related to test suite maintenance, just as there are costs associated with maintaining the software systems these test scripts test. Creating structured component-based test scripts that are separate from the data they execute is the only way to create an effective software test automation infrastructure, one that maximizes testing accuracy and that minimizes testing maintenance.

There have also been recent efforts to develop high-level test automation languages that can be used to design and implement automated tests by nontechnical personnel such as business and product analysts and system customers. These efforts are advocated as the next step in the evolution of automated testing. As yet, we have not seen an approach that simplifies test script development enough to be really useful. We can see the value of this as long as we are striving toward a set of universal script libraries that will support a common Java-like test scripting language; however, most frameworks to date have been written to support contrived high-level command languages, not object-oriented ones. In addition, the supporting libraries are as yet immature in the functionality they offer to the scriptwriter. To accomplish their testing needs, organizations have to add additional code to the existing library subroutines and functions.

Because we are practitioners, the aim of this book is to offer useful advice on test automation from the test automation developer's/user's perspective. It includes pragmatic advice on what to do and caveats concerning what not to do when designing and implementing a test automation infrastructure. It also contains advice on what current popular testing approaches can and cannot do for your testing endeavors.

Our examples were developed on the Rational Suite TestStudio platform, but we feel they can easily be adapted for use with other automated testing platforms. In addition, an FTP site (www.phptr.com/mosley) supports this book. That site contains template files from the Archer Group's Control Synchronized Data Driven Testing (CSDDT) approach (for the Rational environment), Carl Nagle's Data Driven Engine (DDE) approach (for the Rational environment), and Keith Zambelich's Totally Data-Driven approach using Mercury Interactive's WinRunner automated test tool, which is based on Zambelich's Test Plan Driven framework that uses his Toolkit For WinRunner. These resources can be used to easily jump-start your data-driven automated testing effort.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)