0% found this document useful (0 votes)
21 views50 pages

Test Case in Software Testing

A test case is a structured set of actions to verify if a software system meets its requirements and functions correctly. It includes various parameters such as Test Case ID, Test Steps, and Expected Results, and is essential for identifying issues during software development. Test cases can be written before, during, or after development and are crucial for ensuring software quality and consistency.

Uploaded by

Dhairya Patel
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)
21 views50 pages

Test Case in Software Testing

A test case is a structured set of actions to verify if a software system meets its requirements and functions correctly. It includes various parameters such as Test Case ID, Test Steps, and Expected Results, and is essential for identifying issues during software development. Test cases can be written before, during, or after development and are crucial for ensuring software quality and consistency.

Uploaded by

Dhairya Patel
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/ 50

What is a Test Case?

A test case is a set of steps or actions


performed on a system to check if
it meets the software
requirements and works as expected. It
helps verify whether the system
functions correctly under different
conditions and meets to the
expectations. Test cases are essential
for identifying issues and ensuring the
software performs as intended.

Flow of Test Case


Parameters of a Test Case
Here are the important parameters of
testcase which is helping to the
development process of software:
 Module Name: Subject or title that
defines the functionality of the test.
 Test Case Id: A unique identifier
assigned to every single condition in
a test case.
 Tester Name: The name of the
person who would be carrying out
the test.
 Test scenario: The test scenario
provides a brief description to the
tester, as in providing a small
overview to know about what needs
to be performed and the small
features, and components of the
test.
 Test Case Description: The
condition required to be checked for
a given software. for eg. Check if
only numbers validation is working
or not for an age input box.
 Test Steps: Steps to be performed
for the checking of the condition.
 Prerequisite: The conditions
required to be fulfilled before the
start of the test process.
 Test Priority: As the name suggests
gives priority to the test cases that
had to be performed first, or are
more important and that could be
performed later.
 Test Data: The inputs to be taken
while checking for the conditions.
 Test Expected Result: The output
which should be expected at the
end of the test.
 Test parameters: Parameters
assigned to a particular test case.
 Actual Result: The output that is
displayed at the end.
 Environment Information: The
environment in which the test is
being performed, such as the
operating system, security
information, the software name,
software version, etc.
 Status: The status of tests such as
pass, fail, NA, etc.
Comments: Remarks on the test
regarding the test for the
betterment of the software.
Test Case vs Test Scenario
Below are some of the points of
difference between a Test Case and a
Test Scenario:
Test
Paramet Scenari
er Test Case o

Definiti A test case is a The


on defined format for test
software testing Scenari
required to check o
if a particular provide
application/softwa sa
re/module is small
Test
Paramet Scenari
er Test Case o

descrip
tion of
what
working or not.
needs
Here we check for
to be
different
perfor
conditions
med
regarding the
based
same.
on the
use
case.

Level of Test cases are Test


detailin more detailed with Scenari
g several o
Test
Paramet Scenari
er Test Case o

provide
sa
small
descrip
tion,
parameters.
mostly
one-
line
statem
ents.

Action Test cases are low- Test


Level level actions. scenari
os are
high-
Test
Paramet Scenari
er Test Case o

level
actions
.

Derived Test cases are Test


from mostly derived scenari
from test os are
scenarios. derived
from
docum
ents
like
BRS,
SRS,
Test
Paramet Scenari
er Test Case o

etc.

It
focuses
It focuses on more
Objectiv
"What to test" and on
e
"How to test". 'What
to
test".

Resourc Test cases require Fewer


es more resources for resourc
required documentation es are
and execution. require
d to
Test
Paramet Scenari
er Test Case o

write
test
scenari
os.

It includes all They


positive and are
negative inputs, one-
Inputs
expected results, liner
navigation steps, statem
etc. ents.

Time It requires more Test


require time compared to scenari
ment test scenarios. os
Test
Paramet Scenari
er Test Case o

require
less
time.

They
require
Mainten They are hard to less
ance maintain. time to
maintai
n.
When do we Write Test Cases?
Test cases are written in different
situations:
 Before development: Test cases
could be written before the actual
coding as that would help to identify
the requirement of the
product/software and carry out the
test later when the
product/software gets developed.
 After development: Test cases are
also written directly after coming up
with a product/software or after
developing the feature but before
the launching of a product/software
as needed to test the working of
that particular feature.
 During development: Test cases are
sometimes written during the
development time, parallelly. so
whenever a part of the
module/software gets developed it
gets tested as well.
So, test cases are written in such cases,
as test cases help in further
development and make sure that we
are meeting all the needed
requirements.
Why Write Test Cases?
Test cases are one of the most
important aspects of software
engineering, as they define how the
testing would be carried out. Test cases
are carried out for a very simple
reason, to check if the software works
or not. There are many advantages of
writing test cases:
 To check whether the software
