Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
The If Then Else Statement Using JavaScript TIP The If Statement is the fundamental control structure that allows branches in the flow of control in a.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Objectives AND logic OR logic Evaluating compound conditions with multiple logical operators Precedence when combining AND and OR operators Efficiency.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
1 Discrete Structures Lecture 29 Predicates and Programming Read Ch
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Basic Elements of Programming A VB program is built from statements, statements from expressions, expressions from operators and operands, and operands.
2-1 Making Decisions Sample assignment statements PayAmount = Hours * Rate PayAmount = 40*Rate + (Hours – 40)*Rate*1.5.
White Box Testing Techniques Dynamic Testing. White box testing(1) Source code is known and used for test design While executing the test cases, the internal.
Testing an individual module
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Chapter 13 & 14 Software Testing Strategies and Techniques
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Testing Techniques
Ryan Chu. Arithmetic Expressions Arithmetic expressions consist of operators, operands, parentheses, and function calls. The purpose is to specify an.
Programming Logic and Design Fourth Edition, Introductory
CMSC 345 Fall 2000 Unit Testing. The testing process.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
ISBN Chapter 7 Expressions and Assignment Statements.
Selection Control Structures Simple Program Design Third Edition A Step-by-Step Approach 4.
Agenda Introduction Overview of White-box testing Basis path testing
4-2 binary fields and binary vector spaces Special Thanks to Dr. Samir Al-Ghadhban & EE430 Students.
On a random walk strategy for the Q2SAT problem K. Subramani.
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.
Logic Disjunction A disjunction is a compound statement formed by combining two simple sentences using the word “OR”. A disjunction is true when at.
1 Boolean Expressions to Make Comparisons Boolean expression –Represents only one of two states –Expression evaluates to either true or false Expressions.
White-box Testing.
CHAPTER 4: Selection Control Structure. Objectives  Use the relational comparison operators  Learn about AND logic  Learn about OR logic  Make selections.
CPS120: Introduction to Computer Science Operations Lecture 9.
Operators Precedence - Operators with the highest precedence will be executed first. Page 54 of the book and Appendix B list C's operator precedence. Parenthesis.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Chapter 51 Logical Operators Used with Boolean expressions Not – makes a False expression True and vice versa And – will yield a True if and only if both.
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
CPS120: Introduction to Computer Science Decision Making in Programs.
Complexity 24-1 Complexity Andrei Bulatov Interactive Proofs.
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 5 Making Decisions.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Compiler Construction Lecture Five: Parsing - Part Two CSC 2103: Compiler Construction Lecture Five: Parsing - Part Two Joyce Nakatumba-Nabende 1.
White-Box Testing Statement coverage Branch coverage Path coverage
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
CS223: Software Engineering Lecture 26: Software Testing.
Software Testing.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Software Engineering (CSI 321)
Sequence, Selection, Iteration The IF Statement
Condition Testing.
CSC113: Computer Programming (Theory = 03, Lab = 01)
Chapter 13 & 14 Software Testing Strategies and Techniques
Structural testing, Path Testing
White Box Testing.
JavaScript: Control Statements.
CHAPTER 4 Test Design Techniques
UNIT-4 BLACKBOX AND WHITEBOX TESTING
2-1 Making Decisions Sample assignment statements
Chapter 14 Software Testing Techniques
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Control Structure Testing
Boolean Expressions to Make Comparisons
Section 3.2 Truth Tables for Negation, Conjunction, and Disjunction
Matlab Basics.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Condition Testing

Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition is a Boolean variable or a relational expression, possibly preceded with one NOT (¬) operator. The condition testing method focuses on testing each condition in the program.

A relational expression takes the form E1 E2 – where E1 and E2 are arithmetic expressions and is one of the following:, or ≥. A compound condition is composed of two or more simple conditions, Boolean operators, and parentheses. We assume that Boolean operators allowed in a compound condition include OR (|), AND (&) and NOT (¬). A condition without relational expressions is referred to as a Boolean expression.

