Lab 8 Data-Flow Testing.

Slides:



Advertisements
Similar presentations
DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Advertisements

Marking Schema question1: 40 marks question2: 40 marks question3: 20 marks total: 100 marks.
 Control structures  Algorithm & flowchart  If statements  While statements.
Dependable Software Systems
Chapter 18 Testing Conventional Applications
Review Algorithm Analysis Problem Solving Space Complexity
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Topics in Software Dynamic White-box Testing: Data-flow Testing
Topics in Software Dynamic White-box Testing Part 2: Data-flow Testing
Data Flow Testing Data flow testing(DFT) is NOT directly related to the design diagrams of data-flow-diagrams(DFD). It is a form of structural testing.
Software testing techniques Testing criteria based on data flow
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
1 Program Planning and Design Important stages before actual program is written.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Algorithms and Pseudocode
Software Dynamic White-box Testing Part 2: Data-flow Testing Lecture 7 Prof. Mostafa Abdel Aziem Mostafa.
Pseudocode (pronounced SOO-doh-kohd)  is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
CIS 115 Slingshot Academy / cis115.com
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
ALGORITHMS AND FLOWCHARTS
UNIT – II TRANSACTION FLOW TESTING
CSCE 747 Software Testing and Quality Assurance
Assembler Directives Code generation flow
Exercise : Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased.
Python: Experiencing IDLE, writing simple programs
Control Flow Testing Handouts
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Chapter 2: Input, Processing, and Output
Review: Chapter 5: Syntax directed translation
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Lecture 4 - Loops UniMAP EKT120 Sem 1 08/09.
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Data Coverage and Code Coverage
Introduction to Flowcharting
Data Flow Testing.
Structural testing, Path Testing
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithm and Ambiguity
White-Box Testing Techniques II
CS 240 – Lecture 11 Pseudocode.
CHAPTER 4 Test Design Techniques
CIS115 Education for Service-- snaptutorial.com
CIS 115 Teaching Effectively-- snaptutorial.com
Dataflow Testing G. Rothermel.
White-Box Testing Techniques II
Programming Funamental slides
Chapter 10 Data Flow Testing Slice Testing
Programming Funamental slides
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithm and Ambiguity
Graph Coverage for Source Code
CHAPTER 17 The Report Writer Module
Examining Variables on Flow Paths
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
White-Box Testing Techniques II
Chapter 2 Control Structures.
Coursework 1 Due Tuesday, Feb 6, 2007 in the tutorial
Data Structures & Algorithms
Ratios and Proportions Notes-Part 6
Tata Consultancy Services
Chapter 2: Input, Processing, and Output
Problem Solving with Proportional Relationships
Introduction to Flowcharting
Dry Run Fix it Write a program
WJEC GCSE Computer Science
Module 3 Selection Structures 6/25/2019 CSE 1321 Module 3.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Lab 8 Data-Flow Testing

Data-Flow Testing Data-flow testing uses the control flowgraph to explore the unreasonable things that can happen to data (i.e. anomalies). Consideration of data-flow anomalies leads to test path selection strategies that fill the gaps between complete path testing and branch or statement testing. Data-flow testing is the name given to a family of test strategies based on selecting paths through the program’s control flow in order to explore sequences of events related to the status of data objects. E.g., Pick enough paths to assure that: – Every data object has been initialized prior to its use. – All defined objects have been used at least once.

Data Object Categories (d) Defined, Created, Initialized (k) Killed, Undefined, Released (u) Used: – (c) Used in a calculation – (p) Used in a predicate

(d) Defined Objects An object (e.g., variable) is defined when it: – appears in a data declaration – is assigned a new value – is a file that has been opened – is dynamically allocated

(u) Used Objects An object is used when it is part of a computation or a predicate. A variable is used for a computation (c) when it appears on the RHS (sometimes even the LHS in case of array indices) of an assignment statement. A variable is used in a predicate (p) when it appears directly in that predicate.

Example: Definition and Uses What are the definitions and uses for the program below? 1. read (x, y); 2. z = x + 2; 3. if (z < y) 4. w = x + 1; else 5. y = y + 1; 6. print (x, y, w, z);

Example: Definition and Uses

du Path Segments A du Path is a path segment such that if the last link has a use of X, then the path is simple and definition clear.

Example Staff Discount Program The following program is used in a hypothetical retail situation. The owner of a shop has decided that her staff can have a 10 percent discount on all their purchases. If they spend more than £15, then the total discount is in-creased by 50 pence. The price of each item being purchased is input into the program. When -1 is entered, the total price is displayed, as well as the calculated discount and the final price to pay. For example, the values £5.50, £2.00 and £2.50 are input, equalling £10.00. The total discount would equal £1.00 (10% of £10.00), with the total price to pay equalling £9.00. A second example would have purchases of £10.50 and £5.00, equaling £15.50. In this case, as the total value is over £15, the discount would be £2.05 (10% of £15.50 is £1.55, plus 50p as the original total is over £15), meaning that the total price to pay would be £13.45. The source code, written in pseudocode, for a program which has been written to perform the task described above, is shown below:

Example (conti)

Define/use Testing

With these nodes, some useful paths can be generated. Definition-use (du) paths: A path in the set of all paths in P(G) is a du-path for some variable v (in the set V of all variables in the program) if and only if there exist DEF(v, m) and USE(v, n) nodes such that m is the first node of the path, and n is the last node.

Definition-clear (dc) paths: A path in the set of all paths in P(G) is a dc-path for some variable v (in the set V of all variables in the program) if and only if it is a du-path and the initial node of the path is the only defining node of v in the path.