Software Testing: A Craftsman's Approach Ment Of Model-Based Testing .

1y ago
8 Views
2 Downloads
3.05 MB
470 Pages
Last View : 30d ago
Last Download : 3m ago
Upload by : Roy Essex
Transcription

SoftwareTestingA Craftsman’s ApproachFourth EditionPaul C. Jorgensen

SoftwareTestingA Craftsman’s ApproachFourth Edition

SoftwareTestingA Craftsman’s ApproachFourth EditionPaul C. Jorgensen

CRC PressTaylor & Francis Group6000 Broken Sound Parkway NW, Suite 300Boca Raton, FL 33487-2742 2014 by Taylor & Francis Group, LLCCRC Press is an imprint of Taylor & Francis Group, an Informa businessNo claim to original U.S. Government worksVersion Date: 20130815International Standard Book Number-13: 978-1-4665-6069-7 (eBook - PDF)This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have beenmade to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyrightholders of all material reproduced in this publication and apologize to copyright holders if permission to publish in thisform has not been obtained. If any copyright material has not been acknowledged please write and let us know so we mayrectify in any future reprint.Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from thepublishers.For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. Fororganizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only foridentification and explanation without intent to infringe.Visit the Taylor & Francis Web site athttp://www.taylorandfrancis.comand the CRC Press Web site athttp://www.crcpress.com

To Carol, Kirsten, and Katia

ContentsPreface to the Fourth Edition.xixPreface to the Third Edition.xxiPreface to the Second Edition. xxiiiPreface to the First Edition. xxvAuthor.xxviiAbstract.xxixpart I A MATHEMATICAL CONTEXT1 A Perspective on Testing.31.11.21.31.4Basic Definitions. 3Test Cases. 4Insights from a Venn Diagram. 5Identifying Test Cases. 61.4.1 Specification-Based Testing. 71.4.2 Code-Based Testing. 81.4.3 Specification-Based versus Code-Based Debate. 81.5 Fault Taxonomies. 91.6 Levels of Testing. 12References.132 Examples.152.12.22.3Generalized Pseudocode.15The Triangle Problem.172.2.1 Problem Statement.172.2.2 Discussion.182.2.3 Traditional Implementation.182.2.4 Structured Implementations.21The NextDate Function. 232.3.1 Problem Statement. 232.3.2 Discussion. 232.3.3 Implementations. 24vii

viii Contents2.4The Commission Problem. 262.4.1 Problem Statement. 262.4.2 Discussion. 272.4.3 Implementation. 272.5 The SATM System. 282.5.1 Problem Statement. 292.5.2 Discussion. 302.6 The Currency Converter. 302.7 Saturn Windshield Wiper Controller.312.8 Garage Door Opener.31References.333 Discrete Math for Testers.353.1Set Theory.353.1.1 Set Membership. 363.1.2 Set Definition. 363.1.3 The Empty Set. 373.1.4 Venn Diagrams. 373.1.5 Set Operations. 383.1.6 Set Relations. 403.1.7 Set Partitions. 403.1.8 Set Identities.413.2 Functions. 423.2.1 Domain and Range. 423.2.2 Function Types. 433.2.3 Function Composition. 443.3 Relations.453.3.1 Relations among Sets.453.3.2 Relations on a Single Set. 463.4 Propositional Logic.473.4.1 Logical Operators. 483.4.2 Logical Expressions. 493.4.3 Logical Equivalence. 493.5 Probability Theory. 50Reference.524 Graph Theory for Testers.534.14.2Graphs.534.1.1 Degree of a Node. 544.1.2 Incidence Matrices.554.1.3 Adjacency Matrices. 564.1.4 Paths. 564.1.5 Connectedness.574.1.6 Condensation Graphs. 584.1.7 Cyclomatic Number. 58Directed Graphs.59

