0% found this document useful (0 votes)
4 views

Black Box Testing

Decision Table Testing is a systematic software testing technique that uses tabular representations to evaluate system behavior based on various input combinations. It helps ensure comprehensive test coverage by identifying all possible conditions and their corresponding outputs. The document also discusses related concepts such as positive and negative testing, requirements-based testing, and cause-effect graphing, illustrating these methods with examples.

Uploaded by

Atharva Kulkarni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Black Box Testing

Decision Table Testing is a systematic software testing technique that uses tabular representations to evaluate system behavior based on various input combinations. It helps ensure comprehensive test coverage by identifying all possible conditions and their corresponding outputs. The document also discusses related concepts such as positive and negative testing, requirements-based testing, and cause-effect graphing, illustrating these methods with examples.

Uploaded by

Atharva Kulkarni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

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.
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.


Conditio Case 1 Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 Case 8
ns

Format .jpg .jpg .jpg .jpg Not Not Not Not


.jpg .jpg .jpg .jpg
Size Less Less >= >= Less Less >= >=
than than 32kb 32kb than than 32kb 32kb
32kb 32kb 32kb 32kb

resolutio 137*17 Not 137*17 Not 137*17 Not 137*17 Not


n 7 137*17 7 137*17 7 137*17 7 137*17
7 7 7 7

Output Photo Error Error Error Error Error Error Error


upload messa messa messa messa messa messa messa
ed ge ge size ge size ge for ge ge for ge for
resoluti mismat and format format format format,
on ch resoluti mismat and and size,
mismat on ch resoluti size and
ch mismat on mismat resoluti
ch mismat ch on
ch mismat
ch
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

Positive Testing and Negative Testing with Examples


Software testing is the process of verifying and validating a software application to
check whether it is working as expected. The intent is to find defects and improve
product quality. There are two ways to test software, namely Positive Testing, and
Negative Testing.
Positive Testing

Positive Testing is a type of testing which is performed on a software application by


providing the valid data sets as an input. It checks whether the software application
behaves as expected with positive inputs or not. Positive testing is performed in order to
check whether the software application does exactly what it is expected to do.
For example –

There is a text box in an application which can accept only numbers. Entering values up
to 99999 will be acceptable by the system and any other values apart from this should
not be acceptable. To do positive testing, set the valid input values from 0 to 99999 and
check whether the system is accepting the values.
Negative Testing

Negative Testing is a testing method performed on the software application by


providing invalid or improper data sets as input. It checks whether the software
application behaves as expected with the negative or unwanted user inputs. The
purpose of negative testing is to ensure that the software application does not crash and
remains stable with invalid data inputs.
For example –

Negative testing can be performed by entering characters A to Z or from a to z. Either


software system should not accept the values or else it should throw an error message
for these invalid data inputs.
In both the testing, the following needs to be considered:
● Input data
● An action which needs to be performed
● Output Result
Testing Technique used for Positive and Negative Testing:
Following techniques are used for Positive and negative validation of testing is:
● Boundary Value Analysis
● Equivalence Partitioning

What is Requirements based Testing?


Requirements-based testing is a testing approach in which test cases, conditions and
data are derived from requirements. It includes functional tests and also non-functional
attributes such as performance, reliability or usability.

Stages in Requirements based Testing:


​ Defining Test Completion Criteria - Testing is completed only when all the
functional and non-functional testing is complete.
​ Design Test Cases - A Test case has five parameters namely the initial
state or precondition, data setup, the inputs, expected outcomes and
actual outcomes.
​ Execute Tests - Execute the test cases against the system under test and
document the results.
​ Verify Test Results - Verify if the expected and actual results match each other.
​ Verify Test Coverage - Verify if the tests cover both functional and non-functional
aspects of the requirement.
​ Track and Manage Defects - Any defects detected during the testing process
goes through the defect life cycle and are tracked to resolution. Defect Statistics
are maintained which will give us the overall status of the project.

Requirements Testing process:


