Book contents
- Frontmatter
- Contents
- Preface
- Acknowledgments
- I Overview
- II Systems with Finite Models
- 5 Model Programs
- 6 Exploring and Analyzing Finite Model Programs
- 7 Structuring Model Programs with Features and Composition
- 8 Testing Closed Systems
- 9 Further Reading
- III Systems with Complex State
- IV Advanced Topics
- V Appendices
- Bibliography
- Index
8 - Testing Closed Systems
Published online by Cambridge University Press: 02 March 2010
- Frontmatter
- Contents
- Preface
- Acknowledgments
- I Overview
- II Systems with Finite Models
- 5 Model Programs
- 6 Exploring and Analyzing Finite Model Programs
- 7 Structuring Model Programs with Features and Composition
- 8 Testing Closed Systems
- 9 Further Reading
- III Systems with Complex State
- IV Advanced Topics
- V Appendices
- Bibliography
- Index
Summary
In this chapter we introduce model-based testing. We test the client/server implementation we described in Chapter 2, and reveal the defect we discussed there. We generate the test suite and check the results with the model program we developed in Chapter 5, Section 5.6. We introduce our test generator tool otg and our test runner tool ct, and show how to write a test harness that connects an implementation to the ct tool.
In this chapter we describe offline test generation, where test suites are generated before running the tests. Offline test generation works best with finite model programs that can be explored completely. In Chapter 12 we introduce on-the-fly testing, where the test case is generated as the test executes. On-the-fly testing is an attractive alternative for “infinite” model programs that cannot be explored completely.
In this chapter we test closed systems where the tester controls every action. In Chapter 16 we test reactive systems, where some actions are invoked by the environment.
Offline test generation
The offline test generator otg explores a model program to create a finite state machine (FSM), traverses paths through the FSM, and saves the paths in a file so they can be used later. The paths define a collection of program runs. The collection is called a test suite; each run in the collection is a test case. Later, the implementation can execute the test suite, under the control of a test runner.
- Type
- Chapter
- Information
- Model-Based Software Testing and Analysis with C# , pp. 137 - 149Publisher: Cambridge University PressPrint publication year: 2007