Black Box Testing or Behavioral Testing Saranya.V AP/CSE, Sri Vidya College of Engineering & Technology, Virudhunagar
• Only input & output functionality are visible.• Inputs are given and outputs are compared against specification.Features: Correct outputs from inputs properly. Test cases are designed from user requirements. Test planning can begin early in the software process. Looking at the program from an external point of view.
Black Box Testing Inputs causing Input Test Data I anomalous behavior System Outputs whichoutput Test Results O reveal the presence of defects
Black Box Testing is a “Expert” in Finding• Incorrect or missing functions.• Interface errors• Behavior or performance errors.• Initialization and termination errors.• Errors in data structures• External database errors.
Graph Based Testing Methods• First step in Black Box Testing to understand the objects• Used to connect the objects.• Next step is to define a series of tests that verify all the objects.“To accomplish these steps, the software engineer begins by creating”• Graph: collection of nodes that represent objects.• Links: Relationship between objects.• Node Weights: Properties of nodes• Link Weights: Characteristics of a link.
Sample Graph Notation Directed Link Object 1 Object 2 Object 3•Nodes are represented as circles.•Links between nodes are categorized as: •Directed Link (one direction) •Bidirectional or Undirected or Symmetric Link: both directions. •Parceled links: different relationships established between nodes.
1. Equivalence Partitioning• One of the black box testing method that divides the input domain of a program into classes• Define a test case that uncovers classes of errors.• Equivalence class represents a set of valid or invalid states for input conditions.
2. Boundary Value Analysis (BVA)• Errors tend to occur at the boundaries of the input domain rather than in center.• So we need boundary value analysis (testing technique)• BVA derived test cases from the output domain.
3. Comparison Testing• If the output from the each version is same, assume all implementations are correct.• If the output is different, each of the applications is investigated to determine if a defect in one or more versions is responsible for the difference.• We have to provide same input and check the output.
4. Orthogonal Array Testing• Used to finding errors associated with region faults.• number of inputs to the system is relatively small, but too large to allow for exhaustive testing of every possible input to the systems.• It provides good test coverage with test cases.
5. Syntax Driven Testing• Very good methodology for compliers and parsers.• Use BNF notation.• Described by grammar.• Grammar for simple arithmetic:(exp)::=(exp)+(term)|(exp)-(term)|(term)(term)::=(term)*(factor)|(term)-(factor)|(factor)(factor)::=(identifier)|(<expression>)(id)::=|a|b|c|d|e………|z
6. Decision Table-Based Testing • Ex: Toy Text Editor • Here n=4; • 1. Copy • 2. Paste • 3. Underline • 4. Boldface
Ex:2 Liquid Level • Sensor 1 : used to check upper level • Sensor 2: used to Sensor 1 check Lower level • Sensor 1 is active : open output valve • Sensor 2 is activeSensor 2 open input valve.
7. Cause and Effect Graphs in Functional Testing• Represents relationship between input and output• Input cause• Output effect.Ex: ATM Banking Transaction System
Causes:C1: Command is creditC2: Command is DebitC3: 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 accountE5: credit account.
Types processing modes• And effect occurs of all the inputs are true.• Or Effect occurs if at least one input is true• Negation : effect occurs if input are false.
C2 and E3C3C4 Used to reduce the test case count C1 C2 C3 C4 Don’t care condition True false