15.11.13

How to write a good test case?

Writing test cases is one of the major and most important activities which any tester performs during the entire testing cycle. The approach for writing good test cases will be to identify, define and analyse the requirements.
When you begin writing the test cases, there are few steps which you need to follow to ensure that you are writing good test cases:


1. Identify the purpose of testing. You need to understand requirements to be tested. The first step is to define testing purpose.
When you start writing test cases for any software module, you must understand the features of the same and user requirements.


2. The second step is  to define how to perform testing. This will include defining Test Scenarios.To write good test scenarios you should be well versed with familiar with the functional requirements. You need to know how software is used covering various operations.


3. Identify Non-funtional requiremts.The third step is  to understand the other aspects of software related to non-functional requirements such as hardware requirements, operating system, security aspects to be considered, and other prerequisites such as data files or test data preparation. Testing of non-functional requirements is very important. For example, if the software requires a user to fill in the form, proper time-out logic should be defined by the developer to ensure that it should not result in time-out while submitting the form once user has filled in all required information. Simultaneously, under the same scenario tester should also ensure that user is getting logged-off after certain defined delay to ensure security of the application is not breached.


4. Fourth step would be to define a framework of test cases. The framework of test cases should cover UI interface, functionality, fault tolerance, compatibility, and performance of several categories. Each category should be defined in accordance with the logic of the software application.


5. Next step would be to become familiar with the modular principle. It is easy to analyze the relevance of the software modules present in the specified application. However, it is very important to understand the coupling between the modules. It is very important to test the "Mutual influence" of modules.
The test cases should be designed to cover influence of any module on other modules of the application. For example, in online shopping software while testing shopping cart and order checkout you need to also consider inventory management and validate if the same quantity of the purchased product is deducted from the stores. Similarly, while testing returns, we need to test its effect on the financial part of application along with store inventory.


Structuring of Test cases
Now you have all the required information to begin writing test cases. We will talk about the structure of a test case. Requirements of the software are mapped with test scenarios, which are further elaborated in test cases. For each test scenario, we define test cases. In each test case, we define Test Steps. Test Step is the smallest entity under any test case. It specifies the action to be performed, Expected result of the test application.


The format of a test case comprises of:
1. Test Case ID ( This is the unique number which helps in identifying a specific test cases)
2. Module to be tested (Usually we provide Requirement ID to maintain traceability between test case and requirements)
3. Test Data ( We provide variable and values based on need of the test case)
4. Test Steps ( Steps to be executed)
5. Expected results ( How application should behave after performing stated test steps)
6. Actual results ( Actual output tester will get after preforming steps)
7. A result ( Pass or fail after comparing expected and actual results)
8. Comments ( We can provide screen shot or any other relevant information to help developer debug the code)
During testing you will mark your results against each step, and the defect report will provide related test case ID, which failed during execution.  This can help a tester to relate back to requirements and understand the business scenario which needs to be fixed in code.
For writing test cases you can use simple xls file or tester can select from a wide variety of tools already available. There are few tools such as Quality Centre, Test Director which tester can avail after paying license cost, or you can avail open source tools such as bugzilla.


The test cases can be written with great details, including a large number of steps, or you can also write relatively simple test cases. I personally do not agree with the approach of a large number of steps to be included in test cases.


Here are my thoughts on how a tester can write effective test cases:
1. Self-explanatory and specific – test cases should have sufficient details so that even a new tester can execute the same without any help. All the pre-requisite which are required to execute a specific test should be mentioned in the tests itself. Further, it should clearly specify the purpose and scope of their steps.
2. Valid and concise – test cases should have all designated steps to test based on expectations of the testing. It should not have unnecessary steps. If there are too many test steps in a single test case to be performed the tester may lose focus and aim.
3. Traceable – test cases should cover all the requirements of the software, and every test case should be mapped with “Requirement ID." This helps in ensuring that testing is providing 100% coverage to complete requirements and tester is performing testing for all requirements. Further, it also helps in impact analysis.
4. Maintainable – with the changes in requirement, tester should be able to easily maintain the test suite of test cases. It should reflect the changes in software and accordingly steps should be modified.
5. Positive and negative coverage– test cases should test for boundary values, equivalence classes, normal and abnormal conditions.  Apart from testing for expected results, the negative coverage can help in testing failure conditions and error-handling.
6. Coverage for Usability aspect – Test cases  should include testing for UI interface from the aspect of ease of use. The overall layout and color should be tested against a style guide, if any defined for the software application under testing or should be tested against the signed off mock- up designs. Basic English punctuations, spellings, drop-down list categorizations such as depended pick lists should be covered.
7. Test Data – there should be the diversity of the data which should be used in test cases such as -   Valid data, Legitimate invalid data (to test boundary value), Illegal and abnormal data ( to test error handling and recovery).
8. Non-Functional aspect – the test cases should cover scenarios for basic performance testing of the application such as Multi-user operation, capacity test.  It should cover security aspects such as user permissions, logging mechanism. Test cases for Browser support  in case of  web application.


