0% found this document useful (0 votes)
419 views14 pages

Black Box Testing

Black box testing is a type of software testing where the internal structure or implementation of the system is not known to the tester. It involves testing the functionality of an application without seeing the internal structure or code. There are three main types of black box testing: functional testing, non-functional testing, and regression testing. Techniques used for black box testing include boundary value analysis, equivalence partitioning, decision table testing, and use case testing. Boundary value analysis and equivalence partitioning help reduce the number of test cases by dividing input data into equivalent classes. Decision table testing captures different input combinations and expected outputs in a tabular format.

Uploaded by

Panu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
419 views14 pages

Black Box Testing

Black box testing is a type of software testing where the internal structure or implementation of the system is not known to the tester. It involves testing the functionality of an application without seeing the internal structure or code. There are three main types of black box testing: functional testing, non-functional testing, and regression testing. Techniques used for black box testing include boundary value analysis, equivalence partitioning, decision table testing, and use case testing. Boundary value analysis and equivalence partitioning help reduce the number of test cases by dividing input data into equivalent classes. Decision table testing captures different input combinations and expected outputs in a tabular format.

Uploaded by

Panu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

What is Black Box Testing?

Black box testing is also known as opaque technique, behavioral testing, functional testing, and closed-box
testing is a type of software testing.
When we enter a topic to search on the search engine, we type out the topic and enter search.
The result is obtained thereafter without looking at the internal structure or working. This is an appropriate
example of black-box testing.

How is Black Box Testing done?

The steps for carrying out Black Box Testing are as follows:

 At first, the application to be tested is studied to find out the requirements and specifications. The SRS
(Software Requirement Specification) document should be maintained with accuracy.
 The inputs and test scenarios are evaluated. Efficient and time-saving techniques are incorporated.
 Test cases are generated. These test cases are made in such a way that the input range is maximum.
 The test cases are then processed to obtain the output. The generated output is compared with the expected
output to understand the success of the result.
 If there are unsuccessful steps, they are sent to the software development teams for fixing.
 The defects are fixed.
 Run the tests again for confirmation.

Types of Black Box Testing


There are three types of black-box testing namely- functional testing, non-functional testing, and regression
testing.
1. Functional Testing
If a particular function or feature of the software is tested then it is categorized under black-box testing. For
example, if the correct pin is entered then money can be transferred and if the incorrect pin is entered, the
transaction fails.

