1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.

Slides:



Advertisements
Similar presentations
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Advertisements

Testing and Quality Assurance
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Graph Coverage (2).
Graph Coverage Criteria Structural Coverage Criteria : Defined on a graph just in terms of nodes and edges Data Flow Coverage Criteria : Requires a graph.
Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt
COVERAGE CRITERIA FOR TESTING 1. ill-defined terms in Testing  complete testing  exhaustive testing  full coverage Are poorly defined terms because.
Testing an individual module
Chapter 18 Testing Conventional Applications
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Software Engineering Lecture 12 Software Testing Techniques 1.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
Black Box Software Testing
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
System/Software Testing
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
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.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
Software Testing Testing types Testing strategy Testing principles.
Agenda Introduction Overview of White-box testing Basis path testing
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Black Box Testing Focuses in the functional requirements of the program It is not an alternative to white-box techniques It is a complementary approach.
Black-box Testing.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Software Testing and Maintenance Lecture 2.1 Overview Graph Coverage
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Software Testing and Quality Assurance 1. What is the objectives of Software Testing?
Software Testing. System/Software Testing Error detection and removal determine level of reliability well-planned procedure - Test Cases done by independent.
Theory and Practice of Software Testing
Software Quality Assurance and Testing Fazal Rehman Shamil.
Dynamic Testing.
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
Data Flow Testing. Introduction to Software Testing (Ch 2) © Ammann & Offutt 2 Definition of a Graph A set N of nodes, N is not empty A set N 0 of initial.
SOFTWARE TESTING. SOFTWARE Software is not the collection of programs but also all associated documentation and configuration data which is need to make.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
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.
Testing Integral part of the software development process.
Paul Ammann & Jeff Offutt
Functional testing, Equivalence class testing
Software Engineering (CSI 321)
Software Testing.
Equivalence partitioning
Software Testing.
Paul Ammann & Jeff Offutt
Lecture on Black Box Testing
Paul Ammann & Jeff Offutt
Chapter 13 & 14 Software Testing Strategies and Techniques
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 14 Software Testing Techniques
Chapter 10 – Software Testing
Paul Ammann & Jeff Offutt
Chapter 18 Testing Conventional Applications.
CSE403 Software Engineering Autumn 2000 More Testing
Software Testing “If you can’t test it, you can’t design it”
Paul Ammann & Jeff Offutt
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:

1

Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component  Black box testingfocuses solely on the outputs  The outputs are generated in response to selected inputs and execution conditions. 2

Test Planning  Test planning should be done throughout the development cycle  especially early in the development cycle  As soon as customer requirements analysis has completed, the test team should start writing black box test cases against that requirements document. 3

Performing Black Box Testing  Black box testing finds errors in the external behavior of the code  incorrect or missing functionality  interface errors  errors in data structures used by interfaces  behavior or performance errors  initialization and termination errors.  Through this testing, we can determine if the functions appear to work according to specifications. 4

Performing Black Box Testing  It is best if the person who plans and executes black box tests is not the programmer of the code  It is best if the person does not know anything about the structure of the code. 5

Poor Specification of a Test Case 6

Preferred Specification of a Test Case 7

Requirements  When a user lands on the “Go to Jail” cell, the player goes directly to jail, does not pass go, does not collect $200.  On the next turn, the player must pay $50 to get out of jail and does not roll the dice or advance.  If the player does not have enough money, he or she is out of the game. 8

Things to Test There are many things to test in this short requirement above  Does the player get sent to jail after landing on “Go to Jail”?  Does the player receive $200 if “Go” is between the current space and jail?  Is $50 correctly decremented if the player has more than $50?  Is the player out of the game if he or she has less than $50? 9

 At first it is good to start out by testing some input that you know should definitely pass or definitely fail.  If these kinds of tests don’t work properly, you know you should just quit testing and put the code back into development.  We can start with a two obvious passing test case 10

11 Test Plan #1 for the Jail Requirement

Equivalence Partitioning  To keep down the testing costs, we don’t want to write several test cases that test the same aspect of our program.  A good test case uncovers a different class of errors  These are incorrect processing of all data that has been uncovered by prior test cases.  Equivalence partitioning is a strategy that can be used to reduce the number of test cases that need to be developed.  Equivalence partitioning divides the input domain of a program into classes 12

