Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A Craftsmcm's Approach
THIRD EDITION
Paul C. Jorgensen
Auerbach Publications
Taylor &. Francis C r o u p
Boca Raton N e w York
Auerbach Publications is an imprint of the Taylor & Francis Group, an informa business
Contents
Preface to the Third Edirion Preface to the Second Edition Preface to the First Edition The Author xvii xix xxi xxiii
viii
Contents
2.5
The SATM System 2.5.1 Problem Statement 2.5.2 Discussion 2.6 The Currency Converter 2.7 Saturn Windshield Wiper Controller References Exercises
27 28 30 30 31 31 31 33 33 34 34 35 35 36 37 38 39 39 40 40 41 42 43 44 45 45 46 47 47 49 49 51 51 52 53 53 54 55 55 56 56 57 58 58 59 59
Discrete Math for Testers 3.1 Set Theory 3.1.1 Set Membership 3.1.2 Set Definition 3.1.3 The Empty Set 3.1.4 Venn Diagrams 3.1.5 Set Operations 3.1.6 Set Relations 3.1.7 Set Partitions 3.1.8 Set Identities 3.2 Functions 3.2.1 Domain and Range 3.2.2 Function Types 3.2.3 Function Composition 3.3 Relations 3.3.1 Relations among Sets 3.3.2 Relations on a Single Set., 3.4 Propositional Logic 3.4.1 Logical Operators 3.4.2 Logical Expressions 3.4.3 Logical Equivalence 3.5 Probability Theory Reference Exercises Graph Theory for Testers 4.1 Graphs 4.1.1 Degree of a Node 4.1.2 Incidence Matrices 4.1.3 Adjacency Matrices 4.1.4 Paths 4.1.5 Connectedness 4.1.6 Condensation Graphs 4.1.7 Cyclomatic Number 4.2 Directed Graphs 4.2.1 Indegrees and Outdegrees 4.2.2 Types ofNodes 4.2.3 Adjacency Matrix of a Directed Graph 4.2.4 Paths and Semipaths 4.2.5 Reachability Matrix
Contents
ix
4.2.6 n-Connectedness 4.2.7 Strong Components 4.3 Graphs for Testing 4.3.1 Program Graphs 4.3.2 Finite State Machines 4.3.3 Petri Nets 4.3.4 Event-Driven Petri Nets 4.3.5 StateCharts References Exercises
60 60 62 62 63 64 61 69 72 72
Contents
Test Cases for the NextDate Function 7.3.1 First Try 73.2 SecondTry 7.3.3 Third Try 7.4 Test Cases for the Commission Problem 7.5 Guidelines and Observations References Exercises 8 Retrospective on Functional Testing 8.1 Testing Effort 8.2 Testing Efficiency 8.3 Testing Effectiveness 8.4 Guidelines 8.5 Case Study
7.3
109 109 110 111 114 114 115 115 117 117 120 121 122 123
10
Contents
xi
11
Retrospective on Structural Testing 11.1 Gaps and Redundancies 11.2 Metrics for Method Evaluation 11.3 Case Study Revisited 11.3.1 Path-Based Testing 11.3.2 Dataflow Testing 11.3.3 Slice Testing References Exercises
13
xii
Contents
14
System Testing 14.1 Threads 14.1.1 Thread Possibilities 14.1.2 Thread Definitions 14.2 Basis Concepts for Requirements Specification 14.2.1 Data 14.2.2 Actions 14.2.3 Devices 14.2.4 Events 14.2.5 Threads 14.2.6 Relationships among Basis Concepts 14.2.7 Modeling with Basis Concepts 14.3 Finding Threads 14.4 Structural Strategies for Thread Testing 14.4.1 Bottom-Up Threads 14.4.2 Node and Edge Coverage Metrics 14.5 Functional Strategies for Thread Testing 14.5.1 Event-Based Thread Testing 14.5.2 Port-Based Thread Testing 14.5.3 Data-Based Thread Testing 14.6 SATM Test Threads 14.7 System Testing Guidelines 14.7.1 Pseudostructural System Testing 14.7.2 Operational Profiles 14.7.3 Progression vs. Regression Testing 14.8 ASF Testing Example References Exercises Interaction Testing 15.1 Context of Interaction 15.2 ATaxonomy of Interactions 15.2.1 Static Interactions in a Single Processor 15.2.2 Static Interactions in Multiple Processors 15.2.3 Dynamic Interactions in a Single Processor 15.2.4 Dynamic Interactions in Multiple Processors 15.3 Interaction, Composition, and Determinism 15.4 Client/Server Testing References Exercises
229 229 230 231 233 233 233 234 234 234 235 235 237 240 240 242 244 244 246 246 248 253 253 254 256 257 259 259 261 261 263 264 265 266 271 277 280 281 282
15
Contents
xiii
Implications of Inheritance Implications of Polymorphism Levels of Object-Oriented Testing GUI Testing Dataflow Testing for Object-Oriented Software Examples for Part V 16.8.1 The Object-Oriented Calendar 16.8.2 The Currency Conversion Application References Exercises 17 Class Testing 17.1 Methods as Units 17.1.1 Pseudocode for o-oCalendar 17.1.1.1 Class: CalendarUnit 17.1.1.2 Class: testlt 17.1.1.3 Class: Date 17.1.1.4 Class: Day 17.1.1.5 Class: Month 17.1.1.6 Class: Year.... 17.1.2 Unit Testing for Date.increment 17.2 Classes as Units 17.2.1 Pseudocode for the windshieldWiper Class 17.2.2 Unit Testing for the windshieldWiper Class Object-Oriented Integration Testing 18.1 U M L Support for Integration Testing 18.2 MM-Paths for Object-Oriented Software 18.2.1 Pseudocode for o-oCalendar 18.3 A Framework for Object-Oriented Dataflow Integration Testing 18.3.1 Event- and Message-Driven Petri Nets 18.3.2 Inheritance-Induced Dataflow 18.3.3 Message-Induced Dataflow 18.3.4 Slices? Reference Exercises GUI Testing 19.1 The Currency Conversion Program 19.2 Unit Testing for the Currency Conversion Program 19.3 Integration Testing for the Currency Conversion Program 19.4 System Testing for the Currency Conversion Program Exercises Object-Oriented System Testing 20.1 Currency Converter U M L Description 20.1.1 Problem Statement 20.1.2 System Functions
288 289 289 289 290 290 290 291 296 296 297 297 298 300 300 301 301 302 303 304 304 304 305 311 311 313 314 321 321 323 323 323 324 324 327 327 327 328 330 336 337 337 337 338
18
19
20
xiv
Contents
20.1.3 Presentation Layer 20.1.4 High-Level Use Cases 20.1.5 Essential Use Cases 20.1.6 Detailed GUI Definition 20.1.7 Expanded Essential Use Cases 20.1.8 Real Use Cases 20.2 UML-Based System Testing 20.3 StateChart-Based System Testing References
22
23
Contents
xv
24
A Closer Look at All Pairs Testing 24.1 The All Pairs Technique 24.1.1 Program Inputs 24.1.2 Independent Variables 24.1.3 Input Order 24.1.4 Failures Due Only to Pairs of Inputs 24.2 A Closer Look at the NIST Study 24.3 Appropriate Applications for All Pairs Testing 24.4 Recommendations for All Pairs Testing References Epilogue: Software Testing Excellence 25.1 Craftsmanship 25.2 Best Practices of Software Testing 25.3 Top 10 Best Practices for Software Testing Excellence 25.3.1 Model-Driven Development 25.3.2 Careful Definition and Identification of Levels of Testing 25.3.3 System-Level Model-Based Testing 25.3.4 System Testing Extensions 25.3.5 Incidence Matrices to Guide Regression Testing 25.3.6 Use of MM-Paths for Integration Testing 25.3.7 Intelligent Combination of Specification-Based and Code-Based Unit-Level Testing 25.3.8 Code Coverage Metrics Based on the Nature of Individual Units 25.3.9 Exploratory Testing during Maintenance 25.3.10 Test-Driven Development 25.4 Mapping Best Practices to Diverse Projects 25.4.1 A Mission-Critical Project 25.4.2 A Time-Critical Project 25.4.3 Corrective Maintenance of Legacy Code Reference Index,
391 391 392 394 396 397 399 400 401 401 403 403 404 405 405 406 406 406 406 406 407 407 407 407 407 407 407 408 408 409
25