2. Introduction
Test cases are sets of conditions or variables used by software testers to determine if a system
works correctly as expected. Test cases help in validating the testing coverage of a software
application. A test case contains essential fields that provides the information about the test
case, the activity involved in execution and the results expected. These fields include a unique
name, any preconditions, detailed steps, input conditions and expected results for a particular
app function.
Essentials Of A Good Test Case:
· It is easy to understand and execute.
· It is accurate with specific objective.
· It is easy to trace as per requirements.
· It is repeatable, and can be used to test again and again.
· It saves time and money by avoiding unnecessary steps.
· It is reusable.
Essentials To Be Included In Test Cases
The simpler & concise the test case is, the easier it is to execute the tests. They contain a unique name,
preconditions, steps, input conditions & expected results for a particular app function. The following are
the key information to be included while creating test cases:
1) Test Case Number
It is a unique number to identify the Test Case from among the number of Test cases. For example:
TC_2001
2) Component
Component is the Area of the App/Website to be tested. For example, ‘Login”. Components to be tested
should be shared before the test case writing starts.
3. 3) Attributes
These are those aspects that describes the product’s purpose and goals. Just like adjectives that
describe nouns by giving some information, an attribute describes qualities of an app like speed.
Attributes are also shared before the test case writing process.
4) Test Case Type
This depicts the type of Test Case like Functional, GUI, Technical etc.
5) Priority
It confirms the Priority/Importance of the test case in terms of Show Stopper, High, Medium, Low.
6) Test Name
This is a logical and unique name to indicate what the test case stands for. As far as possible name test
cases as per the module name or functional area you are testing. At 99tests, we choose to write the test
case name in Camel Casing format. The format would be <Component>_<Subcomponent>_<Details>
Here are some examples of test names:
● Login_Email_Valid
● AccountSettings_EditProfile_Devices
● MyMessages_NoNewMessage
Note that the Test Name should be unique, and in no condition it should be duplicate of any other test
case.
7) Test Description
This is contains details of the test. It is normally a one-liner that specifies the verification to be done in the
test case. For instance, in the above example of test case name, “ “MyMessages_NoNewMessage”, the
description would be “To Verify the functionality of the Messages when there is no new message
available”.
8) Input Data
Test Data is mentioned in Input Data field. Here are a few pointers for handling input data:
4. ● If the test data can be reused over time, mention test data to be used. For the test. e.g. - If the client
has already proved the credentials to login, the same can be used again.
● If the test only involves some values to be verified, specify the value range or describe what values
are to be tested for which field.
● A few values from each equivalence class which should give good coverage for your test.
● Mention the type of data, which is required to run the test and not the real test data value where the
test data keeps changing
9) Pre-conditions
This explains any Assumptions/Pre-conditions to be used for testing. It should be mentioned point wise.
For Example for the Test Name Messages_NoNewMessage , the preconditions can be as follows:
● 99tests Website is available
● User should be logged in and registered as Tester
10) Step Number
This indicates the Number for the step description like 1,2,3 etc. Should always be in order.
11) Step Description
This specifies the actions to be performed. Please make sure the description is brief and can be executed
after one reading. Also, note that it should not be too small like – “Click Submit”, “Enter data in field 1”
For example:
● Click on Message Button and check the results.
● Enter the data in the Textbox and Save
12) Expected Result
This specifies what is the actual expected out of the step that is executed. Let’s take the example of the
99tests testers page:
5. ● Message Button should be clickable by Tester
● Data Entered Should be Saved by System
● Following Contents should be displayed by My Bugs Page:
✓ Header part
✓ 'Search Testers' field
✓ 'My Bugs' Title
✓ 'Enterprise Bug', 'Open Bug', 'Contest Bugs' link
✓ Paginations Links (optional)
✓ Bugs Details column
13) Actual Result
This specifies what actually happens after performing the step. For Example with reference to the 99tests
testers page:
● Message Button is clickable by tester
● Data Entered is not saved and an Error Message is populated by System
● Following Contents are being displayed by My Bugs Page :
✓ Header part
✓ 'Search Testers' field
✓ 'My Bugs' Title
✓ 'Enterprise Bug', 'Open Bug', 'Contest Bugs' link
✓ Paginations Links (optional)
✓ Bugs Details column
6. However, actual result is not to be written while writing the test cases. Actual results will be written by the
testers who are executing the test cases.
Test Coverage
This is done while keeping the End User in mind and using the experience of various testers in variety of
domains. It is also ensured to cover the following points while writing test cases:
1. Functional Testing
2. Boundary Value Analysis and Equivalence partitioning
3. Error/Warning Message
4. Input/ Output Data
5. Negative Scenarios
6. Risk Coverage
Best Practices For Effective Test Case Writing
Good test cases are easy to execute and maintain. They make the testing process more
effective by saving time and effort. Here are the top 10 best practices to follow while creating
test cases:
1) Keep It Simple And Easy To Understand
A good test case that is well written and simple, is easy for the testers to understand and
execute. Organize test cases according to specific categories or related areas of the
application. Test cases can be grouped based on their user story or modules like browser
specific behaviours etc. This makes it easier to review & maintain the test document.
Information given in the test cases should be clear to other testers, developers, and other
stakeholders involved in the project.
7. 2) Include End User Perspective
Take into account the end user perspective before drafting a test case. Think like an end user
who is the key stakeholder for whom the app is intended. Understand the requirement, the
functionality aspects to be covered, and the end user perspective. This will help in identifying
test scenarios that arise in real life conditions, and also in coming up with test cases that are
most critical to the business.
3) Use Correct Naming Conventions
Name test cases in a way that makes it easy for stakeholders to identify it and understand its
objective. You can name the test cases according to the module or the functional area that is
included for testing.
4) Provide Test Case Description
A proper test case description will allow users to understand what is being tested and how.
Provide relevant details like the test environment and any other specific information. Mention
the testing data to be used and the testing tools, if any to be employed for executing the tests.
5) Include Assumptions And Preconditions
Include all the assumptions and conditions that are applicable for the test case. Provide details
of the test environment, any special setup for execution of test case etc.
6) Give The Steps Involved
Include the actual steps involved in the execution of the test cases. Do not miss out on any
step. Ensure that all the test case verification steps are covered. Include relevant documents or
screenshots that can help in execution of the steps included in the test design.
7) Give Details Of The Test Data
Provide the details of the test data for execution of the test case especially in cases where the
same data can be reused. This helps in saving time for creation of the test data for each cycle
to be run. Specify the value range, if applicable for respective fields. Don’t try to test each and
8. every value. Aim for maximum coverage by choosing a few select values from each
equivalence class.
8) Make It Reusable And Modular
As far as possible ensure that there is no dependency or conflict among test cases. In case
there are test cases that are inter-dependent or batched, mention them clearly in the test
document.
9) Assign Testing Priority
Assign testing priority to each test case based on the feature or component involved. This will
ensure that during execution, high priority test case are executed first.
10) Provide The Expected Result & Post Conditions
Include the expected result for every step of the test case. You can also include screenshots
and relevant documents for reference. Mention the post conditions or things to be verified after
the execution of the test case.
Tips For Maintenance Of Tests Cases
Change is constant for any software development project. As apps evolve, new upgrades and
changes are introduced into the system. Test cases must be maintained and updated to reflect
these new changes that are made. Here are a few tips for effective maintenance of test cases:
1) Review Test Cases After Documentations
Get the test cases reviewed by relevant stakeholders to ensure that it is easy to understand and
does not include any unnecessary steps. A periodic review and revision of test cases will help in
updating changes if any that are applicable.
2) Update Existing Test Cases Before Creating New Ones
Update the existing test cases as and when new changes are introduced in the app. Include
updates to accommodate changes to any existing user story or functionality.
9. 3) Remove Test Cases That Are Obsolete And Unnecessary
Remove test cases that are no longer valid for existing app features. Exclude duplicate test
cases as well from the test suite.
4) Add Relevant Test Cases As Per Requirement
Create and add test cases that are required as per new upgrades or features that are introduced
in the software. Add any additional test case that is relevant, including test cases for defects
that were found by end users, post production.
Conclusion
Creation of test cases is easier with good knowledge of the technology used, the end user
perspective and the objective of the software application. Investing time and effort in creation
and maintenance of good test cases makes the entire testing process more effective and
ensures the success of the testing plan for the software project.
About 99tests
99tests is a product of Preenos Crowd Technologies Pvt Ltd. The company is funded by Infosys Co-founder, Kris Goplakrishnan,
Allianz CIO, Steve Coles and Founder of Beenos, Teruhido Sato. 99tests is a crowd test automation platform for testing mobile and
web apps by top notch testers. With over 20,000 crowd testers from 160+ countries, 99tests has helped over 200 clients including
companies like P&G, Intuit and Security scorecard to test their software.We provide companies with economical, and effective
crowd testing & automation services.Learn how automation through 99tests can give you the insights you need to build stunning
software products. Mail us at contact@99tests.com.
www.99tests.com