Contents ix4.2.1 Indegrees and Outdegrees. 604.2.2 Types of Nodes. 604.2.3 Adjacency Matrix of a Directed Graph.614.2.4 Paths and Semipaths. 624.2.5 Reachability Matrix. 624.2.6 n-Connectedness. 634.2.7 Strong Components. 644.3 Graphs for Testing.654.3.1 Program Graphs.654.3.2 Finite State Machines. 664.3.3 Petri Nets. 684.3.4 Event-Driven Petri Nets. 704.3.5 StateCharts. 73References. 75Part IIUNIT TESTING5 Boundary Value Testing.795.15.25.35.45.55.65.7Normal Boundary Value Testing. 805.1.1 Generalizing Boundary Value Analysis.815.1.2 Limitations of Boundary Value Analysis. 82Robust Boundary Value Testing. 82Worst-Case Boundary Value Testing. 83Special Value Testing. 84Examples.855.5.1 Test Cases for the Triangle Problem.855.5.2 Test Cases for the NextDate Function. 865.5.3 Test Cases for the Commission Problem.91Random Testing. 93Guidelines for Boundary Value Testing. 946 Equivalence Class Testing.996.16.26.3Equivalence Classes. 99Traditional Equivalence Class Testing. 100Improved Equivalence Class Testing.1016.3.1 Weak Normal Equivalence Class Testing.1026.3.2 Strong Normal Equivalence Class Testing.1026.3.3 Weak Robust Equivalence Class Testing.1036.3.4 Strong Robust Equivalence Class Testing.1046.4 Equivalence Class Test Cases for the Triangle Problem.1056.5 Equivalence Class Test Cases for the NextDate Function.1076.5.1 Equivalence Class Test Cases.1096.6 Equivalence Class Test Cases for the Commission Problem. 1116.7 Edge Testing.1136.8 Guidelines and Observations.113References. 115

x Contents7 Decision Table–Based Testing. 1177.17.27.37.4Decision Tables.117Decision Table Techniques.118Test Cases for the Triangle Problem. 122Test Cases for the NextDate Function. 1237.4.1 First Try. 1237.4.2 Second Try. 1247.4.3 Third Try. 1267.5 Test Cases for the Commission Problem. 1277.6 Cause-and-Effect Graphing. 1287.7 Guidelines and Observations. 130References.1318 Path Testing.1338.1Program Graphs.1338.1.1 Style Choices for Program Graphs.1338.2 DD-Paths. 1368.3 Test Coverage Metrics.1388.3.1 Program Graph–Based Coverage Metrics.1388.3.2 E.F. Miller’s Coverage Metrics.1398.3.2.1 Statement Testing.1398.3.2.2 DD-Path Testing.1408.3.2.3 Simple Loop Coverage.1408.3.2.4 Predicate Outcome Testing.1408.3.2.5 Dependent Pairs of DD-Paths.1418.3.2.6 Complex Loop Coverage.1418.3.2.7 Multiple Condition Coverage.1428.3.2.8 “Statistically Significant” Coverage.1428.3.2.9 All Possible Paths Coverage.1428.3.3 A Closer Look at Compound Conditions.1428.3.3.1 Boolean Expression (per Chilenski).1428.3.3.2 Condition (per Chilenski).1438.3.3.3 Coupled Conditions (per Chilenski).1438.3.3.4 Masking Conditions (per Chilenski).1448.3.3.5 Modified Condition Decision Coverage.1448.3.4 Examples.1458.3.4.1 Condition with Two Simple Conditions.1458.3.4.2 Compound Condition from NextDate.1468.3.4.3 Compound Condition from the Triangle Program.1478.3.5 Test Coverage Analyzers.1498.4 Basis Path Testing.1498.4.1 McCabe’s Basis Path Method.1508.4.2 Observations on McCabe’s Basis Path Method.1528.4.3 Essential Complexity.1548.5 Guidelines and Observations.156References.158

Contents xi9 Data Flow Testing.1599.1Define/Use Testing.1609.1.1 Example.1619.1.2 Du-paths for Stocks.1649.1.3 Du-paths for Locks.1649.1.4 Du-paths for totalLocks.1689.1.5 Du-paths for Sales.1699.1.6 Du-paths for Commission.1709.1.7 Define/Use Test Coverage Metrics.1709.1.8 Define/Use Testing for Object-Oriented Code.1729.2 Slice-Based Testing.1729.2.1 Example.1759.2.2 Style and Technique.1799.2.3 Slice Splicing.1819.3 Program Slicing Tools.182References.18310 Retrospective on Unit Testing.18510.110.210.310.4The Test Method Pendulum.186Traversing the Pendulum.188Evaluating Test Methods.193Insurance Premium Case Study.19510.4.1 Specification-Based Testing.19510.4.2 Code-Based Testing.19910.4.2.1 Path-Based Testing.19910.4.2.2 Data Flow Testing. 20010.4.2.3 Slice Testing.20110.5 Guidelines. 202References. 203Part III BEYOND UNIT TESTING11 Life Cycle–Based Testing.20711.1 Traditional Waterfall Testing. 20711.1.1 Waterfall Testing. 20911.1.2 Pros and Cons of the Waterfall Model. 20911.2 Testing in Iterative Life Cycles.21011.2.1 Waterfall Spin-Offs.21011.2.2 Specification-Based Life Cycle Models.21211.3 Agile Testing.21411.3.1 Extreme Programming.21511.3.2 Test-Driven Development.21511.3.3 Scrum.21611.4 Agile Model–Driven Development.21811.4.1 Agile Model–Driven Development.21811.4.2 Model–Driven Agile Development.218References.219