To summarize, the test cases should first be able to cover all the functional requirements, and then we should also include the test cases which are related to non- functional requirements as they are equally important for the proper functioning of the software.

63 comments:

peterson said...

Your information about software is really interesting. Also I want to know the latest new techniques which are implemented in software. Can you update it in your website?
LoadRunner training in Chennai

vonexpy said...

The test cases are really good. Nice informative article on software testing.
mobile application development services

Unknown said...

I gathered a lot of information through this article.Every example is easy to undestandable and explaining the logic easily.Thanks!
Phonegap Training in chennai | Phonegap Training chennai | Phonegap course in chennai | Phonegap course chennai

Unknown said...

It’s actually an excellent and useful item of information. Check Writing Software | Cheque Printing in Dubai

Unknown said...

Really an awesome post. I wondered by reading this blog post. Thanks a lot for posting this unique post which you have shared with us. Keep on posting like this exclusive post with us.

Seo Training in Chennai

Unknown said...

I cant wait to check out some of these blogs! I’ve really wanted to start learning more about cars and auto repairs lately and I think this will help a lot. I think it can save my family some money if we knew how to do some repairs at home.! Thanks again for all the options.

bike spa services in mumbai
house cleaning services in mumbai
car wash services in mumbai

Unknown said...

Thank you to all of you who found the blog interesting and appreciate it!

Padhma said...

blog was nice,very excellent software information for me,really good one thanks for sharing.
Back to original

Unknown said...

Thanks for the post, It is very helpful. High appreciate the efforts for sharing all the in-details and browser configurations for testing Selenium Grid.
Check out one of the post related to selenium concepts

Practical Oriented Selenium Training in Chennai

vignesjoseph said...

I do accept that we share our all ideas you post this blog is very presented. It's a really reasonable certainly work post.
Digital Marketing Training in Chennai
Digital Marketing Course in Chennai

Anonymous said...



Thank you for this great article which conveyed a good information.keep more updates.
SEO Company in India
SEO Services in India
SEO Companies in India
SEO Company India
SEO Services India

Anonymous said...

I have read your blog and I gathered some needful information from your blog. Keep update your blog. Awaiting for your next update.



QTP Training Videos

Peter Johnson said...

Really Thanks For Posting Such an useful information......

Bala Guntipalli

Unknown said...

Excellent article, Cool, Looking ahead to reading a lot. Sensible article USMLE Thanks for posting.

svrtechnologies said...

Thanks for Providing such an useful and informative article on Salesforce Certification Training

Unknown said...

Really Thanks For Posting Such an Useful and informative article. Mulesoft Certification Training

24Layouts said...

Really Thanks For Providing Such an Useful Information.....

Plots for Sale in Vizag

Sai Elakiyaa said...

Very true and inspiring article. I strongly believe all your points. I also learnt a lot from your post. Cheers and thank you for the clear path.
Selenium training in Chennai
Selenium Courses in Chennai
ios developer training in chennai
Best ios Training institute in Chennai
iOS Course Chennai
JAVA Training Institutes in Chennai
Java Courses in Chennai

Vicky Ram said...

Thank you for sharing this post.

bluecross.org

Guest posting sites

Unknown said...

I am feeling great to read this.you gave a nice info for us.
please update more.
Angular 6 training in Bangalore
AngularJS Training in Anna Nagar
Angular JS Training courses near me

LindaJasmine said...

Awesome Post. I was searching for such a information for a while. Thanks for Posting. Pls keep on writing.
Informatica Training in Chennai
Informatica Training center Chennai
Informatica Training Institute in Chennai
Best Informatica Training in Chennai
Informatica Course in Chennai
Informatica Training center in Chennai
Informatica Training chennai


Anjali Siva said...

Thanks admin, I have learned how to write the test cases with the help of your blog. Continue sharing more like this.
DevOps certification Chennai
DevOps Training in Chennai
DevOps Training institutes in Chennai
DevOps Training in Velachery
Data Science Course in Chennai
Blue Prism Training in Chennai
RPA Training in Chennai

Unknown said...

Useful information... thanks for posting..

Just News To U 99

Anbarasan14 said...

This is a very helpful blog for one who needs to learn in a short span of time.

IELTS Training Institute in Guduvanchery
IELTS Coaching in Tambaram
IELTS Coaching Centre in Tambaram
IELTS Training in Tambaram
IELTS Coaching Class in Velachery
IELTS Coaching near me
IELTS Coaching in Chennai Tharamani

swetha singh said...

