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

Black Box Testing Techniques Explained

Conditions

Uploaded by

urvashi4301
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)
14 views14 pages

Black Box Testing Techniques Explained

Conditions

Uploaded by

urvashi4301
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

Black Box Testing

Boundary value analysis:


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

Example 1

USER ID, accepts valid User Name and Password field accepts minimum 6 characters
and maximum 12 characters. Valid range 6-12, Invalid range 5 or less than 5 and
Invalid range 13 or more than 13.

Write Test Cases for Valid partition value, Invalid partition value and exact boundary
value.

Test Cases 1: Consider password length less than 6.

Test Cases 2: Consider password of length exactly 6.

Test Cases 3: Consider password of length between 7 and 11.

Test Cases 4: Consider password of length exactly 12.

Test Cases 5: Consider password of length more than 12.

Example 2

Test cases for the any input box accepts numbers between [Link] range 1-1000,
Invalid range 0 and Invalid range 1001 or more.

Write Test Cases for Valid partition value, Invalid partition value and exact boundary
value.

Test Cases 1: Consider test data exactly as the input boundaries of input domain i.e.
values 1 and 1000.

Test Cases 2: Consider test data with values just below the extreme edges of input
domains i.e. values 0 and 999.
Test Cases 3: Consider test data with values just above the extreme edges of input
domain i.e. values 2 and 1001.

Equivalence Class Partitioning:


Equivalence Partitioning = Equivalence Class Partitioning = ECP

Equivalence partitioning is a testing technique where input values set into classes for
testing.

Valid Input Class = Keeps all valid inputs.

Invalid Input Class = Keeps all Invalid inputs.

Example 1

(Telephone Number / Pin)

-A text field permits only numeric characters

-Length must be 6-10 characters long

Partition according to the requirement should be like this:

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

Test Scenario # Test Scenario Description Expected Outcome

1 Enter 0 to 5 characters in Telephone Field System should not accept

2 Enter 6 to 10 characters in Telephone Field System should accept

3 Enter 11 to 14 character in Telephone Field System should not accept

Decision Table Testing:


This test technique is appropriate for functionalities which has logical relationships
between inputs (if-else logic). In Decision table technique, we deal with combinations of
inputs. To identify the test cases with decision table, we consider conditions and
actions. We take conditions as inputs and actions as outputs.
Example 1: an example of transferring money online to an account which is already
added and approved.

Conditions (inputs) to transfer money:

1- ACCOUNT ALREADY APPROVED

2- OTP (One Time Password) MATCHED

3- SUFFICIENT MONEY IN THE ACCOUNT

And Actions (output) performed:

1-TRANSFER MONEY

2- SHOW A MESSAGE AS INSUFFICIENT AMOUNT

3- BLOCK THE TRANSACTION INCASE OF SUSPICIOUS TRANSACTION

In the first column I took all the conditions and actions related to the requirement. All the
other columns represent Test Cases.

T = True, F = False, X = Not possible

From the case 3 and case 4, we could identify that if condition 2 failed then system will
execute Action 3. So we could take either of case 3 or case 4
So finally concluding with the below tabular column.

We write 4 test cases for this requirement.

Example 2: login page validation. Allow user to login only when both the ‘User ID’ and
‘Password’ are entered correct.

Conditions (inputs) to allow user to login:

1- ENTER VALID USER ID

2- ENTER VALID PASSWORD

And Actions (output) performed:

1- Displaying home page

2- Displaying an error message that User ID or Password is wrong


From the case 2 and case 3, we could identify that if one of the condition failed then the
system will display an error message as Invalid User Credentials.

So I am eliminating one of the test case from case 2 and case 3 and concluding with the
below tabular column.
State Transition Testing:
It is a black box testing technique in which the tester analyzes the behavior of an
application under test for different input conditions in a sequence. In this technique,
tester provides both positive and negative input test values and record the system
behavior.

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

