Requirements-Based Testing - Cause-Effect Graphing. Gary E. Mogyorodi, B.Math., M.B.A. Principal Consultant. Software Testing Services



Similar documents
Requirements-Based Testing Ambiguity Reviews. Gary E. Mogyorodi, B.Math., M.B.A. Principal Consultant

Requirements Based Testing Process Overview

How Do You Know When You Are Done Testing? Richard Bender Bender RBT Inc. 17 Cardinale Lane Queensbury, NY

Software Testing, Mythology & Methodologies

The Ambiguity Review Process. Richard Bender Bender RBT Inc. 17 Cardinale Lane Queensbury, NY

Introduction to information skills 2

Software Testing Strategies and Techniques

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

Software Testing Interview Questions

WHAT S NEXT FOR MOBILE PAYMENTS?

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

EQUATIONS and INEQUALITIES

Test case design techniques II: Blackbox testing CISS

360 feedback. Manager. Development Report. Sample Example. name: date:

Software testing. Objectives

UNITED KINGDOM/ BRITISH PASSPORT SERVICE for Adults Ages 16 & Over

Standard for Software Component Testing

Il Project Cycle Management :A Technical Guide The Logical Framework Approach

Introduction to Computers and Programming. Testing

Introducing Formal Methods. Software Engineering and Formal Methods

Test Case Design Techniques

National University of Ireland, Maynooth MAYNOOTH, CO. KILDARE, IRELAND. Testing Guidelines for Student Projects

(Refer Slide Time: 01:52)

COURSE NAME: Database Management. TOPIC: Database Design LECTURE 3. The Database System Life Cycle (DBLC) The database life cycle contains six phases;

Advanced Software Test Design Techniques Use Cases

Improved Software Testing Using McCabe IQ Coverage Analysis

SOFTWARE REQUIREMENTS

Java Programming (10155)

Health Care Expenditure and Financing in Latin America and the Caribbean [Fact sheet]

Systems Engineering and Integration for the NSG (SEIN) SharePoint Developer

Recognition of Judgments 2016

How To Develop Software

Preparing Tomorrow's Teachers with Web 2.0 Tools and 21st Century Skills 1

CDC UNIFIED PROCESS PRACTICES GUIDE

ULTIMATE GUIDE TO THE 2012 USPS RATE INCREASE

Sample Exam Syllabus

Logic gates. Chapter. 9.1 Logic gates. MIL symbols. Learning Summary. In this chapter you will learn about: Logic gates

Installing New Software Using the Online Installer (Backup and Restore Required)

SCHOOL OF HEALTH AND HUMAN SCIENCES DON T FORGET TO RECODE YOUR MISSING VALUES

CALCULATIONS & STATISTICS

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

Test case design techniques I: Whitebox testing CISS

Handout #1: Mathematical Reasoning

RATE POSTAGE INCREASE 2013 USPS GUIDE

IEEE ComputerSociety 1 Software and Systems Engineering Vocabulary

Model-based Testing: Next Generation Functional Software Testing

The Theory of Software Testing

Total Quality Management (TQM) Quality, Success and Failure. Total Quality Management (TQM) vs. Process Reengineering (BPR)

Software Engineering. How does software fail? Terminology CS / COE 1530

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

2015 Growth in data center employment continues but the workforce is changing

Teaching Methodology for 3D Animation

Different Approaches to White Box Testing Technique for Finding Errors

Certification Authorities Software Team (CAST) Position Paper CAST-26

2 SYSTEM DESCRIPTION TECHNIQUES

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

4E2 Electronic and Electrical Engineering Project. Assist. Prof. Nicola Marchetti As agreed with Coordinator

Certified Tester. Advanced Level Overview

3.1 Solving Systems Using Tables and Graphs

Test Design Strategies

save time and do more with Online Postage

Gates, Circuits, and Boolean Algebra

Using Use Cases for requirements capture. Pete McBreen McBreen.Consulting

Defining Quality Workbook. <Program/Project/Work Name> Quality Definition

Parallel System This is a system that will fail only if they all fail.

pm4dev, 2016 management for development series Project Scope Management PROJECT MANAGEMENT FOR DEVELOPMENT ORGANIZATIONS

Client Overview. Engagement Situation. Key Requirements

Process Models and Metrics

Agile QA Process. Anand Bagmar Version 1.

Mathematics. What to expect Resources Study Strategies Helpful Preparation Tips Problem Solving Strategies and Hints Test taking strategies

Five High Order Thinking Skills

Overview of A Guide to the Project Management Body of Knowledge (PMBOK Guide) Fourth Edition

