0% found this document useful (0 votes)
12 views17 pages

Lecture 15

The document outlines various software testing techniques, including Boundary Value Analysis, Equivalence Class Partitioning, Decision Table Testing, State Transition, and Error Guessing, each with definitions, guidelines, and examples. It emphasizes the importance of these techniques in designing effective test cases and improving test coverage. Additionally, it discusses GUI testing, its necessity, methods, and provides a checklist and example test cases for thorough GUI evaluation.

Uploaded by

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

Lecture 15

The document outlines various software testing techniques, including Boundary Value Analysis, Equivalence Class Partitioning, Decision Table Testing, State Transition, and Error Guessing, each with definitions, guidelines, and examples. It emphasizes the importance of these techniques in designing effective test cases and improving test coverage. Additionally, it discusses GUI testing, its necessity, methods, and provides a checklist and example test cases for thorough GUI evaluation.

Uploaded by

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

Software Testing Techniques with Test Case Design Examples

Software Testing Techniques help you design better test cases. Since exhaustive testing is not
possible; Manual Testing Techniques help reduce the number of test cases to be executed while
increasing test coverage. They help identify test conditions that are otherwise difficult to
recognize.

Important software testing techniques:

●​ Boundary Value Analysis (BVA)


●​ Equivalence Class Partitioning
●​ Decision Table based testing.
●​ State Transition
●​ Error Guessing

Boundary Value Analysis (BVA)


Boundary value analysis is based on testing at the boundaries between partitions. It includes
maximum, minimum, inside or outside boundaries, typical values and error values.

It is generally seen that a large number of errors occur at the boundaries of the defined input
values rather than the center. It is also known as BVA and gives a selection of test cases that
exercise bounding values.

This black box testing technique complements equivalence partitioning. This software testing
technique base on the principle that, if a system works well for these particular values then it will
work perfectly well for all values which come between the two boundary values.

Guideline for Boundary Value analysis

●​ If an input condition is restricted between values x and y, then the test cases should be
designed with values x and y as well as values which are above and below x and y.

Example:

Input condition is valid between 1 to 10


Boundary values 0,1,2 and 9,10,11

Video:

https://www.youtube.com/watch?v=H6IRY98Gu44

Practice:

1.​ Assume, we have to test a field which accepts Age 18 – 56

2.​ Assume we have to test a text field (Name) which accepts the length between 6-12
characters.
Equivalence Class Partitioning
Equivalent Class Partitioning allows you to divide a set of test conditions into a partition which
should be considered the same. This software testing method divides the input domain of a
program into classes of data from which test cases should be designed.

The concept behind this technique is that the test case of a representative value of each class is
equal to a test of any other value of the same class. It allows you to Identify valid as well as
invalid equivalence classes.

Example:

Input conditions are valid between

1 to 10 and 20 to 30

Hence there are three equivalence classes

--- to 0 (invalid) 1 to 10 (valid) 11 to 19 (invalid)

20 to 30 (valid) 31 to --- (invalid)

You select values from each class, i.e.,

-2, 3, 15, 25, 45

Video:

https://youtu.be/mb-I7Skf-zU?t=61
Decision Table Based Testing.
A decision table is also known as to Cause-Effect table. This software testing technique is used
for functions that respond to a combination of inputs or events. For example, a submit button
should be enabled if the user has entered all required fields.

The first task is to identify functionalities where the output depends on a combination of inputs.
If there are large input set of combinations, then divide it into smaller subsets which are helpful
for managing a decision table.

For every function, you need to create a table and list down all types of combinations of inputs
and their respective outputs. This helps to identify a condition that is overlooked by the tester.

Following are steps to create a decision table:

●​ Enlist the inputs in rows


●​ Enter all the rules in the column
●​ Fill the table with the different combination of inputs
●​ In the last row, note down the output against the input combination.

Example: A submit button in a contact form is enabled only when all the inputs are entered by
the end-user.
Video:

https://www.youtube.com/watch?v=TSbIDrx_KVY&feature=emb_title

Practice:

1.​ The condition is simple if the user provides a 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.

2.​ Now consider a dialogue box which will ask the user to upload 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 corresponding error message stating the issue
and if all conditions are met photo will be updated successfully
State Transition
In State Transition technique changes in input conditions change the state of the Application
Under Test (AUT). This testing technique allows the tester to test the behavior of an AUT. The
tester can perform this action by entering various input conditions in a sequence. In State
transition technique, the testing team provides positive as well as negative input test values for
evaluating the system behavior.