xii Contents12 Model-Based Testing.22112.1 Testing Based on Models.22112.2 Appropriate Models. 22212.2.1 Peterson’s Lattice. 22212.2.2 Expressive Capabilities of Mainline Models. 22412.2.3 Modeling Issues. 22412.2.4 Making Appropriate Choices. 22512.3 Commercial Tool Support for Model-Based Testing. 226References. 22713 Integration Testing.22913.1 Decomposition-Based Integration. 22913.1.1 Top–Down Integration. 23213.1.2 Bottom–Up Integration. 23413.1.3 Sandwich Integration.23513.1.4 Pros and Cons.23513.2 Call Graph–Based Integration. 23613.2.1 Pairwise Integration. 23713.2.2 Neighborhood Integration. 23713.2.3 Pros and Cons. 24013.3 Path-Based Integration.24113.3.1 New and Extended Concepts.24113.3.2 MM-Path Complexity. 24313.3.3 Pros and Cons. 24413.4 Example: integrationNextDate. 24413.4.1 Decomposition-Based Integration.24513.4.2 Call Graph–Based Integration.24513.4.3 MM-Path-Based Integration.25013.5 Conclusions and Recommendations.250References.25114 System Testing.25314.1 Threads.25314.1.1 Thread Possibilities. 25414.1.2 Thread Definitions.25514.2 Basis Concepts for Requirements Specification.25614.2.1 Data.25614.2.2 Actions.25714.2.3 Devices.25714.2.4 Events.25814.2.5 Threads.25914.2.6 Relationships among Basis Concepts.25914.3 Model-Based Threads.25914.4 Use Case–Based Threads. 26414.4.1 Levels of Use Cases. 26414.4.2 An Industrial Test Execution Sys

This updated and reorganized fourth edition of Software Testing: A Craftsman's Approach applies the strong mathematics content of previous editions to a coherent treat - ment of Model-Based Testing for both code-based (structural) and specification-based (functional) testing. These techniques are extended from the usual unit testing discussions

Related Documents:

7 ridgid 535 pipe threader 8 ridgid manual pipe threader & die holders 9 ridgid pipe cutter & reamers 10 ridgid pipe stand w/ vise 11 ryobi 14" chop saw 12 black & decker jigsaw 13 craftsman jigsaw 14 craftsman jigsaw 15 sawcat 7 1/4" circular saw 16 craftsman jigsaw 17 milwaukee portable bandsaw 18 dewalt reciprocating saw

CRAFTSMAN 41" 8-Drawer Heavy Duty Steel Top Tool Chest, Both w/Large Assortment of CRAFTSMAN Combo Wrenches & Socket Wrenches, Sockets, Tap & Die Sets, Drill Bits f/Drill Press, Auto Elec Tools, Misc Hand Tools (Some UNUSED Tools) _ _ _ 1 A 36 CRAFTSMAN 26" 4-Drawer Heavy Duty Rolling Cabinet, (1) CRAFTSMAN 26" 5-Drawer Heavy Duty .

Clipped-Gabled (or Hip on Gable) Craftsman - A Craftsman building covered by a gabled roof which has had its gable point "clipped off." The roof can be front, side or cross-gabled. Typically this type of Craftsman is a one-story building. Sometimes the clipped-gabled roof will have gabled, hipped or eyebrow dormers. Front Clipped-Gabled Roof

Software Engineering & Systems Development This updated and reorganized fourth edition of Software Testing: A Craftsman’s Approach applies the strong mathematics content of previous editions to a coherent treat - ment of Model-Based Testing

1.1 Software testing This document describes the structured testing methodology for software testing. Software testing is the process of executing software and comparing the observed behavior to the desired behavior. The major goal of software testing

The download includes an easy-to-use estimating program . Looking for Other Construction Reference Manuals? Craftsman has the books to fill your needs. Call 1-800-829-8123 or write to: Craftsman Book Company, 6058 Corte del Cedro, Carlsbad, CA 92011 for a Free Catalog of over 100 books, including how-to manuals, annual cost books, and .

For one year from the date of purchase, when this Craftsman Edger is maintained, lu-bricated, and tuned up according to the operating and maintenance instructions in the owner's manual, Craftsman will repair, free of charge, any defect in material or work-manship. If this Craftsman Edger is used for commercial or rental purposes, this warranty ap-

Reading Comprehension Practice Test . 1. Questions 1-7. In the sixteenth century, an age of great marine and terrestrial exploration, Ferdinand Magellan led the first expedition to sail around the world. As a young Portuguese noble, he served the king of Portugal, but he became involved in the quagmire of political intrigue at court and lost the king's favor. After he was dismissed from .