Decision Mathematics D1 Advanced/Advanced Subsidiary. Tuesday 5 June 2007 Afternoon Time: 1 hour 30 minutes

Sudoku puzzles and how to solve them

EC-Council Logo Usage

(Refer Slide Time: 2:03)

Online Executive MBA Program Application for Admission

Artificial Intelligence

POSTAGE RATE INCREASE GUIDE 2014 USPS

Mission Assurance Manager (MAM) Life Cycle Risk Management Best Practices David Pinkley Ball Aerospace MA Chief Engineer September 23, 2014

Fundamentals of Information Systems, Fifth Edition. Chapter 8 Systems Development

Business Process Modeling with BPMN. Dr. Darius Šilingas Head of Solutions Department

Knowledge Discovery and Data Mining. Structured vs. Non-Structured Data

Lowering business costs: Mitigating risk in the software delivery lifecycle

ASSIGNMENT 4 PREDICTIVE MODELING AND GAINS CHARTS

Structural Health Monitoring Tools (SHMTools)

YOUR dream. Since 1972, the Soroptimist Live Your Dream Awards. You can do it! live. Get started now! ready to begin a new life?

Probability Distributions

Big Data, Fast Data, Complex Data. Jans Aasman Franz Inc

Automatic Configuration Generation for Service High Availability with Load Balancing

Section Continued

Learning Objectives Lean Six Sigma Black Belt Course

Transcription:

Requirements-Based Testing - Cause-Effect Graphing Gary E. Mogyorodi, B.Math., M.B.A. Certified Tester, Foundation Level (CTFL) Certified Tester, Advanced Level Functional Tester (CTAL-FT) Certified Tester, Advanced Level Test Manager (CTAL-TM) President - Canadian Software Testing Board Principal Consultant Software Testing Services 1646 Coldwater Mews Mississauga, Ontario, Canada L5M4X3 Phone: (905) 813-7937 Cell: (416) 200-5040 Fax: (509) 356-6647 Email: garym@softestserv.ca Web: www.softestserv.ca All Rights Reserved. Software Testing Services 2005-2010 Page 1

Introduction This article provides an overview of the Requirements-Based Testing (RBT) process. RBT is a rigorous technique for improving the quality of requirements, while deriving the minimum number of test cases to cover 100% of those requirements. RBT is comprised of two techniques: Ambiguity Reviews and Cause-Effect Graphing. An Ambiguity Review is used in the requirements phase of software development to identify ambiguities in functional 1 requirements. The intent of an Ambiguity Review is to identify anything that is unclear, not concise or ambiguous in the requirements. The elimination of these ambiguities improves the quality of those requirements. Cause-Effect Graphing is a test case design technique that is performed once requirements have been reviewed for ambiguity, followed by a review for content. Requirements are reviewed for content to insure that they are correct and complete. The Cause-Effect Graphing technique derives the minimum number of test cases to cover 100% of the functional requirements to improve the quality of test coverage. This article addresses the second RBT technique - Cause-Effect Graphing. The first article described Ambiguity Reviews and included a sample ambiguity review of the requirements I will design test cases for in this article. Test Case Design The test case design challenge is to derive the necessary and sufficient set of test cases to cover 100% of the functionality for the system under test. Without 100% functional coverage, there is a certainty that functionality will go into production untested. There are many test case design techniques, but few insure that the test cases will provide 100% functional coverage. The Cause-Effect Graphing technique begins with the set of requirements, and determines the minimum number of test cases to completely cover the requirements. All Rights Reserved. Software Testing Services 2005-2010 Page 2

Test Case Review Once the test cases have been derived by the test case designer, the RBT process includes the review of these test cases by the following stakeholders: The author of the requirements verifies that he/she agrees with the test case designer s translation of requirements to test cases. The domain experts review the test cases in order to determine the answer to the following question: Are we building the right system? The developers review the test cases to clarify their understanding of the requirements. The developers learn what they will be tested on, and can therefore develop the software to succeed. By performing these reviews, everyone on the project team can obtain the same understanding of what will be built. Traditional Test Case Design Techniques There are a number of test case design techniques, such as Equivalence Class Partitioning and Boundary Value Analysis. These techniques rely on the test case designer to manually work out the proper combinations of test cases. Often, the test case designer does not use a formal test case design technique and relies on his/her gut feel to assess whether test coverage is sufficient. While these techniques do generate combinations of test cases, they often fall short on providing full functional coverage. Too often the normal flow or go path functionality has overlapping, redundant test cases, while exceptions and error conditions go untested. Cause-Effect Graphing The Cause-Effect Graphing technique was invented by Bill Elmendorf of IBM in 1973. Instead of the test case designer trying to manually determine the right set of test cases, he/she models the problem using a cause-effect graph, and the software that supports the technique, BenderRBT, calculates the right set of test cases to cover 100% of the functionality. The cause-effect graphing technique uses the same algorithms that are used in hardware logic circuit testing. Test case design in hardware insures virtually defect free hardware. Cause-Effect Graphing also has the ability to detect defects that cancel each other out, and the ability to detect defects hidden by other things going right. These are advanced topics that won t be discussed in this article. All Rights Reserved. Software Testing Services 2005-2010 Page 3

The starting point for the Cause-Effect Graph is the requirements document. The requirements describe what the system is intended to do. The requirements can describe real time systems, events, data driven systems, state transition diagrams, object oriented systems, graphical user interface standards, etc. Any type of logic can be modeled using a Cause-Effect diagram. Each cause (or input) in the requirements is expressed in the cause-effect graph as a condition, which is either true or false. Each effect (or output) is expressed as a condition, which is either true or false. A Simple Cause-Effect Graphing Example I have a requirement that says: If A OR B, then C. The following rules hold for this requirement: If A is true and B is true, then C is true. If A is true and B is false, then C is true. If A is false and B is true, then C is true. If A is false and B is false, then C is false. The cause-effect graph that represents this requirement is provided in Figure 1. The cause-effect graph shows the relationship between the causes and effects. Figure 1 A Cause-Effect Graph In Figure 1, A, B and C are called nodes. Nodes A and B are the causes, while Node C is an effect. Each node can have a true or false condition. The lines, called vectors, connect the cause nodes A and B to the effect node C. All requirements are translated into nodes and relationships on the cause-effect graph. There are only four possible relationships among nodes, and they are indicated by the following symbols: If A always leads to C, there is a black line that connects the nodes. If A or B lead to C, there is an OR relation. If A and B lead to C, there is an AND relation. If not A leads to C, there is a red line that connects nodes. All Rights Reserved. Software Testing Services 2005-2010 Page 4

The Decision Table The cause-effect graph is then converted into a decision table or truth table representing the logical relationships between the causes and effects. Each column of the decision table is a test case. Each test case corresponds to a unique possible combination of inputs that are either in a true state, a false state, or a masked state (the masked state will be described in Figure 4 below). Since there are 2 inputs to this example, there are 2 ** 2 = 4 maximum combinations of inputs from which test cases can be selected. Figure 2 represents the decision table derived for the cause-effect graph in Figure 1. Figure 2 The Decision Table Notice that there are only three test cases. However, these three test cases cover 100% of the functionality for this example. The fourth combination of inputs (A= true and B = true) does not add any additional functional coverage, and is a redundant test case. Each relation is tested with the right combinations of causes so that all defects are covered for that relation, resulting in 100% coverage. All Rights Reserved. Software Testing Services 2005-2010 Page 5

For more technical information about Cause-Effect Graphing, refer to the following: Richard Bender Bender RBT Inc. 17 Cardinale Lane Queensbury, NY 12804 518 743-8755 www.benderrbt.com G. J. Myers, The Art of Software Testing, Wiley, 1979. Cause-Effect Graphing Analysis and Validation of Requirements Khenaidoo Nursimulu and Robert L. Probert Bell-Northern Research and Telecommunications Software Engineering Research Group Department of Computer Science University of Ottawa, 150 Louis Pasteur/Priv., Ottawa Ontario, Canada K1N 6NA www.cs.ubc.ca/local/reading/proceedings/cascon95/pdf/nursimul.pdf Cause-Effect Graphing Theresa Hunt http://www.westfallteam.com/papers/cause_and_effect_graphing.pdf All Rights Reserved. Software Testing Services 2005-2010 Page 6

Let s Create a Cause-Effect Graph In the previous article on Requirements-Based Testing, we performed an Ambiguity Review and revised our original set of requirements to the following: The Postal Regulation for South America (Version 1) The following postal regulation determines postage surcharges. This regulation applies only to parcels, not other types of postal items, and only to parcels sent to South America. Other postal items are envelopes and post cards. There is no postage surcharge for envelopes and post cards. For parcels which people mail to South America between December 1 and December 24 of each year, the system will apply the surcharges in Table 1 in addition to the standard postage of $5.00 US: Table 1 - Country & Weight Surcharge between December 1 and December 24 Argentina All weights $11 US Brazil Weight > 33 pounds $21 US Brazil Weight = 33 pounds $19 US Brazil Weight < 33 pounds $17 US Columbia, Ecuador, Peru, Bolivia, Chile, French Guiana, Guyana, Paraguay, Suriname, Uruguay, Venezuela, and Falkland Islands All weights $15 US For parcels which people mail to South America outside of December 1 to December 24 of each year, the system will apply the surcharges in Table 2 in addition to the standard postage of $5.00 US: Table 2 - Country & Weight Surcharge outside the dates December 1 to December 24 (In a real life problem, the specific details of Table 2 would be supplied here. For this example, they have been excluded.) Figure 3 The Postal Regulation Requirements Corrected for Ambiguity All Rights Reserved. Software Testing Services 2005-2010 Page 7