Guideline for State Transition:

●​ State transition should be used when a testing team is testing the application for a limited
set of input values.
●​ The technique should be used when the testing team wants to test a sequence of events
that happen in the application under test.

Example:

In the following example, if the user enters a valid password in any of the first three attempts the
user will be able to log in successfully. If the user enters the invalid password in the first or
second try, the user will be prompted to re-enter the password. When the user enters the
password incorrectly 3rd time, the action has taken, and the account will be blocked.

State transition diagram


In this diagram when the user gives the correct PIN number, he or she is moved to Access
granted state. Following Table is created based on the diagram above

In the above-given table when the user enters the correct PIN, the state is transitioned to Access
granted. And if the user enters an incorrect password, he or she is moved to next state. If he does
the same 3rd time, he will reach the account blocked state.
Video: https://www.youtube.com/watch?v=_Udjai_6b9Y&feature=emb_title

Practice:

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

It gives you access to the application with the 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.
Error Guessing
Error guessing is a software testing technique that is based on guessing the error which can
prevail in the code. It is an experience-based technique where the test analyst uses his/her or
experience to guess the problematic part of the testing application.

The technique counts a list of possible errors or error-prone situations. Then tester writes a test
case to expose those errors. To design test cases based on this software testing technique, the
analyst can use past experiences to identify the conditions.

Guidelines for Error Guessing:

●​ The test should use the previous experience of testing similar applications
●​ Understanding of the system under test
●​ Knowledge of typical implementation errors
●​ Remember previously troubled areas
●​ Evaluate Historical data & Test results

Conclusion

●​ Software testing Techniques allow you to design better cases. There are five primarily
used techniques.
●​ Boundary value analysis is testing at the boundaries between partitions.
●​ Equivalent Class Partitioning allows you to divide a set of test conditions into a partition
which should be considered the same.
●​ Decision Table software testing technique is used for functions which respond to a
combination of inputs or events.
●​ In State Transition technique changes in input conditions change the state of the
Application Under Test (AUT)
●​ Error guessing is a software testing technique which is based on guessing the error which
can prevail in the code.
What is GUI?

There are two types of interfaces for a computer application. Command Line Interface is where
you type text and the computer responds to that command. GUI stands for Graphical User
Interface where you interact with the computer using images rather than text.

Following are the GUI elements which can be used for interaction between the user and
application:

GUI Testing is a validation of the above elements.

What is GUI Testing?

GUI testing is defined as the process of testing the system's Graphical User Interface of the
Application Under Test. GUI testing involves checking the screens with the controls like menus,
buttons, icons, and all types of bars - toolbar, menu bar, dialog boxes, and windows, etc.

GUI is what the user sees. Say if you visit guru99.com what you will see say homepage it is the
GUI (graphical user interface) of the site. A user does not see the source code. The interface is
visible to the user. Especially the focus is on the design structure, images that they are working
properly or not.
In above example, if we have to do GUI testing we first check that the images should be
completely visible in different browsers.

Also, the links are available, and the button should work when clicked.

Also, if the user resizes the screen, neither images nor content should shrink or crop or overlap.

Need of GUI Testing

Now the basic concept of GUI testing is clear. The few questions that will strike in your mind
will be

●​ Why do GUI testing?


●​ Is it really needed?
●​ Does testing of functionally and logic of Application is not more than enough?? Then
why to waste time on UI testing.

To get the answer to think as a user, not as a tester. A user doesn't have any knowledge about
Application. It is the UI of the Application which decides that a user is going to use the
Application further or not.

A normal User first observes the design and looks of the Application/Software and how easy it is
for him to understand the UI. If a user is not comfortable with the Interface or find Application
complex to understand he would never going to use that Application Again. That's why, GUI is a
matter for concern, and proper testing should be carried out in order to make sure that GUI is
free of Bugs.

What do you Check-in GUI Testing?

The following checklist will ensure detailed GUI Testing in Software Testing.