I have gone through your blog, it was very much useful for me and because of your blog, and also I gained much unknown information, the way you have clearly explained is really fantastic. Kindly post more like this, Thank You.
airport ground staff training courses in chennai
airport ground staff training in chennai
ground staff training in chennai

rupa said...


This information is impressive. I am inspired with your post writing style & how continuously you describe this topic. Eagerly waiting for your new blog keep doing more.
Android Training in Bangalore
Android App Development Training in Bangalore
Android Training Center in Bangalore
Angularjs Institute in Bangalore
Best Angularjs Training in Bangalore

LindaJasmine said...

Awesome Post. It was a pleasure reading your article. Thanks for sharing.

Pega training in chennai
Pega course in chennai
Pega training institutes in chennai
Pega course
Pega training
Pega certification training
Pega developer training

LindaJasmine said...

Amazing Post. Great write-up. Extra-ordinary work. Waiting for your next Post.
Social Media Marketing Courses in Chennai
Social Media Marketing Training in Chennai
Social Media Training in Chennai
Social Media Marketing Training
Social Media Marketing Courses
Social Media Training
Social Media Marketing Training
Social Media Courses

Steve Coleman said...

TecSmash is your ultimate source of Technology news and Make Money Online product reviews. We research and review all Tech, MMO, Biz Opp and IM products. Tecsmash

Supplements For Fitness said...

Supplements For Fitness eating foods fortified with friendly bacteria, it is likely that the preference for probiotic supplements will be more popular in 2010. A key sales driver is to create more public awareness about specific strains of probiotics and its relation to health.

https://www.supplementsforfitness.com/

jvimala said...
This comment has been removed by the author.
jvimala said...

Thank you to share this
Regards,

Data Science certification Chennai
Data Science Training in Chennai
Data Science Training institutes in Chennai

karthick said...
This comment has been removed by the author.
karthick said...

Very Clear Explanation. Thank you to share this


Python Training in Chennai

Mark Ling said...

Quit 9 To 5 Academy Review is an amazing website where you get to work and learn with the professionals and then start your business in the platform of Facebook.

Testo Drive 365 said...

Trim Fit Keto the book, but felt the difficulty of the eating regimen made it less famous. On this creator's opinion Ducahine's e book is a must read for all of us inquisitive about vitamins.Ketogenic Diets have been used for years to treat specific situations along with obesity and childhodd epilepsy. The results of Visit for more info : - https://360nutra.org/trim-fit-keto/

Testo Drive 365 said...

Tevida were in use for thousands of years. After comprehensive laboratory testing, scientific research and research, natural male enhancers are determined to be as powerful as the opposite varieties of natural enhancement products the use of chemical substances as their major additives in addressing the Visit for more Info :- https://360nutra.org/tevida/

Testo Drive 365 said...

InMotion Body Keto Flex back it up, is the country wide Weight manage Registry. For you to join the Registry, a person has to have misplaced pounds and have saved it off for a 12 months. Currently such as over 4500 people, the Registry became based in 1993 as a longitudinal potential examine. Presently, Visit for more info :- https://360nutra.org/inmotion-body-keto-flex/

Testo Drive 365 said...

InMotion Body Keto Flex period. The Range of kcalories eaten, and the food picks and their Quantities, should be reevaluated on a normal foundation... Possibly as soon as every 1-2 months to determine this system's Effectiveness.17. Regular exercise is not encouraged as a part of the Plan for proper weight Visit for more info :- https://360nutra.org/inmotion-body-keto-flex/

Testo Drive 365 said...

AlkaTone Keto a recent look at, groups were monitored. Both corporations ate up 30% in their each day calorie consumption in fats. The simplest great dietary difference changed into that one group fed on handiest 12% in their calories from protein (58% carbohydrates), while the other group consumed 25% Visit for more info :- https://timesnutrition.com/alkatone-keto/

Testo Drive 365 said...

InMotionBodyKetoFlex21 higher.So what are you willing to give up to reach your goal in your preferred time frame?For some people they want to lose weight as speedy as possible. So they're ok with making some sacrifices here or there.Other humans price a sluggish and .For More Info : https://360nutra.org/inmotion-body-keto-flex/
InMotion Body Keto Flex

lakshmi said...

Good blog
Apponix Technologies
https://www.apponix.com/Software-Testing/Software-Testing-Training-in-Bangalore.html

Testo Drive 365 said...

Keto Flex don't run out and purchase a protein powder at your nearby grocer!Your dinner should be large protein and slow carbs. This may be really yummy and does not must be uninteresting and stupid or unsightly. Have a Visit for more info :- https://360nutra.org/inmotion-body-keto-flex/

Testo Drive 365 said...

Tevida this could also imply that you are buying a reasonably-priced high-quality male enhancement supplement.Loads of men were discussing about the pleasant male enhancement pills that can treat their dysfunctions and one way or the other help to Visit for more Info :- https://360nutra.org/tevida/