Example 1: In the Bank login screen, consider you have to enter correct User ID and
password to access the Banking application.

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 2nd, 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 Bank and
enter valid or invalid passwords for the same User. System response for such a
scenario needs to be tested.

Use Case Testing:


Use case plays a significant role in the distinct phases of Software Development Life
Cycle. Use Case depends on ‘User Actions’ and ‘Response of System’ to the User
Actions.

In Use Case, we will describe ‘How a System will respond to a given Scenario?’. It is
‘user-oriented’ not ‘system oriented’.

It is ‘user-oriented’: We will specify ‘what are the Actions done by the user?’ and ‘What
the Actors see in a system?.

It is not ‘system oriented’: We will not specify ‘What are the input given to the system?’
and ‘What are the output produced by the system?’.

Example 1:

The Use case for ‘Login’ to a ‘Banking Application’

Use Case Name Login

Use case Description A user login to System to access the functionality of the system.

Actors Manager, Customers

Pre-Condition System must be connected to the network.

Post -Condition After a successful login a notification mail is sent to the User mail id

Main Scenarios Serial No Steps

Actors/Users 1 Enter User ID


Enter Password

2 Validate User ID and Password

3 Allow access to System

Extensions 1a Invalid User ID


System shows an error message

2b Invalid Password
System shows an error message

3c Invalid Password for 4 times


Application closed
White Box Testing
Decision (Branch) Coverage Testing:
Decision coverage or Branch coverage is a testing method, which aims to ensure that
each one of the possible branch from each decision point is executed at least once and
thereby ensuring that all reachable code is executed.

Decision coverage reports the true or false outcomes of each Boolean expression.

Example1:

Read A

Read B

IF A+B > 10 THEN

Print "A+B is Large"

ENDIF

If A > 5 THEN

Print "A Large"

ENDIF
The above logic can be represented by a flowchart as:

Result:

To calculate Branch Coverage, one has to find out the minimum number of paths which
will ensure that all the edges are covered. In this case there is no single path which will
ensure coverage of all the edges at once. The aim is to cover all possible true/false
decisions.

(1) 1A-2C-3D-E-4G-5H

(2) 1A-2B-E-4F

Hence Decision or Branch Coverage is 2.


Example2:

Demo(int a) {

If (a> 5)

a=a*3

Print (a)

Scenario 1:

Value of a is 2

The code highlighted in yellow will be executed.

Here the "No" outcome of the decision If (a>5) is checked.

Decision Coverage = 50%

Scenario 2:

Value of a is 6

The code highlighted in yellow will be executed.


Here the "Yes" outcome of the decision If (a>5) is checked.

Decision Coverage = 50%

Test Case Value of A Output Decision Coverage

1 2 2 50%

2 6 18 50%

Statement Coverage Testing:


It is test design technique which involves execution of all the executable statements in
the source code at least once. It is used to calculate and measure the number of
statements in the source code which can be executed given the requirements.

Statement coverage is used to derive scenario based upon the structure of the code
under test.
Example1:

Read A
Read B
if A>B
Print “A is greater than B”
else
Print "B is greater than A"
endif

Set1:

If A =5, B =2
No of statements Executed: 5
Total no of statements in the source code: 7
Statement coverage =5/7*100 = 71.00 %

Set2:

If A =2, B =5
No of statements Executed: 6
Total no of statements in the source code: 7
Statement coverage =6/7*100 = 85.20 %

Example2:

Prints (int a, int b) {

int result = a+ b;

If (result> 0)

Print ("Positive", result)

Else

Print ("Negative", result)

}
Set1:

If A = 3, B = 9

Number of executed statements = 5

Total number of statements = 7

Statement Coverage: 5/7 = 71%

Set2:

If A = -3, B = -9

Number of executed statements = 6

Total number of statements = 7

Statement Coverage: 6/7 = 85%

Common questions

Powered by AI

Decision table testing identifies logical relationships by mapping conditions (inputs) to specific actions (outputs) in a table format, which helps in understanding complex business logic . This method focuses on testing all possible combinations of conditions and guides test case development by allowing testers to systematically explore all logical pathways, ensuring comprehensive coverage and the ability to uncover hidden requirements or potential issues .

State transition testing is particularly suited for systems with defined user interaction stages because it models how a system responds to sequences of inputs representing user interactions over time . This technique allows testers to verify that the correct state transitions occur following specific user actions and ensures that unintended states are not reachable, which is critical for defined interaction stages . It uncovers potential issues by highlighting invalid transitions that could lead to user confusion or system vulnerabilities, ensuring that the system handles all possible user paths properly and securely .

State transition testing is most useful in scenarios where an application has distinct states and the transitions between them depend on previous events . This technique records system behavior for sequences of inputs, helping testers understand how a system moves from state to state based on user actions . It is advantageous as it allows for testing correct system behavior across various sequences, ensuring robustness in applications with state-dependent operations, such as login attempts in banking applications with restricted access rules .

Statement coverage evaluates the completeness of software testing by measuring the percentage of executable statements in the code that are executed at least once during testing . It differs from branch coverage, which focuses on executing each branch of decision points. Statement coverage ensures all lines of code are tested, while branch coverage ensures all paths through the program flow, including all possible outcomes of decision points, are tested . This distinction highlights that branch coverage is generally more thorough but also more complex to achieve compared to statement coverage .

Boundary testing focuses on testing the edges of input ranges, such as minimum and maximum limits, which helps identify errors that occur at the extremes of input values . Equivalence class partitioning reduces the number of test cases by grouping similar inputs that should be processed similarly, thus improving efficiency by avoiding redundant testing for every possible input combination . The combination makes test designs more efficient by ensuring critical points are tested without unnecessarily duplicating test efforts across obvious equivalent inputs.

Decision table testing handles dependencies between input conditions by clearly defining conditions as input entries and mapping them to corresponding actions as outputs, capturing all possible combinations of inputs and their effects . This systematic approach results in a comprehensive exploration of logical scenarios, which enhances test completeness by ensuring every potential interaction between conditions is considered and tested, thereby uncovering hidden requirements or interdependencies . It ensures a thorough examination of applications with complex business logic or varying transaction possibilities.

In conducting equivalence class partitioning, testers consider grouping input data into equivalence classes where each member is expected to produce similar behavior and output from the system . Valid input classes cover allowable input ranges, ensuring all possible valid inputs receive representation, while invalid input classes cover values outside these limits to test system robustness and error handling . These considerations ensure coverage by representing each logical operation of the system with minimal redundancy, reducing the number of test cases without compromising test comprehensiveness.

Use case testing contributes to aligning software functionality with user expectations by focusing on user interactions and system responses, thus ensuring the system behaves as users predict based on their actions . This approach allows for testing from a user perspective, ensuring all user scenarios and system responses are accurately captured and validated. A limitation is that it may not cover all technical requirements because it does not specify internal system mechanisms or inputs and outputs, potentially overlooking system-level issues .

Boundary value analysis is significant in ensuring robust applications because it specifically targets the edge cases at limits of input values where bugs are most likely to occur. Testing at the boundaries (e.g., minimum and maximum values) helps identify potential issues such as off-by-one errors or buffer overflows that could compromise application stability and security . It contributes to robustness as these boundary checks can prevent failure conditions that might not appear under normal operations but can manifest under stress or atypical use .

Complete branch coverage in software testing is critical as it ensures every possible decision point and path in the code is tested, reducing the likelihood of overlooking bugs that occur in specific conditional paths . Challenges in achieving complete branch coverage include increased complexity and potential combinatorial explosion of the test cases needed, as not all paths are easily accessible or clearly defined without extensive refactoring or code instrumentation . Moreover, ensuring branch coverage does not guarantee finding all bugs, as it does not account for non-restyled logic errors or code issues unrelated to specific path execution .

You might also like