●​ Check all the GUI elements for size, position, width, length, and acceptance of characters
or numbers. For instance, you must be able to provide inputs to the input fields.
●​ Check you can execute the intended functionality of the application using the GUI
●​ Check Error Messages are displayed correctly
●​ Check for Clear demarcation of different sections on the screen
●​ Check Font used in an application is readable
●​ Check the alignment of the text is proper
●​ Check the Color of the font and warning messages is aesthetically pleasing
●​ Check that the images have good clarity
●​ Check that the images are properly aligned
●​ Check the positioning of GUI elements for different screen resolutions.

GUI Testing Techniques / Methods

GUI testing can be done in three ways:

Manual Based Testing

Under this approach, graphical screens are checked manually by testers in conformance with the
requirements stated in the business requirements document.
Record and Replay

GUI testing can be done using automation tools. This is done in 2 parts. During Record, test
steps are captured by the automation tool. During playback, the recorded test steps are executed
on the Application Under Test.

Model Based Testing


A model is a graphical description of a system's behavior. It helps us to understand and predict
the system behavior. Models help in a generation of efficient test cases using the system
requirements. The following needs to be considered for this model based testing:

●​ Build the model


●​ Determine Inputs for the model
●​ Calculate the expected output for the model
●​ Run the tests
●​ Compare the actual output with the expected output
●​ A decision on further action on the model

Some of the modeling techniques from which test cases can be derived:

●​ Charts - Depicts the state of a system and checks the state after some input.
●​ Decision Tables - Tables used to determine results for each input applied

Model-based testing is an evolving technique for generating test cases from the requirements. Its
main advantage, compared to the above two methods, is that it can determine undesirable
states that your GUI can attain.

Example GUI Testing Test Cases

GUI Testing basically involves

1.​ Testing the size, position, width, height of the elements.


2.​ Testing of the error messages that are getting displayed.
3.​ Testing the different sections of the screen.
4.​ Testing of the font whether it is readable or not.
5.​ Testing of the screen in different resolutions with the help of zooming in and zooming out
like 640 x 480, 600x800, etc.
6.​ Testing the alignment of the texts and other elements like icons, buttons, etc. are in proper
place or not.
7.​ Testing the colors of the fonts.
8.​ Testing the colors of the error messages, warning messages.
9.​ Testing whether the image has good clarity or not.
10.​Testing the alignment of the images.
11.​Testing of the spelling.
12.​The user must not get frustrated while using the system interface.
13.​Testing whether the interface is attractive or not.
14.​Testing of the scrollbars according to the size of the page if any.
15.​Testing of the disabled fields if any.
16.​Testing of the size of the images.
17.​Testing of the headings whether it is properly aligned or not.
18.​Testing of the color of the hyperlink.

Demo: How to do GUI Test

Here we will use some sample test cases for the following screen.
Following below is the example of the Test cases, which consists of UI and Usability test
scenarios.

TC 01- Verify that the text box with the label "Source Folder" is aligned properly.

TC 02 - Verify that the text box with the label "Package" is aligned properly.

TC 03 – Verify that label with the name "Browse" is a button which is located at the end of
TextBox with the name "Source Folder."

TC 04 – Verify that label with the name "Browse" is a button which is located at the end of
TextBox with the name "Package."
TC 05 – Verify that the text box with the label "Name" is aligned properly.

TC 06 – Verify that the label "Modifiers" consists of 4 radio buttons with the name public,
default, private, protected.

TC 07 – Verify that the label "Modifiers" consists of 4 radio buttons which are aligned properly
in a row.

TC 08 – Verify that the label "Superclass" under the label "Modifiers" consists of a dropdown
which must be properly aligned.

TC 09 – Verify that the label "Superclass" consists of a button with the label "Browse" on it
which must be properly aligned.

TC 10 – Verify that clicking on any radio button the default mouse pointer must be changed to
the hand mouse pointer.

TC 11 – Verify that user must not be able to type in the dropdown of "Superclass."

TC 12 – Verify that there must be a proper error generated if something has been mistakenly
chosen.

TC 13 - Verify that the error must be generated in the RED color wherever it is necessary.

TC 14 – Verify that proper labels must be used in the error messages.

TC 15 – Verify that the single radio buttons must be selected by default every time.

TC 16 – Verify that the TAB button must be work properly while jumping on another field next
to previous.

TC 17 – Verify that all the pages must contain the proper title.

TC 18 – Verify that the page text must be properly aligned.

TC 19 – Verify that after updating any field a proper confirmation message must be displayed.

TC 20 - Verify that only 1 radio button must be selected and more than single checkboxes may
be selected.

You might also like