meets customer expectations: Test
cases help to check if a particular
module/software is meeting the
specified requirement or not.
 To check software consistency with
conditions: Test cases determine if a
particular module/software works
with a given set of conditions.
 Narrow down software
updates: Test cases help to narrow
down the software needs and
required updates.
 Better test coverage: Test cases help
to make sure that all possible
scenarios are covered and
documented.
 For consistency in test
execution: Test cases help to
maintain consistency in test
execution. A well-documented test
case helps the tester to just have a
look at the test case and start
testing the application.
 Helpful during maintenance: Test
cases are detailed which makes
them helpful during the
maintenance phase.
Test Case Template
A Test Case Template is a simple,
organized format used in software
testing to create test cases. It helps
ensure that all tests are written clearly
and consistently.
Let's look at a basic test case template
for the login functionality.
 The Test case template contains the
header section which has a set of
parameters that provide
information about the test case
such as the tester's name, test case
description, Prerequisite, etc.
 The body section contains the actual
test case content, such as test ID,
test steps, test input, expected
result, etc.
Below is the table that shows the
basic template of a test case:
Fields Description

Each test case should


Test Case ID
have a unique ID.

Test Case Each test case should


Fields Description

have a proper
description to let
Description
testers know what the
test case is about.

Conditions that are


Pre- required to be satisfied
Conditions before executing the
test case.

Mention all test steps


in detail and to be
Test Steps
executed from the end-
user's perspective.

Test Data Test data could be used


as input for the test
Fields Description

cases.

The result is expected


Expected
after executing the test
Result
cases.

Conditions need to be
Post fulfilled when the test
Condition cases are successfully
executed.

The result that which


Actual
system shows once the
Result
test case is executed.

Status Set the status as Pass or


Fail on the expected
Fields Description

result against the actual


result.

Name of the project to


Project
which the test case
Name
belongs.

Name of the module to


Module
which the test case
Name
belongs.

Mention the path of


Reference
the reference
Document
document.

Name of the tester who


Created By
created the test cases.
Fields Description

Date of Date of creation of test


Creation cases.

Name of the tester who


Reviewed By
reviews the test case.

Date of When the test cases


Review were reviewed.

Name of the tester who


Executed By
executed the test case.

Date of Date when the test


Execution cases were executed.

Comments Include comments


which help the team to
understand the test
Fields Description

cases.
In the given template below it's
identifiable that the section from
module name to test scenario is the
header section while the table that lies
below the test scenario (from test case
ID to comments) is the body of the test
case template.
Here a test case template for login
functionality has been created with its
parameters and values.
Test Case Template
Best Practice for Writing Test Case
There are certain practices that one
could follow while writing the test
cases that would be considered
beneficial.
 Simple and clear: Test cases need to
be very concise, clear, and
transparent. They should be easy
and simple to understand not only
for oneself but for others as well.
 Maintaining the
client/customer/end-user
requirements must be
unique : While writing the test
cases, it's necessary to make sure
that they aren't being written over
and over again and that each case is
different from the others.
 Zero Assumptions: Test cases
should not contain assumed data,
and don't come up with
features/modules that don't exist.
 Traceability: Test cases should be
traceable for future reference, so
while writing it's important to keep
that in mind,
 Different input data: While writing
test cases, all types of data must be
taken into consideration.
 Strong module name: The module
name should be self-explanatory
while writing the test case.
 Minimal Description: The
description of a test case should be
small, one or two lines are normally
considered good practice, but it
should give the basic overview
properly.
 Maximum conditions: All kinds of
conditions should be taken into
consideration while writing a test,
increasing the effectiveness.
 Meeting requirements: While
writing the test case the
client/customer/end-user
requirements must be met.
 Repetitive Results: The test case
must be written in such a way that it
should provide the same result.
 Different Techniques: Sometimes
testing all conditions might not be
possible but using different
testing with different test cases
could help to check every aspect of
a software.
 Create test cases with the end
user's perspective: Create test cases
by keeping end-user in mind and
the test cases must meet customer
requirements.
 Use unique Test Case ID: It is
considered a good practice to use a
unique Test Case ID for the test
cases following a naming
convention for better
understanding.
 Add proper preconditions and
postconditions: Preconditions and
postconditions for the test cases
must be mentioned properly and
clearly.
 Test cases should be
reusable: There are times when the
developer updates the code, then
the testers need to update the test
cases to meet the changing
requirements.
 Specify the exact expected