Therefore, the possible types of elements in a condition include a – Boolean operator, – a Boolean variable, – a pair of Boolean parentheses (surrounding a simple or compound condition), – a relational operator, or an arithmetic expression. If a condition is incorrect, then at least one component of the condition is incorrect.

Condition testing generally have two advantages. – First, measurement of test coverage of a condition is simple. – Second, the test coverage of conditions in a program provides guidance for the generation of additional tests for the program. The purpose of condition testing is to detect not only errors in the conditions of a program but also other errors in the program.

If a test set for a program P is effective for detecting errors in the conditions contained in P, it is likely that this test set is also effective for detecting other errors in P. Branch testing is probably the simplest condition testing strategy. For a compound condition C, – the true and false branches of C and every simple condition in C need to be executed at least once. Domain testing requires three or four tests to be derived for a relational expression.

For a relational expression of the form – E1 E2 – three tests are required to make the value of E1 greater than, equal to, or less than that of E2 If is incorrect and E1 and E2 are correct, then these three tests guarantee the detection of the relational operator error. To detect errors in E1 and E2, a test that makes the value of E1 greater or less than that of E2 should make the difference between these two values

Types of errors in a condition include the following: – Boolean operator error (incorrect/missing/extra Boolean operators). – Boolean variable error. – Boolean parenthesis error. – Relational operator error. – Arithmetic expression error. For a Boolean expression with n variables, all of 2 n possible tests are required (n > 0). This strategy can detect Boolean operator, variable, and parenthesis errors, but it is practical only if n is small.

Condition testing strategy called BRO (branch and relational operator) testing, the technique guarantees the detection of branch and relational operator errors in a condition provided that all Boolean variables and relational operators in the condition occur only once and have no common variables. The BRO strategy uses condition constraints for a condition C. A condition constraint for C with n simple conditions is defined as (D1, D2,..., Dn), – where Di (0 < i ≤ n) is a symbol specifying a constraint on the outcome of the ith simple condition in condition C. – A condition constraint D for condition C is said to be covered by an execution of C if, during this execution of C, the outcome of each simple condition in C satisfies the corresponding constraint in D.

C1: B1 & B2 – where B1 and B2 are Boolean variables. – The condition constraint for C1 is of the form (D1, D2), where each of D1 and D2 is t or f. – The value (t, f) is a condition constraint for C1 and is covered by the test that makes the value of B1 to be true and the value of B2 to be false. – The BRO testing strategy requires that the constraint set {(t, t), (f, t), (t, f)} be covered by the executions of C1. – If C1 is incorrect due to one or more Boolean operator errors, at least one of the constraint set will force C1 to fail.

C2: B1 & (E3 = E4) – where B1 is a Boolean expression and E3 and E4 are arithmetic expressions. – A condition constraint for C2 is of the form (D1, D2), where each of D1 is t or f and D2 is >, =, <. – Since C2 is the same as C1 except that the second simple condition in C2 is a relational expression, we can construct a constraint set for C2 by modifying the constraint set {(t, t), (f, t), (t, f)} defined for C1. – Note that t for (E3 = E4) implies = and that f for (E3 = E4) implies either. – By replacing (t, t) and (f, t) with (t, =) and (f, =), respectively, and – by replacing (t, f) with (t, ), – the resulting constraint set for C2 is {(t, =), (f, =), (t, )}. – Coverage of the preceding constraint set will guarantee detection of Boolean and relational operator errors in C2.

C3: (E1 > E2) & (E3 = E4) – where E1, E2, E3, and E4 are arithmetic expressions. – A condition constraint for C3 is of the form (D1, D2), where each of D1 and D2 is >, =, <. – Since C3 is the same as C2 except that the first simple condition in C3 is a relational expression, we can construct a constraint set for C3 by modifying the constraint set for C2, obtaining {(>, =), (=, =), (, >), (>, <)} – Coverage of this constraint set will guarantee detection of relational operator errors in C3.