logo资料库

Introduction to Software Testing 2nd Edition.pdf

第1页 / 共473页
第2页 / 共473页
第3页 / 共473页
第4页 / 共473页
第5页 / 共473页
第6页 / 共473页
第7页 / 共473页
第8页 / 共473页
资料共473页,剩余部分请下载后查看
Half-title
Title Page
Copyright Page
Contents
List of Figures
List of Tables
Preface to the Second Edition
Part 1 Foundations
1 Why Do We Test Software?
1.1 When Software Goes Bad
1.2 Goals of Testing Software
1.3 Bibliographic Notes
2 Model-Driven Test Design
2.1 Software Testing Foundations
2.2 Software Testing Activities
2.3 Testing Levels Based on Software Activity
2.4 Coverage Criteria
2.5 Model-Driven Test Design
2.5.1 Test Design
2.5.2 Test Automation
2.5.3 Test Execution
2.5.4 Test Evaluation
2.5.5 Test Personnel and Abstraction
2.6 Why MDTD Matters
2.7 Bibliographic Notes
3 Test Automation
3.1 Software Testability
3.2 Components of a Test Case
3.3 A Test Automation Framework
3.3.1 The JUnit Test Framework
3.3.2 Data-Driven Tests
3.3.3 Adding Parameters to Unit Tests
3.3.4 JUnit from the Command Line
3.4 Beyond Test Automation
3.5 Bibliographic Notes
4 Putting Testing First
4.1 Taming the Cost-of-Change Curve
4.1.1 Is the Curve Really Tamed?
4.2 The Test Harness as Guardian
4.2.1 Continuous Integration
4.2.2 System Tests in Agile Methods
4.2.3 Adding Tests to Legacy Systems
4.2.4 Weaknesses in Agile Methods for Testing
4.3 Bibliographic Notes
5 Criteria-Based Test Design
5.1 Coverage Criteria Defined
5.2 Infeasibility and Subsumption
5.3 Advantages of Using Coverage Criteria
5.4 Next Up
5.5 Bibliographic Notes
Part 2 Coverage Criteria
6 Input Space Partitioning
6.1 Input Domain Modeling
6.1.1 Interface-Based Input Domain Modeling
6.1.2 Functionality-Based Input Domain Modeling
6.1.3 Designing Characteristics
6.1.4 Choosing Blocks and Values
6.1.5 Checking the Input Domain Model
6.2 Combination Strategies Criteria
6.3 Handling Constraints Among Characteristics
6.4 Extended Example: Deriving an IDM from JavaDoc
6.4.1 Tasks in Designing IDM-Based Tests
6.4.2 Designing IDM-Based Tests for Iterator
6.5 Bibliographic Notes
7 Graph Coverage
7.1 Overview
7.2 Graph Coverage Criteria
7.2.1 Structural Coverage Criteria
7.2.2 Touring, Sidetrips, and Detours
7.2.3 Data Flow Criteria
7.2.4 Subsumption Relationships Among Graph Coverage Criteria
7.3 Graph Coverage for Source Code
7.3.1 Structural Graph Coverage for Source Code
7.3.2 Data Flow Graph Coverage for Source Code
7.4 Graph Coverage for Design Elements
7.4.1 Structural Graph Coverage for Design Elements
7.4.2 Data Flow Graph Coverage for Design Elements
7.5 Graph Coverage for Specifications
7.5.1 Testing Sequencing Constraints
7.5.2 Testing State Behavior of Software
7.6 Graph Coverage for Use Cases
7.6.1 Use Case Scenarios
7.7 Bibliographic Notes
8 Logic Coverage
8.1 Semantic Logic Coverage Criteria (Active)
8.1.1 Simple Logic Expression Coverage Criteria
8.1.2 Active Clause Coverage
8.1.3 Inactive Clause Coverage
8.1.4 Infeasibility and Subsumption
8.1.5 Making a Clause Determine a Predicate
8.1.6 Finding Satisfying Values
8.2 Syntactic Logic Coverage Criteria (DNF)
8.2.1 Implicant Coverage
8.2.2 Minimal DNF
8.2.3 The MUMCUT Coverage Criterion
8.2.4 Karnaugh Maps
8.3 Structural Logic Coverage of Programs
8.3.1 Satisfying Predicate Coverage
8.3.2 Satisfying Clause Coverage
8.3.3 Satisfying Active Clause Coverage
8.3.4 Predicate Transformation Issues
8.3.5 Side Effects in Predicates
8.4 Specification-Based Logic Coverage
8.5 Logic Coverage of Finite State Machines
8.6 Bibliographic Notes
9 Syntax-Based Testing
9.1 Syntax-Based Coverage Criteria
9.1.1 Grammar-Based Coverage Criteria
9.1.2 Mutation Testing
9.2 Program-Based Grammars
9.2.1 BNF Grammars for Compilers
9.2.2 Program-Based Mutation
9.3 Integration and Object-Oriented Testing
9.3.1 BNF Integration Testing
9.3.2 Integration Mutation
9.4 Specification-Based Grammars
9.4.1 BNF Grammars
9.4.2 Specification-Based Mutation
9.5 Input Space Grammars
9.5.1 BNF Grammars
9.5.2 Mutating Input Grammars
9.6 Bibliographic Notes
Part 3 Testing in Practice
10 Managing the Test Process
10.1 Overview
10.2 Requirements Analysis and Specification
10.3 System and Software Design
10.4 Intermediate Design
10.5 Detailed Design
10.6 Implementation
10.7 Integration
10.8 System Deployment
10.9 Operation and Maintenance
10.10 Implementing the Test Process
10.11 Bibliographic Notes
11 Writing Test Plans
11.1 Level Test Plan Example Template
11.2 Bibliographic Notes
12 Test Implementation
12.1 Integration Order
12.2 Test Doubles
12.2.1 Stubs and Mocks: Variations of Test Doubles
12.2.2 Using Test Doubles to Replace Components
12.3 Bibliographic Notes
13 Regression Testing for Evolving Software
13.1 Bibliographic Notes
14 Writing Effective Test Oracles
14.1 What Should Be Checked?
14.2 Determining Correct Values
14.2.1 Specification-Based Direct Verification of Outputs
14.2.2 Redundant Computations
14.2.3 Consistency Checks
14.2.4 Metamorphic Testing
14.3 Bibliographic Notes
List of Criteria
Bibliography
Index
Introduction to Software Testing This extensively classroom-tested text takes an innovative approach to explaining software testing that defines it as the process of applying a few precise, general-purpose criteria to a structure or model of the software. The text incorporates cutting-edge developments, including techniques to test modern types of software such as OO, web applications, and embedded software. This revised second edition significantly expands coverage of the basics, thoroughly discussing test automaton frameworks, and adds new, improved examples and numerous exercises. Key features include: The theory of coverage criteria is carefully, cleanly explained to help into practical students understand concepts before delving applications. Extensive use of the JUnit test framework gives students practical experience in a test framework popular in industry. Exercises feature specifically tailored tools that allow students to check their own work. Instructor’s manual, PowerPoint slides, testing tools for students, and example software programs in Java are available from the book’s website. Paul Ammann is Associate Professor of Software Engineering at George Mason University. He earned the Volgenau School’s Outstanding Teaching Award in 2007. He led the development of the Applied Computer Science degree, and has served as Director of the MS Software Engineering program. He has taught courses in software testing, applied object-oriented theory, formal methods for software engineering, web software, and distributed software engineering. Ammann has published more than eighty papers in software engineering, with an emphasis on software testing, security, dependability, and software engineering education. Jeff Offutt is Professor of Software Engineering at George Mason
University. He leads the MS in Software Engineering program, teaches software engineering courses at all levels, and developed new courses on several software engineering subjects. He was awarded the George Mason University Teaching Excellence Award, Teaching with Technology, in 2013. Offutt has published more than 165 papers in areas such as model- based testing, criteria-based testing, test automaton, empirical software engineering, and software maintenance. He is Editor-in-Chief of the Journal of Software Testing, Verification and Reliability; helped found the IEEE International Conference on Software Testing; and is the founder of the μJava project.
INTRODUCTION TO SOFTWARE TESTING Paul Ammann George Mason University Jeff Offutt George Mason University
University Printing House, Cambridge CB2 8BS, United Kingdom One Liberty Plaza, 20th Floor, New York, NY 10006, USA 477 Williamstown Road, Port Melbourne, VIC 3207, Australia 4843/24, 2nd Floor, Ansari Road, Daryaganj, Delhi – 110002, India 79 Anson Road, #06-04/06, Singapore 079906 Cambridge University Press is part of the University of Cambridge. It furthers the University’s mission by disseminating knowledge in the pursuit of education, learning, and research at the highest international levels of excellence. www.cambridge.org Information on this title: www.cambridge.org/9781107172012 DOI: 10.1017/9781316771273 © Paul Ammann and Jeff Offutt 2017 This publication is in copyright. Subject to statutory exception and to the provisions of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. First published 2017 Printed in the United States of America by Sheridan Books, Inc. A catalogue record for this publication is available from the British Library. Library of Congress Cataloguing in Publication Data Names: Ammann, Paul, 1961– author. — Offutt, Jeff, 1961– author. Title: Introduction to software testing / Paul Ammann, George Mason University, Jeff Offutt, George Mason University. Description: Edition 2. — Cambridge, United Kingdom; New York, NY, USA: Cambridge University Press, [2016] Identifiers: LCCN 2016032808 — ISBN 9781107172012 (hardback) Subjects: LCSH: Computer software–Testing. Classification: LCC QA76.76.T48 A56 2016 — DDC 005.3028/7–dc23 LC record available at https://lccn.loc.gov/2016032808 ISBN 978-1-107-17201-2 Hardback Additional resources for this publication at https://cs.gmu.edu/~offutt/softwaretest/. Cambridge University Press has no responsibility for the persistence or accuracy of
URLs for external or third-party Internet Web sites referred to in this publication and does not guarantee that any content on such Web sites is, or will remain, accurate or appropriate.
Contents List of Figures List of Tables Preface to the Second Edition Part 1 Foundations 1 Why Do We Test Software? 1.1 When Software Goes Bad 1.2 Goals of Testing Software 1.3 Bibliographic Notes 2 Model-Driven Test Design 2.1 Software Testing Foundations 2.2 Software Testing Activities 2.3 Testing Levels Based on Software Activity 2.4 Coverage Criteria 2.5 Model-Driven Test Design 2.5.1 Test Design 2.5.2 Test Automation 2.5.3 Test Execution 2.5.4 Test Evaluation 2.5.5 Test Personnel and Abstraction 2.6 Why MDTD Matters 2.7 Bibliographic Notes 3 Test Automation 3.1 Software Testability 3.2 Components of a Test Case 3.3 A Test Automation Framework 3.3.1 The JUnit Test Framework 3.3.2 Data-Driven Tests
3.3.3 Adding Parameters to Unit Tests 3.3.4 JUnit from the Command Line 3.4 Beyond Test Automation 3.5 Bibliographic Notes 4 Putting Testing First 4.1 Taming the Cost-of-Change Curve 4.1.1 Is the Curve Really Tamed? 4.2 The Test Harness as Guardian 4.2.1 Continuous Integration 4.2.2 System Tests in Agile Methods 4.2.3 Adding Tests to Legacy Systems 4.2.4 Weaknesses in Agile Methods for Testing 4.3 Bibliographic Notes 5 Criteria-Based Test Design 5.1 Coverage Criteria Defined 5.2 Infeasibility and Subsumption 5.3 Advantages of Using Coverage Criteria 5.4 Next Up 5.5 Bibliographic Notes Part 2 Coverage Criteria 6 Input Space Partitioning 6.1 Input Domain Modeling 6.1.1 Interface-Based Input Domain Modeling 6.1.2 Functionality-Based Input Domain Modeling 6.1.3 Designing Characteristics 6.1.4 Choosing Blocks and Values 6.1.5 Checking the Input Domain Model 6.2 Combination Strategies Criteria 6.3 Handling Constraints Among Characteristics 6.4 Extended Example: Deriving an IDM from JavaDoc 6.4.1 Tasks in Designing IDM-Based Tests 6.4.2 Designing IDM-Based Tests for Iterator 6.5 Bibliographic Notes 7 Graph Coverage
分享到:
收藏