outcome: Include the exact
expected result, which tells us what
will be result of a particular test
step.
Test Case Management Tools
Test case management tools are
important in managing test cases
efficiently, making the testing process
faster and less time-consuming
compared to traditional methods.
These tools provide features such
as advanced dashboards, bug
tracking, progress tracking, custom
templates, and integration with other
testing tools. Test case management
tools help testers organize, manage,
and execute their tests more
effectively.
Here are some of the most popular
test case management tools:
1. TestLink: TestLink is a widely
used test management tool that
offers easy integration with bug
tracking systems and provides a
user-friendly interface to manage
test cases, test plans, and test runs.
2. X-ray: X-ray is a test
management tool for Jira, designed
to manage both manual and
automated tests. It integrates
seamlessly with Jira, providing
robust reporting, traceability, and
tracking for test cases.
3. TestRail: TestRail helps manage
test cases, test plans, and test runs.
It offers real-time insights into
testing progress and enables better
collaboration between QA teams,
helping them streamline their test
case management processes.
4. PractiTest Ltd.: PractiTest is a test
case management tool that focuses
on organizing test cases, creating
test plans, and offering detailed
reports. It allows for seamless
integration with popular bug
tracking systems and other testing
tools.
5. TestCollab: TestCollab is a tool
for managing test cases, test plans,
and testing progress. It provides
strong reporting and analytics
features to give teams insights into
their testing efforts.
6. Kualitee: Kualitee is a
comprehensive test case
management platform that supports
manual and automated testing. It
provides features for test case
creation, execution, and tracking,
along with strong integration with
bug tracking tools.
7. Qase: Qase is an easy-to-use test
management tool that supports
manual test execution and test case
management. It integrates with
various CI/CD tools and offers
powerful reporting and analytics
features.
8. Testiny: Testiny is a lightweight
test management tool that provides
an intuitive interface for managing
test cases. It allows easy tracking of
test executions and facilitates
collaboration within teams.
9. TestMonitor: TestMonitor is a
test case management platform
designed to enhance collaboration
among teams. It offers
comprehensive features like test
case management, test plan
creation, bug tracking, and detailed
reporting.
10. SpiraTest: SpiraTest is a test
management tool that allows users
to manage test cases, bugs, and
requirements in one integrated
platform. It provides full traceability
and powerful reporting for effective
test case management.
Formal and Informal Test Case:
 Formal Test Cases: Formal test cases
are test cases that follow the basic
test case format. It contains the test
case parameters such as conditions,
ID, Module name, etc. Formal Test
cases have set input data and
expected results, they are
performed as per the given order of
steps.
 Informal Test Cases: Informal test
cases are test cases that don't
follow the basic test case format. In
these, as the tests are performed
the test cases are written in real-
time then pre-writing them, and the
input and expected results are not
predefined as well.
Types of Test Cases
Here are some of the Types of Test
Cases:
 Functionality Test
Case: The functionality test case is
to determine if the interface of the
software works smoothly with the
rest of the system and its users or
not. Black box testing is used while
checking for this test case, as we
check everything externally and not
internally for this test case.
 Unit Test Case: In unit test case is
where the individual part or a single
unit of the software is tested. Here
each unit/ individual part is tested,
and we create a different test case
for each unit.
 User Interface Test Case: The UI
test or user interface test is when
every component of the UI that the
user would come in contact with is
tested. It is to test if the UI
components requirement made by
the user are fulfilled or not.
 Integration Test Case: Integration
testing is when all the units of the
software are combined and then
they are tested. It is to check that
each component and its units work
together without any issues.
 Performance Test
Case: The performance test case
helps to determine response time as
well as the overall effectiveness of
the system/software. It's to see if
the application will handle real-
world expectations.
 Database Test Case: Also known
as back-end testing or data
testing checks that everything
works fine concerning the database.
Testing cases for tables, schema,
triggers, etc. are done.
 Security Test Case: The security
test case helps to determine that
the application restricts actions as
well as permissions wherever
necessary. Encryption and
authentication are considered as
main objectives of the security test
case. The security test case is done
to protect and safeguard the data of
the software.
 Usability Test Case: Also known as
a user experience test case, it
checks how user-friendly or easy to
approach a software would be.
Usability test cases are designed by
the User experience team and
performed by the testing team.
 User Acceptance Test
Case: The user acceptance test case
is prepared by the testing team but
the user/client does the testing and
review if they work in the real-world
environment.
What is a QA test case?
A QA (Quality Assurance) test case is a
document that specifies a set of
conditions or variables under which a
tester will determine whether a
system, software application, or one of
its features is working as expected. A
well-written test case helps ensure that
the software behaves as intended and
meets the specified requirements. It
provides us Consistency, Traceability
and efficiency of System.
Benefits of writing high-quality test
cases
Writing high-quality test cases offers
numerous benefits that contribute to
the effectiveness and efficiency of
the software testing process. Some
benefits are listed below:
 Improved Test Coverage
 Enhanced Communication
 Consistency and Repeatability
 Efficient Defect Identification
 Improved Test Automation
 Increased Confidence in Software
