Black Box Testing Csci 565 Spring 2009.

Slides:



Advertisements
Similar presentations
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advertisements

DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Decision Table Based Testing
Systems V & V, Quality and Standards
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Black box testing  Black box tests focus on the input/output behavior of the component  Black-box tests do not deal with the internal aspects of the.
Software Testing and Quality Assurance
Testing an individual module
CS4723 Software Validation and Quality Assurance Lecture 02 Overview of Software Testing.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
 A data processing system is a combination of machines and people that for a set of inputs produces a defined set of outputs. The inputs and outputs.
Equivalence Class Testing
Black Box Software Testing
Fundamentals of Python: From First Programs Through Data Structures
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Fundamentals of Python: First Programs
Dynamic Black-Box Testing Part 2
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Contents Introduction Requirements Engineering Project Management
Chapter 8 iComponents and Parameters. After completing this chapter, you will be able to perform the following: –Create iMates –Change the display of.
University of Palestine software engineering department Testing of Software Systems Test-Case Design instructor: Tasneem Darwish.
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
1 testing17 Software Testing Functional, MCC, Dataflow Testing, Cause-Effect Graphing.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
1 Chapter : Testing Tactics. 2 Testing Fundamental Software engineer attempts to build software from an abstract concept to a tangible product. Next is.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
BLACK BOX TESTING K.KARTHIKEYAN. Black box testing technique Random testing Equivalence and partitioning testing Boundary value analysis State transition.
1 Boolean Expressions to Make Comparisons Boolean expression –Represents only one of two states –Expression evaluates to either true or false Expressions.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
SM2220 – Class 06 Finite Automata. SM2220 – Class 06 Topic in theoretical computing. A subset of computation machines. Closely related to formal language.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
Chapter – 8 Software Tools.
XML Schema – XSLT Week 8 Web site:
Introduction to programming in java Lecture 11 Boolean Expressions and Assignment no. 2.
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.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
Equivalence partitioning
Equivalence partitioning
Software Testing.
Decision Table Testing
Black Box Testing PPT Sources: Code Complete, 2nd Ed., Steve McConnell
CS5123 Software Validation and Quality Assurance
Specification-Based Testing and the Category-Partition Method
Modern Systems Analysis and Design Third Edition
Types of Testing Visit to more Learning Resources.
Testing Approaches.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
COSC 4506/ITEC 3506 Software Engineering
Chapter 14 Software Testing Techniques
Chapter 10 – Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
Chapter 11 Describing Process Specifications and Structured Decisions
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Chapter 3: Selection Structures: Making Decisions
Overview Functional Testing Boundary Value Testing (BVT)
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Black Box Testing Csci 565 Spring 2009

Objectives Decision Table-Based Testing Cause-Effect Graphs in Functional testing Equivalence Partitioning and Boundary value Analysis State transition testing (revisited) Input validation and Syntax-driven Testing

Decision table-based Testing (DTT) Applicable to the software requirements written using “if- then” statements Can be automatically translated into code Assume the independence of inputs Example If c1 AND c2 OR c3 then A1

Sample of Decision table r1 r2 … rn c1 1 c2 x cn a1 a2 an o A decision table is consists of a number of columns (rules) that comprise all test situations Action ai will take place if c1 and c2 are true

Example: Simple editor A simple text editor should provide the following features Copy Paste Boldface Underline

In general, for n conditions, we need 2n rules copy 1 paste Undrln Bold C-test P-text U-text B-text In general, for n conditions, we need 2n rules

Decision tables as a basis for test case design The use of decision-table model to design test cases is applicable The spec is given by table or is easily converted to one The order in which the conditions are evaluated does not affect the interpretation of rules or the resulting action The order in which the rules are evaluated does not affect the resulting action Once a rule has been satisfied and an action is selected, no other rule need be examined If multiple actions result from the satisfaction of a rule, the order in which the actions take place is not important

The implications of rules The above conditions have the following implications Rules are complete (i.e., every combination of decision table values including default combinations are inherent in the decision table) The rules are consistent (i.e, there is not two actions for the same combinations of conditions)

Cause-effect graphs in black box testing Captures the relationships between specific combinations of inputs (causes) and outputs (effects) Deals with specific cases, Avoids combinatorial explosion Explore combinations of possible inputs Causes/effects are represented as nodes of a cause effect graph The graph also includes a number of intermediate nodes linking causes and effects

Drawing Cause-Effect Graphs B If A then B (identity) A C B If (A and B)then C

Drawing Cause-Effect Graphs B If (A or B) then C A C  B If (not(A and B)) then C

Drawing Cause-Effect Graphs  C B If (not (A or B))then C  A B If (not A) then B

Constraint Symbols a b a b a b E: at most, one of a and b can be 1 O O: Exactly one of A and B can be invoked b a I: at least one of a or b must be 1 b

Example: ATM For a simple ATM banking transaction system Causes (inputs) C1: Command is credit C2: command is debit C3: account number is valid C4: transaction amount is valid Effects E1: Print “invalid command” E2: Print “ invalid account number” E3: Print “debit amount not valid” E4: debit account E5: Credit account

 E1 or C1 and E2  C2 and E3  C3 and E4 C4 E5 and