The test case designer translates the requirements into the cause-effect graph shown in Figure 4 (created using BenderRBT). Figure 4 Cause-Effect Graph for the Postal Regulation Requirements The node I10 represents the state in which the item is sent to South America AND the postal item is a parcel AND the item is mailed between December 1 and December 24. There are a number of mask statements in the cause-effect graph. The mask statements define constraints on the system under test. As an example, the mask (Argentina, Weight_High, 33_Pounds, Weight_Low) means that when Argentina is the country, then the weight divisions associated with Brazil are irrelevant inputs. All Rights Reserved. Software Testing Services 2005-2010 Page 8

The Cause-Effect Graph is translated into the following decision table (output from BenderRBT): Figure 5 Decision Table for the Postal Regulation Requirements Each column in Figure 5 represents a test case. The inputs are listed under the Causes, while the outputs are listed under the Effects. Each value in the matrix can be either T = true, F = false, or M = masked (an input that is masked is irrelevant to that test case). Each column represents a unique combination of inputs. All Rights Reserved. Software Testing Services 2005-2010 Page 9

The following 8 test cases are derived for the Postal Regulation requirements using the Cause-Effect Graphing technique: TEST#1 -- The Postal Regulation The item is NOT sent to South America These conditions are out of scope for the Postal Regulation problem. TEST#2 -- The Postal Regulation The postal item is NOT a parcel. These conditions are out of scope for the Postal Regulation problem. TEST#3 -- The Postal Regulation The postal item is a parcel. The item is NOT mailed between December 1 and December 24. See Table 2 for postage surcharges. TEST#4 -- The Postal Regulation The postal item is a parcel. The item is mailed between December 1 and December 24. The country is Argentina The postage surcharge is $11 All Rights Reserved. Software Testing Services 2005-2010 Page 10

TEST#5 -- The Postal Regulation The postal item is a parcel. The item is mailed between December 1 and December 24. The country is NOT Argentina The country is NOT Brazil The postage surcharge is $15 US. TEST#6 -- The Postal Regulation The postal item is a parcel. The item is mailed between December 1 and December 24. The country is Brazil The item weighs more than 33 pounds The postage surcharge is $21 US. TEST#7 -- The Postal Regulation The postal item is a parcel. The item is mailed between December 1 and December 24. The country is Brazil The item weighs 33 pounds The postage surcharge is $19 US. All Rights Reserved. Software Testing Services 2005-2010 Page 11

TEST#8 -- The Postal Regulation The postal item is a parcel. The item is mailed between December 1 and December 24. The country is Brazil The item weighs less than 33 pounds. The postage surcharge is $17 US. In Summary Figure 5 shows there are 8 inputs to the Postal Regulation requirements (i.e., Continent, Postal_Item_Type, Dates, Argentina, Brazil, Weight_High, 33_Pounds, Weight_Low). It is interesting to note that with 8 inputs, there are 2 ** 8 = 256 combinations of inputs from which test cases can be selected. The Cause-Effect Graphing technique derived only 8 test cases, but these 8 test cases cover 100% of the functionality described in the requirements. No other test cases are required to improve functional coverage. Additional test cases would only provide redundant coverage already supplied by some portion of each of the 8 original test cases. Cause-Effect Graphing, in conjunction with a powerful analytical tool such as BenderRBT, provides a rigorous, consistent and cost effective approach to deriving test cases. Since the technique determines the minimum number of test cases, the test effort is minimized, and yet the test case designer can be confident that once these tests are successfully run, then testing is complete, and no untested functionality will move into production. Notes: 1 Functional requirement - A functional requirement specifies what the system must be able to do, in terms that are meaningful to its users. Gary E. Mogyorodi, B.Math., M.B.A. Certified Tester, Foundation Level (CTFL) Certified Tester, Advanced Level Functional Tester (CTAL-FT) Certified Tester, Advanced Level Test Manager (CTAL-TM) Principal Consultant Software Testing Services 1646 Coldwater Mews Mississauga, Ontario, Canada L5M4X3 Phone: (905) 813-7937 Email: garym@softestserv.ca Web: www.softestserv.ca All Rights Reserved. Software Testing Services 2005-2010 Page 12