Quality
Example test cases for a login page
Below is an example of preparing
various test cases for a login page with
a username and password.
 Unit Test case: Here we are only
checking if the username validates
at least for the length of eight
characters.
Te Test
st Exp
T Test St ecte Act
e Con e d ual St Re
st diti p Test Res Res at ma
Id on s Input ult ult us rks

1 Che 1. geeks Acc Acc Pa No


. ck if Gi forge epts epts ss ne
the v eks for for
user e thirt thirt
nam in een een
e p char char
field ut acte acte
acce rs. rs.
pts
the
inpu
Te Test
st Exp
T Test St ecte Act
e Con e d ual St Re
st diti p Test Res Res at ma
Id on s Input ult ult us rks

t of
thirt
een
char
acte
rs.
Here it is only checked whether the
passing of input of thirteen characters
is valid or not. So since the character
word 'geeksforgeeks' is entered then
the test is successful it would have
failed for any other test case.
 Functionality Test case: Here it is
checked whether the username and
password both work together on
the login click.
Tes Test
t Exp
T Co Tes ecte Actu
e ndi t Test d al St Re
st tio Ste Inpu Res Res at ma
Id n ps t ult ult us rks

1 Ch 1. user Logi Logi P No


. eck Ent nam n n as ne
tha er e: succ succ s
t the geek essf essf
wit use s for ul ul
Tes Test
t Exp
T Co Tes ecte Actu
e ndi t Test d al St Re
st tio Ste Inpu Res Res at ma
Id n ps t ult ult us rks

h rna geek
the me s
cor 2. pass
rec Ent word
t er :
use the geek
rna pas sfore
me sw ver
an ord
d
3.
pas
Clic
Tes Test
t Exp
T Co Tes ecte Actu
e ndi t Test d al St Re
st tio Ste Inpu Res Res at ma
Id n ps t ult ult us rks

sw
ord k
abl on
e the
to logi
log n
in.

2 Ch 1. user Logi Logi P No


. eck Ent nam n n as ne
tha er e: uns uns s
t if the geek ucce ucce
Tes Test
t Exp
T Co Tes ecte Actu
e ndi t Test d al St Re
st tio Ste Inpu Res Res at ma
Id n ps t ult ult us rks

wit use sforg ssful ssful


h rna eeks
an me pass
inc 2. word
orr Ent :
ect er geek
use the stog
rna pas ethe
me sw r
an ord
d
3.
Tes Test
t Exp
T Co Tes ecte Actu
e ndi t Test d al St Re
st tio Ste Inpu Res Res at ma
Id n ps t ult ult us rks

pas
sw
Clic
ord
k
abl
on
e
the
to
logi
not
n
logi
n.
Here it is being checked whether
passing wrong and right inputs and if
the login functionality is working or
not, it's showing login is successful for
the right credentials and unsuccessful
for the wrong ones, hence both tests
have passed otherwise would have
failed.
User Acceptance Test Case: Here the
user feedback is taken if the login page
is loading properly or not.
Test
Te Exp
Test Tes st ect Act
Te Con t In ed ual St
st diti Ste p Res Res at Rema
Id on ps ut ult ult us rks

1 Che 1. N Wel Wel Fai The


. ck if Cli o co co l login
Test
Te Exp
Test Tes st ect Act
Te Con t In ed ual St
st diti Ste p Res Res at Rema
Id on ps ut ult ult us rks

the ck n me me page
load on e to to is not
ing th the the loade
pag e logi logi d due
e log n n to a
load in pag pag brow
ing bu e. e. ser
effic tto comp
ientl n. atibili
y ty
for issue
Test
Te Exp
Test Tes st ect Act
Te Con t In ed ual St
st diti Ste p Res Res at Rema
Id on ps ut ult ult us rks

on
the
the
clie
user's
nt.
side.
Here it is being checked in by clicking
on the login button if the page is
loaded and the 'Welcome to login
page' message is displayed. The test
has failed here as the page was not
loaded due to a browser compatibility
issue, it would have loaded if the test
had passed.
Related Posts:
 Software Testing Tutorial
 What is Software Testing?
 Manual Testing - Software Testing
 Software Testing - Use Case Testing
 Unit Testing - Software Testing
Conclusion
Writing effective test cases is a
important part of software testing. It
helps ensure that the software is
thoroughly tested, and any issues are
found and fixed early in the
development process. Good test cases
should be clear, easy to understand,
and cover all possible scenarios. This
ensures that the software works
properly, performs well, and is reliable.
By following a well-organized approach
to writing test cases, testers can
improve software quality, reduce
defects, and make sure the software
meets the needs and expectations of
the users and stakeholders.

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