​ Testing must be carried out in a timely manner.
​ Testing process should add value to the software life cycle, hence it needs
to be effective.
​ Testing the system exhaustively is impossible hence the testing process
needs to be efficient as well.
​ Testing must provide the overall status of the project, hence it should be
manageable.


​ RTM is a document that confirms the requirements defined for a system
are linked correctly during the verification process. It helps the testing team
understand the testing level done for a given product. The traceability
process is used to review the test cases defined for any requirement.

Cause effect Graphing – This technique establishes a relationship between logical


input called causes with corresponding actions called the effect. The causes and effects
are represented using Boolean graphs. The following steps are followed:
1. Identify inputs (causes) and outputs (effect).
2. Develop a cause-effect graph.
3. Transform the graph into a decision table.
4. Convert decision table rules to test cases.

For example, in the following cause-effect graph:

It can be converted into a decision table like:

Each column corresponds to a rule which will become a test case for testing. So there
will be 4 test cases.
Notations Used:
Now let’s try to implement this technique with some examples:

● Draw a Cause and Effect graph based on a requirement/situation.


● Cause and Effect Graph is given, draw a Decision table based on it to draw
the test case.

Let’s see both of them one by one.

Draw A Cause And Effect Graph According To Situation

Situation:

The “Print message” is software that reads two characters and, depending on their
values, messages is printed.

● The first character must be an “A” or a “B”.


● The second character must be a digit.
● If the first character is an “A” or “B” and the second character is a digit,
then the file must be updated.
● If the first character is incorrect (not an “A” or “B”), the message X must be
printed.
● If the second character is incorrect (not a digit), the message Y must be
printed.

Solution:

The Causes of this situation are:

C1 – First character is A

C2 – First character is B

C3 – the Second character is a digit

The Effects (results) for this situation are:

E1 – Update the file

E2 – Print message “X”

E3 – Print message “Y”

LET’S START!!
First, draw the Causes and Effects as shown below:

Key – Always go from Effect to Cause (left to right). That means, to get effect “E”,
what causes should be true.

In this example, let’s start with Effect E1.

Effect E1 is for updating the file. The file is updated when

– The first character is “A” and the second character is a digit

– The first character is “B” and the second character is a digit

– The first character can either be “A” or “B” and cannot be both.

Now let’s put these 3 points in symbolic form:

For E1 to be true – the following are the causes:

– C1 and C3 should be true

– C2 and C3 should be true

– C1 and C2 cannot be true together. This means C1 and C2 are mutually exclusive.
Now let’s draw this:

So as per the above diagram, for E1 to be true the condition is (C1 C2) C3

The circle in the middle is just an interpretation of the middle point to make the graph
less messy.

There is a third condition where C1 and C2 are mutually exclusive. So the final graph for
effect E1 to be true is shown below:
Let’s move to Effect E2:

E2 states print message “X”. Message X will be printed when the First character is
neither A nor B.

This means Effect E2 will hold true when either C1 OR C2 is invalid. So the graph for
Effect E2 is shown as (In blue line)

For Effect E3.

E3 states print message “Y”. Message Y will be printed when the Second character is
incorrect.

This means Effect E3 will hold true when C3 is invalid. So the graph for Effect E3 is
shown as (In Green line)
This completes the Cause and Effect graph for the above situation.

Now let’s move to draw the Decision table based on the above graph.

Writing Decision Table Based On Cause And Effect graph

First, write down the Causes and Effects in a single column shown below

The Key is the same. Go from bottom to top which means traverse from Effect to
Cause.

Start with Effect E1. For E1 to be true, the condition is (C1 C2) C3.

Here we are representing True as 1 and False as 0

First, put Effect E1 as True in the next column as


Now for E1 to be “1” (true), we have the below two conditions –

C1 AND C3 will be true

C2 AND C3 will be true

For E2 to be True, either C1 or C2 has to be False shown as,

For E3 to be true, C3 should be false.

So it is completed. Let’s complete the graph by adding 0 in the blank column and
include the test case identifier.
Writing Test Cases From The Decision Table

Below is a sample test case for Test Case 1 (TC1) and Test Case 2 (TC2).

You might also like