LindaJasmine said...

Awesome Writing. Wonderful Post. Thanks for sharing.
Blockchain certification
Blockchain course
Blockchain course in Chennai
Blockchain Training Institutes in Chennai
Blockchain course in Velachery
Blockchain course in Tambaram
Blockchain course in Adyar

sheela rajesh said...

marvellous!i really want to say that everyone will get new thoughts after read your post and you have narrated beautiful ideas
Android Training in Chennai
Android Training in Velachery
Python Training in Chennai
Hadoop Training in Chennai
Digital Marketing Course in Chennai
Android Training in Chennai
Android Training in T Nagar

Weight Loss Diet said...

Keto BHB 800 is a revolutionary supplement for weight loss. It is specially designed with natural ingredients to burn belly fat and extra fat from your body. The supplement converts your excess fat into energy instead of carbs. Keto BHB 800 supplement has ingredients that are all natural. It’s composed of BHB and many others. Kindly Visit on http://www.rushyourtrial.com/coupon/keto-bhb-800-natural-weight-loss-diet-supplement/

Easy Cab said...

Call Now at 7634078909 to grab a Free SEO consultation from the certified SEO consultant at Elite SEO

Agency.

Boost your online website promotion & convert your coaching institute business into a steady recurring

online income!

+91-7634078909
info@eliteseo.agency

https://www.eliteseo.agency/gwalior-seo/

Weight Loss Tips said...


Pure Life Keto is a homogenous mixture of all the natural and effective ingredients. These ingredients are safe and proved to be helpful in the burning of fats easily. It burns the extra body fats from the abdominal regions, thighs, buttock region and from arm muscles. But it does not harm the mass of muscles. Your muscle masses are conserved in their original shape and size. Only the extra fats are expelled out. You are not alone every third person in the US is tending to lose weight. Visit On http://www.theapexhealth.com/pure-life-keto-reviews-shark-tank-diet-pills-for-eliminate-extra-fat/

Weight Loss Tips said...

Insta Keto claims to be a natural supplement that suppresses the appetite, making an impact towards healthy weight loss process. The consistent use of the pills allows individuals to go with less snacking habits at night due to reduced food cravings or hunger cravings. It controls the formation of bad cholesterols and maintains a healthy blood sugar level promoting better health condition. The metabolic rate gets elevated with an improved ketosis process allowing carbs to get utilized as energy resources. VISIT on http://www.theapexhealth.com/true-burn-keto-reviews-true-burn-keto-ketogenic-diet-pills/

sasi said...

Superb! Your blog is incredible. I am delighted with it. Thanks for sharing with me more information.
Hadoop Training in Chennai
Hadoop Training in Bangalore
Big Data Course in Coimbatore
Big data training in chennai
bigdata and hadoop training in coimbatore
Hadoop Training in Coimbatore
salesforce training in bangalore
Python Training in Bangalore

Fred Haris said...

Crypto Mojo blog by Fred Haris is the one-stop destination for crypto news, basics, trading tips for bitcoin and other cryptocurrencies, price prediction, and reviews.

Worthy Choice said...

Here are some health and fitness tips for those who want to get started yet not sure how to do so. These simple tips can aid you in losing fat, gaining muscle mass, and maintaining healthy eating habits as well.

Worthy Choice said...

Here are some health and fitness tips for those who want to get started yet not sure how to do so. These simple tips can aid you in losing fat, gaining muscle mass, and maintaining healthy eating habits as well.

Sajisha K P said...

Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best.Lepto Connect Review

Anirban Ghosh said...

Not many writers can persuade me to their way of thinking. You've done a great job of doing that on many of your views here.
SAP training in Kolkata
SAP training Kolkata
Best SAP training in Kolkata
SAP course in Kolkata

suresh said...

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts read this.
DevOps Training in Chennai

DevOps Course in Chennai

Jaya said...



Nice blog! Thanks for sharing this valuable information
Data Science Courses in Bangalore
Data science course in Pune
Data science course in hyderabad
Data science course in delhi

Reshma said...



Nice blog! Thanks for sharing this valuable information
German Classesin Bangalore
German Language Course in Hyderabad
German Language Course in Delhi
German Language Classes in Pune
German Classes in Mumbai
German Language classes in Ahmedabad
German Language Course in Cochin
German Language Course in Gurgaon
German Language Course in Kolkata
German Language Course in Trivandrum

alam said...

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post. catchy business names

David Fincher said...

This post is so interactive and informative.keep update more information...
ccna Training in Velachery
ccna course in Chennai

sameer said...

Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. short business names

Muskan said...

Thank you for such informative knowledge. This is really useful for software testers. Keep sharing like these blogs. software training institute in lucknow is the right place, where you can start your career.