Examples of Functional Testing are:


 Unit Testing
 Smoke Testing
 Sanity Testing
 Integration Testing  `
 User Acceptance Testing

2. Non-functional Testing
If Black box testing is used to test more aspects other than functionalities and features it comes under the
umbrella of non-functional testing. Non-functional testing revolves around examining how well the system
does a job.
This can testify whether or not the software is:
 Capable of working when the load is maximum
 Compatible to work with different devices
 Easy to use
3. Regression Testing

Regression testing helps to find if the new codes have had any ill effects on the already existing ones.
Regression testing is basically selecting complete or parts of test cases that had already been executed to
make sure that the functionalities do have any abnormalities.
In easy words, it tests to make sure that the new codes do not have side effects on the old codes. The
different regression testing tools are Selenium, Quick Test Professional or QTP, Rational Functional Tester.

Techniques of Black Box Testing

Boundary Value Analysis and Equivalence Partitioning Testing

What is Boundary Testing?


Boundary testing is the process of testing between extreme ends or boundaries between partitions of the input
values.

 So these extreme ends like Start- End, Lower- Upper, Maximum-Minimum, Just Inside-Just Outside
values are called boundary values and the testing is called “boundary testing”.
 The basic idea in normal boundary value testing is to select input variable values at their:

1. Minimum
2. Just above the minimum
3. A nominal value
4. Just below the maximum
5. Maximum

 In Boundary Testing, Equivalence Class Partitioning plays a good role


 Boundary Testing comes after the Equivalence Class Partitioning.
Equivalence Partitioning
Equivalence Partitioning or Equivalence Class Partitioning is type of black box testing technique which can be
applied to all levels of software testing like unit, integration, system, etc. In this technique, input data units are
divided into equivalent partitions that can be used to derive test cases which reduces time required for testing
because of small number of test cases.

 It divides the input data of software into different equivalence data classes.
 You can apply this technique, where there is a range in the input field.

Example 1: Equivalence and Boundary Value


 Let’s consider the behavior of Order Pizza Text Box Below
 Pizza values 1 to 10 is considered valid. A success message is shown.
 While value 11 to 99 are considered invalid for order and an error message will appear, “Only 10 Pizza
can be ordered”

Submit
Order Pizza:
Here is the test condition

1. Any Number greater than 10 entered in the Order Pizza field(let say 11) is considered invalid.
2. Any Number less than 1 that is 0 or below, then it is considered invalid.
3. Numbers 1 to 10 are considered valid
4. Any 3 Digit Number say -100 is invalid.

We cannot test all the possible values because if done, the number of test cases will be more than 100. To address
this problem, we use equivalence partitioning hypothesis where we divide the possible values of tickets into
groups or sets as shown below where the system behavior can be considered the same.

The divided sets are called Equivalence Partitions or Equivalence Classes. Then we pick only one value from
each partition for testing. The hypothesis behind this technique is that if one condition/value in a partition
passes all others will also pass. Likewise, if one condition in a partition fails, all other conditions in that
partition will fail.
Boundary Value Analysis– in Boundary Value Analysis, you test boundaries between equivalence partitions

In our earlier equivalence partitioning example, instead of checking one value for each partition, you will check
the values at the partitions like 0, 1, 10, 11 and so on. As you may observe, you test values at both valid and
invalid boundaries. Boundary Value Analysis is also called range checking.

Equivalence partitioning and boundary value analysis(BVA) are closely related and can be used together at all
levels of testing.
Example 2: Equivalence and Boundary Value
Following password field accepts minimum 6 characters and maximum 10 characters

That means results for values in partitions 0-5, 6-10, 11-14 should be equivalent

Submit
Enter Password:  

Test Scenario # Test Scenario Description Expected Outcome

1 Enter 0 to 5 characters in password field System should not accept

2 Enter 6 to 10 characters in password field System should accept

3 Enter 11 to 14 character in password field System should not accept

Examples 3: Input Box should accept the Number 1 to 10


Here we will see the Boundary Value Test Cases

Test Scenario Description Expected Outcome

Boundary Value = 0 System should NOT accept

Boundary Value = 1 System should accept

Boundary Value = 2 System should accept

Boundary Value = 9 System should accept

Boundary Value = 10 System should accept

Boundary Value = 11 System should NOT accept

Why Equivalence & Boundary Analysis Testing


1. This testing is used to reduce a very large number of test cases to manageable chunks.
2. Very clear guidelines on determining test cases without compromising on the effectiveness of testing.
3. Appropriate for calculation-intensive applications with a large number of variables/inputs
What is Decision Table Testing?
Decision table testing is a software testing technique used to test system behavior for different input
combinations. This is a systematic approach where the different input combinations and their corresponding
system behavior (Output) are captured in a tabular form. That is why it is also called as a Cause-Effect table
where Cause and effects are captured for better test coverage.

A Decision Table is a tabular representation of inputs versus rules/cases/test conditions. It is a very effective tool
used for both complex software testing and requirements management. A decision table helps to check all
possible combinations of conditions for testing and testers can also identify missed conditions easily. The
conditions are indicated as True(T) and False(F) values.
 

Let’s learn with an example.

Example 1: How to make Decision Base Table for Login Screen


Let’s create a decision table for a login screen.

The condition is simple if the user provides the correct username and password the user will be redirected to the
homepage. If any of the input is wrong, an error message will be displayed.

Conditions Rule 1 Rule 2 Rule 3 Rule 4


Username (T/F) F T F T
Password (T/F) F F T T
Output (E/H) E E E H
Legend:

 T – Correct username/password


 F – Wrong username/password
 E – Error message is displayed
 H – Home screen is displayed

Interpretation:

 Case 1 – Username and password both were wrong. The user is shown an error message.
 Case 2 – Username was correct, but the password was wrong. The user is shown an error message.
 Case 3 – Username was wrong, but the password was correct. The user is shown an error message.
 Case 4 – Username and password both were correct, and the user navigated to the homepage
While converting this to a test case, we can create 2 scenarios,

 Enter the correct username and correct password and click on login, and the expected result will be the
user should be navigated to the homepage

And one from the below scenario

 Enter wrong username and wrong password and click on login, and the expected result will be the user
should get an error message
 Enter correct username and wrong password and click on login, and the expected result will be the user
should get an error message
 Enter wrong username and correct password and click on login, and the expected result will be the user
should get an error message

As they essentially test the same rule.

Example 2: How to make Decision Table for Upload Screen


Now consider a dialogue box that will ask the user to upload a photo with certain conditions like –

1. You can upload only ‘.jpg’ format image


2. file size less than 32kb
3. resolution 137*177.

If any of the conditions fails the system will throw a corresponding error message stating the issue and if all
conditions are met photo will be updated successfully

Let’s create the decision table for this case.

Conditions Case 1 Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 Case 8


Format .jpg .jpg .jpg .jpg Not .jpg Not .jpg Not .jpg Not .jpg
Less than Less than Less than Less than
Size >= 32kb >= 32kb >= 32kb >= 32kb
32kb 32kb 32kb 32kb
Not Not
resolution 137*177 137*177 137*177 Not 137*177 137*177 Not 137*177
137*177 137*177
Error
Error Error Error
Error Error Error message for
message size message message for
Photo message message message for format, size,
Output and format and format and
uploaded resolution size format and
resolution resolution size
mismatch mismatch mismatch resolution
mismatch mismatch mismatch
mismatch
For this condition, we can create 8 different test cases and ensure complete coverage based on the above table.

1. Upload a photo with format ‘.jpg’, size less than 32kb and resolution 137*177 and click on upload.
Expected result is Photo should upload successfully
2. Upload a photo with format ‘.jpg’, size less than 32kb and resolution not 137*177 and click on upload.
Expected result is Error message resolution mismatch should be displayed
3. Upload a photo with format ‘.jpg’, size more than 32kb and resolution 137*177 and click on upload.
Expected result is Error message size mismatch should be displayed
4. Upload a photo with format ‘.jpg’, size more than equal to 32kb and resolution not 137*177 and click on
upload. Expected result is Error message size and resolution mismatch should be displayed
5. Upload a photo with format other than ‘.jpg’, size less than 32kb and resolution 137*177 and click on
upload. Expected result is Error message for format mismatch should be displayed
6. Upload a photo with format other than ‘.jpg’, size less than 32kb and resolution not 137*177 and click on
upload. Expected result is Error message format and resolution mismatch should be displayed
7. Upload a photo with format other than ‘.jpg’, size more than 32kb and resolution 137*177 and click on
upload. Expected result is Error message for format and size mismatch should be displayed
8. Upload a photo with format other than ‘.jpg’, size more than 32kb and resolution not 137*177 and click
on upload. Expected result is Error message for format, size and resolution mismatch should be displayed

Why Decision Table Testing is Important?


Decision Table Testing is Important because it helps to test different combinations of conditions and provides
better test coverage for complex business logic. When testing the behavior of a large set of inputs where system
behavior differs with each set of inputs, decision table testing provides good coverage and the representation is
simple so it is easy to interpret and use.
In Software Engineering, boundary value and equivalent partition are other similar techniques used to ensure
better coverage. They are used if the system shows the same behavior for a large set of inputs. However, in a
system where for each set of input values the system behavior is different, boundary value and equivalent
partitioning technique are not effective in ensuring good test coverage.

In this case, decision table testing is a good option. This technique can make sure of good coverage, and the
representation is simple so that it is easy to interpret and use.

This table can be used as the reference for the requirement and for functionality development since it is easy to
understand and cover all the combinations.

The significance of this technique becomes immediately clear as the number of inputs increases. Number of
possible Combinations is given by 2 ^ n , where n is the number of Inputs. For n = 10, which is very common in
the web-based testing, having big input forms, the number of combinations will be 1024. Obviously, you cannot
test all but you will choose a rich sub-set of the possible combinations using decision based testing technique.

Advantages of Decision Table Testing


 When the system behavior is different for different inputs and not the same for a range of inputs, both
equivalent partitioning, and boundary value analysis won’t help, but a decision table can be used.
 The representation is simple so that it can be easily interpreted and is used for development and business
as well.
 This table will help to make effective combinations and can ensure better coverage for testing
 Any complex business conditions can be easily turned into decision tables
 In a case we are going for 100% coverage typically when the input combinations are low, this technique
can ensure the coverage.

Disadvantages of Decision Table Testing


The main disadvantage is that when the number of inputs increases the table will become more complex
What is State Transition Testing?
State Transition Testing is a black box testing technique in which changes made in input conditions cause state
changes or output changes in the Application under Test(AUT). State transition testing helps to analyze behaviour
of an application for different input conditions. Testers can provide positive and negative input test values and
record the system behavior.
It is the model on which the system and the tests are based. Any system where you get a different output for the
same input, depending on what has happened before, is a finite state system.

State Transition Testing Technique is helpful where you need to test different system transitions.

When to Use State Transition?


 This can be used when a tester is testing the application for a finite set of input values.
 When the tester is trying to test sequence of events that occur in the application under test. I.e., this will
allow the tester to test the application behavior for a sequence of input values.
 When the system under test has a dependency on the events/values in the past.

When to Not Rely On State Transition?


 When the testing is not done for sequential input combinations.
 If the testing is to be done for different functionalities like exploratory testing

Four Parts Of State Transition Diagram


There are 4 main components of the State Transition Model as below

1) States that the software might get

2) Transition from one state to another

3) Events that origin a transition like closing a file or withdrawing money

4) Actions that result from a transition (an error message or being given the cash.)
State Transition Diagram and State Transition Table
There are two main ways to represent or design state transition, State transition diagram, and state transition table.

In state transition diagram the states are shown in boxed texts, and the transition is represented by arrows. It is
also called State Chart or Graph. It is useful in identifying valid transitions.

In state transition table all the states are listed on the left side, and the events are described on the top. Each cell in
the table represents the state of the system after the event has occurred. It is also called State Table. It is useful in
identifying invalid transitions.

How to Make a State Transition (Examples of a State Transition)


Example 1:
Let’s consider an ATM system function where if the user enters the invalid password three times the account will
be locked.

In this system, if the user enters a valid password in any of the first three attempts the user will be logged in
successfully. If the user enters the invalid password in the first or second try, the user will be asked to re-enter the
password. And finally, if the user enters incorrect password 3 rd time, the account will be blocked.

State transition diagram

In the diagram whenever the user enters the correct PIN he is moved to Access granted state, and if he enters the
wrong password he is moved to next try and if he does the same for the 3 rd time the account blocked state is
reached.
State Transition Table
Correct PIN Incorrect PIN
S1) Start S5 S2
S2) 1st attempt S5 S3
S3) 2  attempt
nd
S5 S4
S4) 3  attempt
rd
S5 S6
S5) Access Granted – –
S6) Account blocked – –
In the table when the user enters the correct PIN, state is transitioned to S5 which is Access granted. And if the
user enters a wrong password he is moved to next state. If he does the same 3 rd time, he will reach the account
blocked state.

Example 2:

In the flight reservation login screen, consider you have to enter correct agent name and password to access the
flight reservation application.

State Transition Graph


It gives you the access to the application with correct password and login name, but what if you entered the wrong
password.

The application allows three attempts, and if users enter the wrong password at 4th attempt, the system closes the
application automatically.

The State Graphs helps you determine valid transitions to be tested. In this case, testing with the correct password
and with an incorrect password is compulsory. For the test scenarios, log-in on 2 nd, 3rd and 4th attempt anyone could
be tested.

You can use State Table to determine invalid system transitions.


In a State Table, all the valid states are listed on the left side of the table, and the events that cause them on the
top.

Each cell represents the state system will move to when the corresponding event occurs.

For example, while in S1 state you enter a correct password you are taken to state S6 (Access Granted). Suppose
if you have entered the wrong password at first attempt you will be taken to state S3 or 2nd Try.

Likewise, you can determine all other states.

Two invalid states are highlighted using this method. Suppose you are in state S6 that is you are already logged
into the application, and you open another instance of flight reservation and enter valid or invalid passwords for
the same agent. System response for such a scenario needs to be tested.

Advantages and Disadvantages of State Transition Technique


Advantages Disadvantages
This testing technique will provide a pictorial or The main disadvantage of this testing technique is that we
tabular representation of system behavior which can’t rely in this technique every time. For example, if the
will make the tester to cover and understand the system is not a finite system (not in sequential order), this
system behavior effectively. technique cannot be used.
Another disadvantage is that you have to define all the
By using this testing, technique tester can verify
possible states of a system. While this is all right for small
that all the conditions are covered, and the results
systems, it soon breaks down into larger systems as there is an
are captured
exponential progression in the number of states.
Black Box Testing Vs. White Box Testing
Below is the main difference between White Box and Black Box Testing:

Difference between Black Box and White Box Testing


Parameter Black Box testing White Box testing
It is a testing approach which is used to test the It is a testing approach in which
Definition software without the knowledge of the internal internal structure is known to the
structure of program or application. tester.
It is also called structural testing,
It also knowns as data-driven, box testing, data-,
Alias clear box testing, code-based
and functional testing.
testing, or glass box testing.
Testing is based on external expectations; internal Internal working is known, and the
Base of Testing
behavior of the application is unknown. tester can test accordingly.
Testing is best suited for a lower
This type of testing is ideal for higher levels of
Usage level of testing like Unit Testing,
testing like System Testing, Acceptance testing.
Integration testing.
Programming Programming knowledge is not needed to perform Programming knowledge is required
knowledge Black Box testing. to perform White Box testing.
Implementation Implementation knowledge is not requiring doing Complete understanding needs to
knowledge Black Box testing. implement WhiteBox testing.
Test and programmer are dependent on each other, White Box testing is easy to
Automation
so it is tough to automate. automate.
The main objective of White Box
The main objective of this testing is to check what
Objective testing is done to check the quality
functionality of the system under test.
of the code.
Testing can start after preparing requirement Testing can start after preparing for
Basis for test cases
specification document. Detail design document.
Usually done by tester and
Tested by Performed by the end user, developer, and tester.
developers.
Granularity Granularity is low. Granularity is high.
Data domain and internal
Testing method It is based on trial and error method.
boundaries can be tested.
Exhaustive and time-consuming
Time It is less exhaustive and time-consuming.
method.
Algorithm test Not the best method for algorithm testing. Best suited for algorithm testing.
White box testing requires code
Code Access Code access is not required for Black Box Testing. access. Thereby, the code could be
stolen if testing is outsourced.
Benefit Well suited and efficient for large code segments. It allows removing the extra lines of
code, which can bring in hidden
Parameter Black Box testing White Box testing
defects.
Low skilled testers can test the application with no Need an expert tester with vast
Skill level knowledge of the implementation of programming experience to perform white box
language or operating system. testing.
Statement Coverage, Branch
Equivalence partitioning is Black box testing coverage, and Path coverage are
technique is used for Blackbox testing. White Box testing technique.

Equivalence partitioning divides input values into Statement Coverage validates


valid and invalid partitions and selecting whether every line of the code is
Techniques corresponding values from each partition of the test executed at least once.
data.
Branch coverage validates whether
Boundary value analysis each branch is executed at least once

checks boundaries for input values. Path coverage method tests all the
paths of the program.
Automated test cases can become
Update to automation test script is essential if you
Drawbacks useless if the code base is rapidly
to modify application frequently.
changing.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy