SOFTWARE TESTING. A Craftsmcm's Approach THIRD EDITION. Paul C. Jorgensen. Auerbach Publications. Taylor &. Francis Croup. Boca Raton New York



Similar documents
Engineering Design. Software. Theory and Practice. Carlos E. Otero. CRC Press. Taylor & Francis Croup. Taylor St Francis Croup, an Informa business

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Management. Project. Software. Ashfaque Ahmed. A Process-Driven Approach. CRC Press. Taylor Si Francis Group Boca Raton London New York

SOFTWARE TESTING AS A SERVICE

Advances in Network Management

CHAPMAN & HALL/CRC INNOVATIONS IN SOFTWARE ENGINEERING AND SOFTWARE DEVELOPMENT. Software Test Attacks to Break Mobile and Embedded Devices

Improving Business Process Performance

Ctfo MANAGEMENT SECURITY PATCH. Felicia M. Nicastro. Second Edition. CRC Press. VC#*' J Taylor & Francis Group / Boca Raton London New York

SECOND EDITION THE SECURITY RISK ASSESSMENT HANDBOOK. A Complete Guide for Performing Security Risk Assessments DOUGLAS J. LANDOLL

BUSINESS ANALYSIS FDR INTELLIGENCE

Development and Management

Mining. Practical. Data. Monte F. Hancock, Jr. Chief Scientist, Celestech, Inc. CRC Press. Taylor & Francis Group

Parallel Computing for Data Science

Medical Device Software Verification, Validation, and Compliance

RESILIENT. SECURE and SOFTWARE. Requirements, Test Cases, and Testing Methods. Mark S. Merkow and Lakshmikanth Raghavan. CRC Press

THE COMPLETE PROJECT MANAGEMENT METHODOLOGY AND TOOLKIT

Quality Management. Theory and Application PETER D. MAUCH. Ltfi) CRC Press. \ V J Taylor & Francis Group. ^ ^ Boca Raton London New York

Implementation. Business-Driven IT-Wide Agile (Scrum) and Kanban (Lean) Andrew T. Pham and David K. Pham. An Action Guide for Business and IT Leaders

Workflow Administration of Windchill 10.2

Cloud Computing. and Scheduling. Data-Intensive Computing. Frederic Magoules, Jie Pan, and Fei Teng SILKQH. CRC Press. Taylor & Francis Group

Implementing the Project Management Balanced Scorecard

Detection. Perspective. Network Anomaly. Bhattacharyya. Jugal. A Machine Learning »C) Dhruba Kumar. Kumar KaKta. CRC Press J Taylor & Francis Croup

Software Engineering. Software Testing. Based on Software Engineering, 7 th Edition by Ian Sommerville

Management. ITIL Release. Dave Howard. A Hands-on Guide. CRC Press. Taylor & Francis Group. Taylor St Francis Croup, an Informa business

vii TABLE OF CONTENTS CHAPTER TITLE PAGE DECLARATION DEDICATION ACKNOWLEDGEMENT ABSTRACT ABSTRAK

for Research and Guiding Innovation for Positive R&D Outcomes Lory Mitchell Wingate

Networking. Systems Design and. Development. CRC Press. Taylor & Francis Croup. Boca Raton London New York. CRC Press is an imprint of the

Engineering. Software. Eric J. Braude. Michael E. Bernstein. Modern Approaches UNIVERSITATSBIBLIOTHEK HANNOVER ' TECHNISCHE INFORM ATIONSBIBLIOTHEK

Obj ect-oriented Construction Handbook

LabVIEW Advanced Programming Techniques

Exploratory Data Analysis with MATLAB

Domains and Competencies

How To Write A Diagram

Requirements Engineering for Software

Schneps, Leila; Colmez, Coralie. Math on Trial : How Numbers Get Used and Abused in the Courtroom. New York, NY, USA: Basic Books, p i.

Business Administration of Windchill PDMLink 10.0

CLINICAL DATA MANAGEMENT

Formal Software Testing. Terri Grenda, CSTE IV&V Testing Solutions, LLC

Customer and Business Analytic

IMPROVEMENT THE PRACTITIONER'S GUIDE TO DATA QUALITY DAVID LOSHIN

CREATING A THIRD EDITION DAVID MANN

Networking. Cloud and Virtual. Data Storage. Greg Schulz. Your journey. effective information services. to efficient and.

Programming and Software Development CTAG Alignments

Project Management Concepts, Methods, and Techniques

Object-Oriented Systems Analysis and Design

Study Guide. ScrumMaster. The. James Schiel. CRC Press. Taylor & Francis Croup, an Inform* business AN AUERBACH BOOK. CRC Press (s an imprint of the

Principles of Distributed Database Systems

How To Test Automatically

METHODS IN MEDICAL INFORMATICS

Karunya University Dept. of Information Technology

Deliuery Networks. A Practical Guide to Content. Gilbert Held. Second Edition. CRC Press. Taylor & Francis Group

A Simulation-Based lntroduction Using Excel

Project Management Using Earned Value

Business Architecture

Design methods. List of possible design methods. Functional decomposition. Data flow design. Functional decomposition. Data Flow Design (SA/SD)

Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools

Open Source Data Warehousing and Business Intelligence

Lean Management System LMS:2OI2

Business Information Systems and Technology

Information Technology and Organizational Learning

Introduction to Supply Chain Management Technologies

OPENTRACK: Simulation of complex nodes

Body of Knowledge General Knowledge (16 questions) Quality principles Benefits of software quality Organizational and process benchmarking

ANDROID SECURITY ATTACKS AND DEFENSES ABHISHEK DUBEY I ANMOL MISRA. ( r öc) CRC Press VV J Taylor & Francis Group ^ "^ Boca Raton London New York

Contents. iii. ix xi xi xi xiii xiii xiii xiv xv xvi xvii xix

Certified Tester. Advanced Level Overview

Certified Software Quality Engineer (CSQE) Body of Knowledge

C ONTENTS. Acknowledgments

CS314: Course Summary

Data Algorithms. Mahmoud Parsian. Tokyo O'REILLY. Beijing. Boston Farnham Sebastopol

Contents. Preface Acknowledgements. Chapter 1 Introduction 1.1

Windchill PDMLink Curriculum Guide

1 of 7 31/10/ :34

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

Agile Software Development

Governance Simplified

Alabama Department of Postsecondary Education

Software Implementation Technology report

Manage Software Development in LabVIEW with Professional Tools

Course Syllabus For Operations Management. Management Information Systems

The Green and Virtual Data Center

Software Requirements, Third Edition

Chapter 11, Testing, Part 2: Integration and System Testing

Expert PHP and MySQL. Application Desscpi and Development. Apress" Marc Rochkind

Security Metrics. A Beginner's Guide. Caroline Wong. Mc Graw Hill. Singapore Sydney Toronto. Lisbon London Madrid Mexico City Milan New Delhi San Juan

VISUALIZING DATA POWER VIEW. with MICROSOFT. Brian Larson. Mark Davis Dan English Paui Purington. Mc Grauu. Sydney Toronto

How To Understand The Software Development Lifecycle

Testing. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies. CHAPTER AUTHORS Michael Atmadja Zhang Shuai Richard

Production and Operations. Management Systems

Agile! Springer. The Good, the Hype and the Ugly. Bertrand Meyer

Introduction to Software Testing Chapter 8.1 Building Testing Tools Instrumentation. Chapter 8 Outline

Using Library Dependencies for Clustering

Transcription:

SOFTWARE TESTING A Craftsmcm's Approach THIRD EDITION Paul C. Jorgensen A Auerbach Publications Taylor &. Francis Croup Boca Raton New 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 PART I: A MATHEMATICAL CONTEXT 1 A Perspective on Testing 3 1.1 Basic Definitions 3 1.2 Test Cases 5 1.3 Insights from a Venn Diagram 6 1.4 Identifying Test Cases 7 1.4.1 Functional Testing 7 1.4.2 Structural Testing 8 1.4.3 The Functional versus Structural Debate 9 1.5 Error and Fault Taxonomies 10 1.6 Levels of Testing 12 References 13 Exercises 14 2 Examples 15 2.1 Generalized Pseudocode 15 2.2 The Triangle Problem 16 2.2.1 Problem Statement 16 2.2.2 Discussion 17 2.2.3 Traditional Implementation 17 2.2.4 Structured Implementation 19 2.3 The NextDate Function 22 2.3.1 Problem Statement 22 2.3.2 Discussion 22 2.3.3 Implementation 23 2.4 The Commission Problem 26 2.4.1 Problem Statement 26 2.4.2 Discussion 26 2.4.3 Implementation 26 vii

viii Contents 2.5 The SATM System 27 2.5.1 Problem Statement 28 2.5.2 Discussion 30 2.6 The Currency Converter 30 2.7 Saturn Windshield Wiper Controller 31 References 31 Exercises 31 3 Discrete Math for Testers 33 3.1 Set Theory 33 3.1.1 Set Membership 34 3.1.2 Set Definition 34 3.1.3 The Empty Set 35 3.1.4 Venn Diagrams 35 3.1.5 Set Operations 36 3.1.6 Set Relations 37 3.1.7 Set Partitions 38 3.1.8 Set Identities 39 3.2 Functions 39 3.2.1 Domain and Range 40 3.2.2 Function Types 40 3.2.3 Function Composition 41 3.3 Relations 42 3.3.1 Relations among Sets 43 3.3.2 Relations on a Single Set., 44 3.4 Propositional Logic 45 3.4.1 Logical Operators 45 3.4.2 Logical Expressions 46 3.4.3 Logical Equivalence 47 3.5 Probability Theory 47 Reference 49 Exercises 49 4 Graph Theory for Testers 51 4.1 Graphs 51 4.1.1 Degree of a Node 52 4.1.2 Incidence Matrices 53 4.1.3 Adjacency Matrices 53 4.1.4 Paths 54 4.1.5 Connectedness 55 4.1.6 Condensation Graphs 55 4.1.7 Cyclomatic Number 56 4.2 Directed Graphs 56 4.2.1 Indegrees and Outdegrees 57 4.2.2 Types ofnodes 58 4.2.3 Adjacency Matrix of a Directed Graph 58 4.2.4 Paths and Semipaths 59 4.2.5 Reachability Matrix 59

Contents ix 4.2.6 n-connectedness 60 4.2.7 Strong Components 60 4.3 Graphs for Testing 62 4.3.1 Program Graphs 62 4.3.2 Finite State Machines 63 4.3.3 Petri Nets 64 4.3.4 Event-Driven Petri Nets 61 4.3.5 StateCharts 69 References 72 Exercises 72 PART II: FUNCTIONAL TESTING 5 Boundary Value Testing 75 5.1 Boundary Value Analysis 75 5.1.1 Generalizing Boundary Value Analysis 76 5.1.2 Limitations of Boundary Value Analysis 77 5.2 Robustness Testing 78 5.3 Worst-Case Testing 79 5.4 Special Value Testing 80 5.5 Examples 80 5.5.1 Test Cases for the Triangle Problem 81 5.5.2 Test Cases for the NextDate Function 82 5.5.3 Test Cases for the Commission Problem 82 5.6 Random Testing 84 5.7 Guidelines for Boundary Value Testing 86 Exercises 87 6 Equivalence Class Testing 89 6.1 Equivalence Classes 89 6.1.1 Weak Normal Equivalence Class Testing 90 6.1.2 Strong Normal Equivalence Class Testing 91 6.1.3 Weak Robust Equivalence Class Testing 91 6.1.4 Strong Robust Equivalence Class Testing 92 6.2 Equivalence Class Test Cases for the Triangle Problem 93 6.3 Equivalence Class Test Cases for the NextDate Function 95 6.3.1 Equivalence Class Test Cases 97 6.4 Equivalence Class Test Cases for the Commission Problem 98 6.4.1 Output Range Equivalence Class Test Cases 100 6.5 Guidelines and Observations 101 References 101 Exercises 101 7 Decision Table-Based Testing 103 7.1 Decision Tables 103 7.1.1 Technique 104 7.2 Test Cases for the Triangle Problem 108

x Contents 7.3 Test Cases for the NextDate Function 109 7.3.1 First Try 109 73.2 SecondTry 110 7.3.3 Third Try 111 7.4 Test Cases for the Commission Problem 114 7.5 Guidelines and Observations 114 References 115 Exercises 115 8 Retrospective on Functional Testing 117 8.1 Testing Effort 117 8.2 Testing Efficiency 120 8.3 Testing Effectiveness 121 8.4 Guidelines 122 8.5 Case Study 123 PART III: STRUCTURAL TESTING 9 Path Testing 131 9.1 DD-Paths 132 9.2 Test Coverage Metrics 136 9.2.1 Metric-Based Testing 137 9.2.2 Test Coverage Analyzers 139 9.3 Basis Path Testing 139 9.3.1 McCabe's Basis Path Method 139 9.3.2 Observations on McCabe's Basis Path Method 142 9.3.3 Essential Complexity 143 9.4 Guidelines and Observations 146 References 148 Exercises 148 10 Dataflow Testing 151 10.1 Define/Use Testing 152 10.1.1 Example 153 10.1.2 du-paths for Stocks 156 10.1.3 du-paths for Locks 156 10.1.4 du-paths for totallocks 156 10.1.5 du-paths for Sales 157 10.1.6 du-paths for Commission 158 10.1.7 du-path Test Coverage Metrics 160 10.2 Slice-Based Testing 161 10.2.1 Example 162 10.2.2 Style and Technique 165 10.3 Guidelines and Observations 166 References 167 Exercises 167

Contents xi 11 Retrospective on Structural Testing 169 11.1 Gaps and Redundancies 170 11.2 Metrics for Method Evaluation 172 11.3 Case Study Revisited 174 11.3.1 Path-Based Testing 175 11.3.2 Dataflow Testing 177 11.3.3 Slice Testing 177 References 177 Exercises 178 PART IV: INTEGRATION AND SYSTEM TESTING 12 Levels of Testing 181 12.1 Traditional View of Testing Levels 181 12.2 Alternative Life Cycle Models 183 12.2.1 Waterfall Spin-Offs 183 12.2.2 Specification-Based Life Cycle Models 184 12.3 Tfie SATM System 186 12.4 Separating Integration and System Testing 196 12.4.1 Structural Insights 197 12.4.2 Behavioral Insights 198 References 199 13 Integration Testing 201 13.1 A Closer Look at the SATM System 203 13.2 Decomposition-Based Integration 205 13.2.1 Top-Down Integration 206 13.2.2 Bottom-Up Integration 207 13.2.3 Sandwich Integration 208 13.2.4 Pros and Cons 208 13.3 Call Graph-Based Integration 209 13.3.1 Pairwise Integration 209 13.3.2 Neighborhood Integration 210 13.3.3 Pros and Cons 212 13.4 Path-Based Integration 212 13.4.1 New and Extended Concepts 213 13.4.2 MM-Paths in the SATM System 216 13.4.3 MM-Path Complexity 220 13.4.4 Pros and Cons 220 13.5 Case Study 221 13.5.1 Decomposition-Based Integration 225 13.5.2 Call Graph-Based Integration 225 13.5.3 MM-Path-Based Integration 226 References 227 Exercises 227

xii Contents 14 System Testing 229 14.1 Threads 229 14.1.1 Thread Possibilities 230 14.1.2 Thread Definitions 231 14.2 Basis Concepts for Requirements Specification 233 14.2.1 Data 233 14.2.2 Actions 233 14.2.3 Devices 234 14.2.4 Events 234 14.2.5 Threads 234 14.2.6 Relationships among Basis Concepts 235 14.2.7 Modeling with Basis Concepts 235 14.3 Finding Threads 237 14.4 Structural Strategies for Thread Testing 240 14.4.1 Bottom-Up Threads 240 14.4.2 Node and Edge Coverage Metrics 242 14.5 Functional Strategies for Thread Testing 244 14.5.1 Event-Based Thread Testing 244 14.5.2 Port-Based Thread Testing 246 14.5.3 Data-Based Thread Testing 246 14.6 SATM Test Threads 248 14.7 System Testing Guidelines 253 14.7.1 Pseudostructural System Testing 253 14.7.2 Operational Profiles 254 14.7.3 Progression vs. Regression Testing 256 14.8 ASF Testing Example 257 References 259 Exercises 259 15 Interaction Testing 261 15.1 Context of Interaction 261 15.2 ATaxonomy of Interactions 263 15.2.1 Static Interactions in a Single Processor 264 15.2.2 Static Interactions in Multiple Processors 265 15.2.3 Dynamic Interactions in a Single Processor 266 15.2.4 Dynamic Interactions in Multiple Processors 271 15.3 Interaction, Composition, and Determinism 277 15.4 Client/Server Testing 280 References 281 Exercises 282 PART V: OBJECT-ORIENTED TESTING 16 Issues in Object-Oriented Testing 285 16.1 Units for Object-Oriented Testing 286 16.2 Implications of Composition and Encapsulation 286

Contents xiii 16.3 Implications of Inheritance 288 16.4 Implications of Polymorphism 289 16.5 Levels of Object-Oriented Testing 289 16.6 GUI Testing 289 16.7 Dataflow Testing for Object-Oriented Software 290 16.8 Examples for Part V 290 16.8.1 The Object-Oriented Calendar 290 16.8.2 The Currency Conversion Application 291 References 296 Exercises 296 17 Class Testing 297 17.1 Methods as Units 297 17.1.1 Pseudocode for o-ocalendar 298 17.1.1.1 Class: CalendarUnit 300 17.1.1.2 Class: testlt 300 17.1.1.3 Class: Date 301 17.1.1.4 Class: Day 301 17.1.1.5 Class: Month 302 17.1.1.6 Class: Year... 303 17.1.2 Unit Testing for Date.increment 304 17.2 Classes as Units 304 17.2.1 Pseudocode for the windshieldwiper Class 304 17.2.2 Unit Testing for the windshieldwiper Class 305 18 Object-Oriented Integration Testing 311 18.1 UML Support for Integration Testing 311 18.2 MM-Paths for Object-Oriented Software 313 18.2.1 Pseudocode for o-ocalendar 314 18.3 A Framework for Object-Oriented Dataflow Integration Testing 321 18.3.1 Event- and Message-Driven Petri Nets 321 18.3.2 Inheritance-Induced Dataflow 323 18.3.3 Message-Induced Dataflow 323 18.3.4 Slices? 323 Reference 324 Exercises 324 19 GUI Testing 327 19.1 The Currency Conversion Program 327 19.2 Unit Testing for the Currency Conversion Program 327 19.3 Integration Testing for the Currency Conversion Program 328 19.4 System Testing for the Currency Conversion Program 330 Exercises 336 20 Object-Oriented System Testing 337 20.1 Currency Converter UML Description 337 20.1.1 Problem Statement 337 20.1.2 System Functions 338

xiv Contents 20.1.3 Presentation Layer 338 20.1.4 High-Level Use Cases 339 20.1.5 Essential Use Cases 339 20.1.6 Detailed GUI Definition 341 20.1.7 Expanded Essential Use Cases 341 20.1.8 Real Use Cases 346 20.2 UML-Based System Testing 346 20.3 StateChart-Based System Testing 349 References 349 PART VI: MILLENNIUM TESTING 21 Exploratory Testing 353 21.1 The Context-Driven School 353 21.2 Exploring Exploratory Testing 354 21.3 Exploring a Familiär Example 356 21.4 Exploratory and Context-Driven Testing Observations 358 References 358 Exercises 359 22 Model-Based Testing 361 22.1 Testing Based on Models 361 22.2 Appropriate Models 362 22.2.1 Peterson's Lattice 362 22.2.2 Expressive Capabilities of Mainline Models 363 22.2.3 Making Appropriate Choices 363 22.3 Use Case-Based Testing 364 22.3.1 Deriving Test Cases from Use Cases 365 22.3.2 Interacting Use Cases 365 22.3.3 How Many Use Cases? 367 22.4 Commercial Tool Support for Model-Based Testing 367 References 368 23 Test-Driven Development 369 23.1 Test-Then-Code Cycles 369 23.2 Automated Test Execution (Testing Frameworks) 378 23.3 Java andjunit Example 379 23.3.1 Java Source Code 379 23.3.2 JUnit Test Code 382 23.4 Remaining Questions 383 23.4.1 Specification Based or Code Based? 383 23.4.2 Configuration Management? 384 23.4.3 Granularity? 385 23.5 Pros, Cons, and Open Questions of TDD 385 23.6 Retrospective on MDD versus TDD 386

Contents xv 24 A Closer Look at All Pairs Testing 391 24.1 The All Pairs Technique 391 24.1.1 Program Inputs 392 24.1.2 Independent Variables 394 24.1.3 Input Order 396 24.1.4 Failures Due Only to Pairs of Inputs 397 24.2 A Closer Look at the NIST Study 399 24.3 Appropriate Applications for All Pairs Testing 400 24.4 Recommendations for All Pairs Testing 401 References 401 25 Epilogue: Software Testing Excellence 403 25.1 Craftsmanship 403 25.2 Best Practices of Software Testing 404 25.3 Top 10 Best Practices for Software Testing Excellence 405 25.3.1 Model-Driven Development 405 25.3.2 Careful Definition and Identification of Levels of Testing 406 25.3.3 System-Level Model-Based Testing 406 25.3.4 System Testing Extensions 406 25.3.5 Incidence Matrices to Guide Regression Testing 406 25.3.6 Use of MM-Paths for Integration Testing 406 25.3.7 Intelligent Combination of Specification-Based and Code-Based Unit-Level Testing 407 25.3.8 Code Coverage Metrics Based on the Nature of Individual Units 407 25.3.9 Exploratory Testing during Maintenance 407 25.3.10 Test-Driven Development 407 25.4 Mapping Best Practices to Diverse Projects 407 25.4.1 A Mission-Critical Project 407 25.4.2 A Time-Critical Project 407 25.4.3 Corrective Maintenance of Legacy Code 408 Reference 408 Index, 409