Equivalence Classes for Player Money  Less than $50  $50 or more 13

14 Test Plan #2 for the Jail Requirement

 If input conditions specify a range of values, create one valid and one or two invalid equivalence classes.  In the above example, this is (1) less than 50/invalid; 50 or more/valid.  If input conditions specify a member of a set, create one valid and one invalid equivalence class.  If an input condition is a Boolean, define one valid and one invalid class. 15

Boundary Value Analysis  According to Boris Beizer, “Bugs lurk in corners and congregate at boundaries.”  We need to focus testing at these boundaries.  This is called Boundary Value Analysis (BVA) and guides you to create test cases at the “edge” of the equivalence classes. 16

Boundary Value Analysis  Boundary value is defined as a data value  It corresponds to a minimum or maximum input, internal, or output value specified for a system or component  In the example, the boundary of the class is at 50  We should create test cases for the Player 1 having $49, $50, and $51.  These test cases will help to find common off-by-one errors  caused by errors like using >= when you mean to use >. 17

Boundary Value Analysis Test cases should be created for the boundaries (arrows) between equivalence classes  Less than $50  $50 or more 18

Creating BVA test case  If input conditions have a range from a to b (such as a=100 to b=300), create test cases: immediately below a (99) at a (100) immediately above a (101) immediately below b (299) at b (300) immediately above b (301) 19

COVERAGE CRITERIA FOR TESTING 20

ill-defined terms in Testing  complete testing  exhaustive testing  full coverage Are poorly defined terms because of theoretical limitation of software.  The number of potential inputs for most programs is so large as to be effectively infinite.  The only limitation is the size of the file that can be read by the parser.  the number of inputs is effectively infinite 21

Formal Coverage Criteria  We cannot test with all input  Coverage criteria are used to decide which test inputs to use.  Effective use of coverage criteria makes it more likely  Test engineers will find faults in a program This provides informal assurance Result : High quality and Reliability of the Software 22

Advantage of Coverage Criteria According to the practical perspective Coverage criteria provide rules for when to stop testing. 23

Graph Coverage Criteria Structural Coverage Criteria : Defined on a graph just in terms of nodes and edges Data Flow Coverage Criteria : Requires a graph to be annotated with references to variables 24

Node Coverage (Formal Definition): For each node n ∈ reach G (N 0 ), TR contains the predicate “visit n.” Node Coverage (NC): TR contains each reachable node in G. Structural Coverage Criteria -I Node Coverage (NC) (Standard Definition) Test set T satisfies node coverage on graph G if and only if for every syntactically reachable node n in N, there is some path p in path(T) such that p visits n. TR = { 0, 1, 2 } path(t 1 ) = [0, 1, 2] T 1 ={t 1 } T 1 satisfies node coverage on the graph

Structural Coverage Criteria - II Edge coverage is slightly stronger than node coverage  Edge Coverage (EC) : TR contains each reachable path of length up to 1, inclusive, in G.  The “length up to 1” allows for graphs with one node and no edges Edge Coverage : TR = { (0,1), (0, 2), (1, 2) } path (t 1 ) = [ 0,1,2] path (t 2 ) = [ 0, 2 ] T 2 ={t 1, t 2 } Test Paths = [ 0, 1, 2 ] [ 0, 2 ] T 2 satisfies edge coverage on the graph

Structural Coverage Example Node Coverage TR = { 0, 1, 2, 3, 4, 5, 6 } Test Paths: [ 0, 1, 2, 3, 6 ] [ 0, 1, 2, 4, 5, 4, 6 ] Edge Coverage TR = { (0,1), (0,2), (1,2), (2,3), (2,4), (3,6), (4,5), (4,6), (5,4) } Test Paths: [ 0, 1, 2, 3, 6 ] [ 0, 2, 4, 5, 4, 6 ] path (t 1 )= [ 0, 1, 2, 3, 6 ] path (t 2 )=[ 0, 2, 4, 5, 4, 6 ] T={t 1, t 2 }