Description of processing nodes used in a Cause-effect graph Type of processing node description AND Effect occurs if all input are true (1) OR Effect occurs if both or one input is true XOR Effect occurs if one of input is true Negation Effect occurs if input are false (0) ()

ATM Cause-effect decision table Don’t Care condition Cause\effect R1 R2 R3 R4 R5 C1 1 x C2 C3 C4 E1 E2 E3 E4 E5

More Example Consider the following NL specifications: The boiler should be shut down if any of the following conditions occurs: If the water level in a boiler is below the 20000lb mark The water level is above the 120000 lb, or The boiler is operating in degraded mode and the steam meter fails Being in degraded mode means :If either water pump or a pump monitors fails

Example 3: Translate NL into workable pieces (atomic specifications) Atomic sentences are C1. the water level in boiler is below the 20000 lb (F/T) C2. the water level is above the 120000 lb mark (F/T) C3. A water pump has failed (F/T) C4. A pump monitor has failed (F/T) C5. Steam meter has failed/T E. Shut the boiler down

Steps to create cause-effect graph Study the functional requirements and divide the requirements into workable pieces E.g. of workable piece, in eCom, can be verifying a single item placed in shopping cart Identify causes and effects in the specifications Causes: distinct input conditions Effects: an output condition or a system transformations. Assign unique number to each cause and effect Use the semantic content of the spec and transform it into a Boolean graph Annotate the graph with constrains describing combinations of causes and/or effects Convert the graph into a limited-entry decision table Use each column as a test case

Possible research topics based on CEG Comparison of CEG ,FSM-based test sets, and randomly generated test cases (functional) For effectiveness in terms of cost and fault detection capabilities For fault detection capabilities For number of test cases generated (cost) For automatic generation of actual test cases

Black-box testing

Equivalence partitioning Input data and output results often fall into different classes where all members of a class are related Each of these classes is an equivalence partition where the program behaves in an equivalent way for each class member Test cases should be chosen from each partition (or class)

Equivalence partitioning

Guidelines for equivalence classes If an input condition specifies range, one valid and two invalid equivalence classes are needed If a condition requires a specific value, then one valid and two invalid equivalence classes are needed If an input condition specifies a member of a set, one valid and one invalid equivalence class are needed If an input condition is Boolean, one valid and one invalid class are needed

Consider data maintained for ATM Example: ATM Consider data maintained for ATM User should be able to access the bank using PC and modem User should provide six-digit password Need to follow a set of typed commands

Data format Software accepts Area code: Prefix: Suffix: blank or three-digit Prefix: three-digit number not beginning with 0 or 1 Suffix: four digits number Password: six digit alphanumeric value Command: {“check”, “deposit,” “ bill pay”, “transfer” etc.}

Input conditions for ATM Input conditions: phone number Area code: Boolean: (the area code may or may not be present) Range: values defined between 200-999 Specific value: no value > 905 Prefix: range –specific value >200 Suffix: value (four-digit length) Password: Boolean: password may or may not be present Valid-value: six char string Command: set containing commands noted previously

Boundary Value Analysis (BVA) complements equivalence partitioning Focuses is on the boundaries of the input If input condition specifies a range bounded by a certain values, say, a and b, then test cases should include The values for a and b The values just above and just below a and b If an input condition specifies any number of values, test cases should be exercise the minimum and maximum numbers, the values just above and just below the minimum and maximum values

Example 2: Equivalence Partitioning

Valid partitions 0<=exam mark <=75 0<=coursework <=25 The valid partitions can be 0<=exam mark <=75 0<=coursework <=25

Invalid partitions The most obvious partitions are Exam mark > 75 Coursework mark > 25 Coursework mark <0

Exam mark and c/w mark

Less obvious invalid input EP invalid INPUT EP should include

Partitions for the OUTPUTS EP for valid OUTPUTS should include

The EP & Boundary values The EP and boundaries for total mark

Unspecified Outputs Three unspecfied Outputs can be identified (very subjective) Output = “E” Output = “A+” Output = “null”

Total PE

Test Cases corresponding to PE exam mark (INPUT) ( test cases 1, 2,3 )

Test Case 4-6 (coursework)

test case for Invalid inputs (7 to 10)

Test cases for invalid outputs:11 to 13 test case

Test cases for invalid outputs:2

Test cases for invalid outputs:3

Minimal Test cases:1

Minimal Test cases:2

Syntax-Driven testing (SDT) Applicable to Specification validation written by a certain grammar (BNF) Test generation Generate test cases such that each production rule is tested at least once

Example: BNF of simple Arithmetic expressions Example <exp> ::= <exp> + <term>|<exp> - <term>| <term> <term> ::= <term> * <factor> | <term> / <factor>|<factor> <factor> ::= <id> | (<exp>) <id>::= a|b|…|z

More on SDT The set of test cases for SDT should include expressions that exercise the ALL production rules Examples: a+b * c <Expression> <expression> + <Term><Expression> + <Term> * <Factor> <Term> +<Term> *<Factor>  … <factor> +<factor> *<Factor>  … <id> +<id> *<id> (w+v) + z

Strings’ errors Even small specification may result in many strings Strings’ errors can be classified as Syntax error Delimiter errors Field-value errors