Chapter-3 Black Box Testings
Chapter-3 Black Box Testings
---Colin Hanks
1 Tadele M.
Black Box Testing
2
Example of Black Box Testing
A simple black box testing example for a login functionality of a web application without having
access to the internal code or implementation details.
Test Case Name: Verify successful login with valid credentials.
Test Steps:
Open the web browser.
Enter the URL of the application’s login page.
Enter a valid username in the username field.
Enter a valid password in the password field.
Click on the “Login” button.
Wait for the application to process the login request.
Expected Result: The user should be successfully logged into homepage.
Test Case Status: PASS (if the user is redirected to the homepage)
3
Features of Black Box Testing
Key characteristics of black box testing include:
Focus on External Behavior: Black box testing emphasizes evaluating the software’s functionality
from an end-user perspective, focusing on how the system behaves with different inputs and usage
scenarios.
Independence from Internal Code: Testers conducting black box testing do not require
knowledge of the internal code or implementation details, making it suitable for testers who may not
have programming expertise.
Requirement-Based Testing: Test cases in black box testing are designed based on the software’s
requirements and specifications. This ensures that the application meets the intended functionality and
business objectives.
Real-World Scenario Testing: Black box testing helps simulate real-user conditions, allowing
testers to identify defects that might arise during actual usage of the software.
Validation of Interfaces: It is effective in verifying the accuracy of the software’s interfaces, ensuring
that inputs and outputs are correctly handled.
4
Limitations of Black Box Testing
Limited Code Coverage: Black box testing may not explore all possible code paths or
internal logic, potentially leaving certain defects undetected.
Inability to Test Complex Algorithms: It may not be effective at validating complex
algorithms or intricate business logic that requires knowledge of the internal code.
Dependency on Requirements: Test cases are heavily dependent on the accuracy and
completeness of the provided requirements. Incomplete or ambiguous requirements can
result in incomplete testing.
Difficulty in Error Localization: Identifying the root cause of defects detected in
black box testing can be challenging, as testers lack access to internal code.
5
Black Box Testing…
Black-box testing attempts to find errors in the following categories:
Incorrect or missing functions
Interface errors
Errors in data structures or external data base access.
Behavior or performance errors
Initialization and termination errors.
Commonly used Black Box methods :
1. Error guessing
2. Equivalence partitioning
3. Boundary-value analysis
6
Error guessing techniques
It is a type of black box testing technique which does not have any defined structure to find
the error.
The tester uses the experience of the tester or analyst having prior experience with similar
applications to guess the problematic areas of the software.
Its accomplishment is dependent on the ability and product knowledge of the tester because
a good test engineer knows where the bugs are most likely to be, which helps to save lots of
time.
It can be done by those people who have product knowledge; it cannot be done by those
who are new to the product.
With this, we cannot give the surety of the product quality.
7
Error guessing techniques
The main purpose of this technique is to identify common errors at any level of
testing by exercising the following tasks:
Enter blank space into the text fields.
Null pointer exception.
Enter invalid parameters.
Divide by zero.
Use maximum limit of files to be uploaded.
Check buttons without entering values.
8
Equivalence Class partitioning
Divide the input space into equivalent classes.
If the software works for a test case from a class then it is likely to work for all
Can reduce the set of test cases if such equivalent classes can be identified
Getting ideal equivalent classes is impossible, without looking at the internal
structure of the program
For robustness, include equivalent classes for invalid inputs too.
Example: Look at the following taxation table
12
Cause Effect graphing…
The steps in developing test cases with a cause-and-effect graph are as follows
Decompose the specification of a complex software component into lower-level units.
Identify causes and their effects for each specification unit.
Define the rules
Create Boolean cause-and-effect graph.
Causes and effects are nodes
dependency b/n nodes are represented by arcs
Annotate the graph with constraints that describe combinations of causes and/or effects that
are not possible due to environmental or syntactic constraints (if needed).
The graph is then converted to a decision table.
The columns in the decision table are transformed into test cases
13
Cause Effect graphing…
Consider the following set of requirements as an example:
Requirements for Calculating Car Insurance Premiums:
R00101 For females less than 65 years of age, the premium is $500
R00102 For males less than 25 years of age, the premium is $3000
R00103 For males between 25 and 64 years of age, the premium is $1000
R00104 For anyone 65 years of age or more, the premium is $1500
The causes and their effects identified from the specification are:
14
22
Cause Effect graphing…
Define the Rules
If gender is female and age is less than 65, the premium is $500
If gender is male and age is less than 25, the premium is $3000
If gender is male and age is b/n 25 and 65, the premium is $1000
If gender is male or female and age is greater than 65, the premium is $1500
Now, Draw the cause/ Effect graph from the rules
23
15
Cause Effect graphing…
The graph is converted to decision table
Since we have 5 input conditions we will have 2^5 = 32 columns
However , for simplicity only 6 are shown in this limited-entry decision
table.
From this table the test cases can be generated as shown in the next table
16
Cause Effect graphing…
Generate the test cases
The columns in the decision table are converted into test cases.
17
Tools used for Black Box Testing
Tools used for Black box testing largely depends on the type of black box testing you are
doing.
Functional/ Regression Tests you can use – QTP, Selenium
18
Test Plan
Testing usually starts with test plan and ends with acceptance
testing.
Test plan is a general document that defines the scope and
approach for testing for the whole project
Inputs are SRS, project plan, design, code, …
Test plan identifies what levels of testing will be done, what
units will be tested, etc in the project
It usually contains
Test unit specifications: what units need to be tested separately
Features to be tested: these may include functionality, performance,
usability,…
Approach: criteria to be used, when to stop, how to evaluate, etc
Test deliverables
Schedule and task allocation
19
IEEE 829 Test Plan Structure
Test Plan Identifier Test Deliverables
References Testing Tasks
Introduction Environmental Needs
Test Items Responsibilities
Features To Be Tested Staffing And Training Needs
Features Not To Be Tested Schedule
Approach Risks And Contingencies
Item Pass/Fail Criteria Approvals
Suspension Criteria And Resumption Requirements Glossary
20