Tips for Writing Test Cases

One of the most frequent and major activity of a Software Tester (SQA/SQC person) is to write Test Cases. First of all, kindly keep in mind that all this discussion is about ‘Writing Test Cases’ not about designing/defining/identifying TCs.

There are some important and critical factors related to this major activity.Let us have a bird’s eye view of those factors first.

a. Test Cases are prone to regular revision and update:

We live in a continuously changing world, software are also not immune to changes. Same holds good for requirements and this directly impacts the test cases. Whenever, requirements are altered, TCs need to be updated. Yet, it is not only the change in requirement that may cause revision and update to TCs.

During the execution of TCs, many ideas arise in the mind, many sub-conditions of a single TC cause update and even addition of TCs. Moreover, during regression testing several fixes and/or ripples demand revised or new TCs.

b. Test Cases are prone to distribution among the testers who will execute these:

Of course there is hardly the case that a single tester executes all the TCs. Normally there are several testers who test different modules of a single application. So the TCs are divided among them according to their owned areas of application under test. Some TCs related to integration of application, may be executed by multiple testers while some may be executed only by a single tester.

c. Test Cases are prone to clustering and batching:

It is normal and common that TCs belonging to a single test scenario usually demand their execution in some specific sequence or in the form of group. There may be some TCs pre-requisite of other TCs. Similarly, according to the business logic of AUT, a single TC may contribute in several test conditions and a single test condition may consist of multiple TCs.

d. Test Cases have tendency of inter-dependence:

This is also an interesting and important behavior of TCs that those may be interdependent on each other. In medium to large applications with complex business logic, this tendency is more visible.

The clearest area of any application where this behavior can definitely be observed is the interoperability between different modules of same or even different applications. Simply speaking, wherever the different modules or applications are interdependent, the same behavior is reflected in the TCs.

e. Test Cases are prone to distribution among developers (especially in TC driven development environment):

An important fact about TCs is that these are not only to be utilized by the testers. In normal case, when a bug is under fix by the developers, they are indirectly using the TC to fix the issue. Similarly, where the TCD development is followed, TCs are directly used by the developers to build their logic and cover all scenarios, addressed by TCs, in their code.

test cases writing tips

So, keeping the above 5 factors in mind, here are some tips to write test cases:

1. Keep it simple but not too simple; make it complex but not too complex:

This statement seems a paradox, but I promise it is not so. Keep all the steps of TCs atomic, precise with correct sequence and with correct mapping to expected results, this is what I mean to make it simple.

Now, making it complex in fact means to make it integrated with the Test Plan and other TCs. Refer to other TCs, relevant artifacts, GUIs etc. where and when required. But do this in balanced way, do not make tester to move to and fro in the pile of documents for completing single test scenario. On the other hand do not even let the tester wish you had documented these TCs in some compact manner. While writing TCs, always remember that you or someone else will have to revise and update these.

------------

 

2. After documenting Test cases, review once as Tester:

Never think that the job is done once you have written the last TC of the test scenario. Go to the start and review all the TCs once, but not with the mind of TC writer or Testing Planner. Review all TCs with the mind of a tester. Think rationally and try to dry run your TCs. Evaluate that all the Steps you have mentioned are clearly understandable, and expected results are in harmony with those steps.

The test data specified in TCs is feasible not only for actual testers but is according to real time environment too. Ensure that there is no dependency conflict among TCs and also verify that all references to other TCs/artifacts/GUIs are accurate because, testers may be in great trouble otherwise.

 

3. Bound as well as ease the testers:

Do not leave test data on testers, give them range of inputs especially where calculations are to be performed or application’s behavior is dependent on inputs. You may divide the test item values among them, but never give them liberty to choose the test data items themselves. Because, intentionally or unintentionally, they may use same test data and some important test data may be ignored during the execution of TCs.

Keep the testers eased by organizing TCs according to the testing categories and related areas of application. Clearly instruct and mention which TCs are inter-dependent and/or batched. Similarly, explicitly indicate which TCs are independent and isolated so that tester may manage his overall activity at his or her own will.

 

4. Be a Contributor:

Never accept the FS or Design Document as it is. Your job is not just to go through the FS and identifying the Test Scenarios. Being a quality related resource, never hesitate to contribute. Suggest to developers too, especially in TC-driven development environment. Suggest the drop-down-lists, calendar controls, selection-list, group radio buttons, more meaningful messages, cautions, prompts, improvements related to usability etc.

 

5. Never Forget the End User

The most important stakeholder is the ‘End User’ who will actually use the AUT. So, never forget him at any stage of TCs writing. In fact, End User should not be ignored at any stage throughout the SDLC, yet my emphasis so far is just related to my topic. So, during the identification of test scenarios, never overlook those cases which will be mostly used by the user or are business critical even of less frequent use. Imagine yourself as End User, once go through all the TCs and judge the practical value of executing all your documented TCs.

 

Conclusion:

Test Case Writing is an activity which has solid impact on the whole testing phase. This fact makes the task of documenting TCs, very critical and subtle. So, it should be properly planned first and must be done in well-organized manner. The person who is documenting the TCs must keep in mind that, this activity is not for him or her only, but a whole team including other testers and developers, as well as the customer will be directly and indirectly affected by this work.

So, the due attention must be paid during this activity. “Test Case Document” must be understandable for all of its users, in an unambiguous way and should be easily maintainable. Moreover, TC document must address all important features and should cover all important logical flows of the AUT, with real time and practically acceptable inputs.

What’s your test cases writing strategy? Share your tips with our readers and also put your queries in comments below.

Further reading: How to Write Effective Test Cases

Recommended reading

78 comments ↓

#1 ARUNA

The concept which is in tester’s mind is clearly discribed here. Good work.

#2 jagdish kumar

Can you tell me that how to perform Stress, Load and performance testing.

#3 chennu

Hi please can any one send me the test case format.
or sample example of Test case. my mail ID is channug123@gmail.com.

#4 Manjunath

Sir,
Can u send me some test case examples,,,, so tat my confusion ll get clear,,,,

#5 Yamraaj

Very nice and well organized article, clearly shows the practical essence and technically sound knowledge

#6 manikandan

hello fans,
i need testcases ,plans for writing with hotelmanagement application..pls give me some ideas..jst send to ma id mk_mani89@yahoo.com..its urgent

#7 vini

Can any body explain about ETL testing with an example.

#8 Joel Montvelisky

Don’t forget other considerations, such as ROI (you never have the time to write the perfect test case), rules and priorites and the 80/20 rule.

You can read about it in a post I wrote a while ago called “If you are going to write-down just one (more) test case, what would that test be?”

All the best,

Joel

#9 rahul gore

how to write +ve &-ve test cases

#10 Aditya

I would like to deciding priorities between test cases execution when project deadline comes near? how should tester keep approach if functionality is visible and if project deadline comes near then he should check the functionality or keep it as it is?

#11 narasimha

Can u give test case format

#12 shiny

can anyone help me out with this? i have faced a question in interview that wat z the responcibility of u? after signing off ur current project? wat do u do?

#13 Priya

Nice article to understand about the test cases. Pls send me some sample test cases also.

#14 gowthami

can you send standards of writing best unit test cases with examples!!!!!
and difference between technical unit test case and functional unit test case??

#15 Srikanth

Its very nice to understand the test cases in theoretical , but please send me some example test cases because i have confusion to write practical. If you send some examples it will very help full sir.

#16 pallavi

can you send standards of writing best unit test cases with examples….. i will be thankful to u

#17 vineet

HI,
I found the content very helpful and clear & crisp to build my understanding regading writting test cases…

Thanks

#18 Vijay

This is really helpful for me…

thanks.

#19 Deepak

Hi can any one send me list of requirement and test cases of that for practice…

#20 Deepak

Hi can any one send me list of requirement and test cases of that for practice…
please do, its very important..
my id is deepak.goel033@gmail.com

#21 rajni

hi , nice understanding of testing. could you send me sample of a test case.

#22 Abdul Rauf Channa

hello fans,
i need testcases ,plans for writing with electronic Submission application. . in which i want to send the research articles online to a paricular company and on the behalf of validation i want to send some acknowledgement to sender. pls give me some ideas..jst send to engrabdul4u@yahoo.com its urgent

#23 Abdul Rauf Channa

sorry my emai is engrabdulrauf4u@yahoo.com

#24 gary memon

can some one send me some sample test cases and the format please and list of reqirement please for practice
thanking u

#25 anil

Nice topics related to testing .. can anyone plz send me some examples of testcase related to education domain and step by step procedure to make a testcase understand easier

#26 gzde

Thanks for your sharing. If you have exaples of test cases done with multiple users and send me, i ll be glad.

#27 Ajay

Hi
Deepak and Rajni,

I have test case sample.but Rajni did not mention his email id next time mention your email id.Now i m sending test case sample to deepak’s given id.

thanks..
cheers!!!

#28 Manas Sarangi

Hiii
i am manas.this is a lovely website for software testers.Can u give me test cases regarding student portal,employee portal for educational institutions.

#29 Reeshav Singh

Its very good for all. Your team is doing wonderful job, Thanku so much for providing this to all who wanted to built there career in Software testing

#30 Sushil Shukla

Hii,……..
I am sushil shukla, I need help from u , what is test case why it is essential in software testing, Please mention any example related this question,

#31 Santosh

Can you please send some Test case examples.

#32 Santosh

Can you please send some Test case examples.
to my email address psantosh4u@yahoo.com

#33 soumya

I am currently working on a local host application.
here’s the summary about the application, just to get you acquainted with it.
the application is about course management system.
there will be 3 users- Admin, guest and student. and obviously 3 seperate logins for the three users.
admin adds course contents and schedules.
student accesses these added schedules.
there are only few courses which a guest has access to. (admin has the power to choose which courses can be taken by the guest)
my problem is, there are a lot of hyperlinks. and i am writing test cases like this.

#34 Sathyavanan

I need sample test case excel file

#35 njeru

Good, simple but very relevant article. Kindly share with me the best test cases relating to finance and accounting in a core banking project

#36 sai

hi can some one send me some test case samples.
my email id is sai632000@yahoo.com

#37 kavita

10 What are Add –ins?
11 Formula of statement coverage?
12 Text cases on calculation?

#38 Samarth Gupta

waht are the difficulties in preparing test cases?

#39 Samarth Gupta

importance of domain knowledge in test case generation

#40 Bhushan

Please can anyone tell me
How to write functional test cases for gaming application?

#41 Edward

Hello Fans,

I would appreciate it immencely if some one could send me some test case samples and also some documents on how to write functional test cases for gaming application? i need testcases ,plans for writing with electronic Submission application.

My email is: mchayz78@hotmail.com

#42 hemu kumar shriwastaw

hi, sir this is good but i want to more about test case.
so sir tell me more plzzzzzzzzzzzzzzzzzzz

#43 hemu kumar shriwastaw

hi,manas
i am hemu ,according your u want to write test case of student and employee for instution,so
first of all your objective is “vrification” then write step to be taken like student id,name ,father name and checking to database of instituton as wellas employee.

#44 hemu kumar shriwastaw

sorry! minus according your question

#45 arlene

hi, i’m new with this too…i hope anyone of you could be able to send me any test cases to walk me through this..and be alble to understand writing test cases properly..thanks
jamoraarleneantonette@yahoo.com

#46 Thomas

It helped me great so any one can send me sample test case document

#47 john

That’s a lot information, i have learned so much Thank you. Can you send me a test case sample format?

#48 waqas haider

nice:)

#49 Alok jha

Hi please can any one send me the test case format.
or sample example of Test case. my mail ID is alokbjha@gmail.com

#50 kalyani

hi can any one ca send somple sample test cases plz

#51 kalyani

i need defect tracking and test management tools

#52 ram

good

#53 sreekanth

Fantastic Stuff.It is so simple and smart.

#54 preeti

Please send me Test case samples???????
email me on preetiusa007@yahoo.com Thanks…

#55 Sudha

Hi ajay or anybody
Can u pl send me test cases my mail id is sudharani1995@gmail.com
Thanks
Sudha

#56 Nandy

@ jagdesh Kumar :

Stress Testing : For eg: In an application click a Web Button
continuously for many time’s, it should not
show any Exception. This is called Stress
Testing.

Load Testing : For eg: If 100 people logged into apps at a
time the apps should work fine.

Performance Testing: To ensure the performance of the apps.

Hence the above test’s are generally do on web based apps.

#57 srinath

hi,
can any one send me the some sample testcase(realtime tc’s)

srinathmtech47@gmail.com

#58 karthick

i need a basic examples to write a test cases for manual and automation

#59 nilesh

Hi please can any one send me the test
case format.
or sample example of Test case. my
mail ID is channug123@gmail.com

#60 nilesh

sorry my mail id is
nileshpatil353@gmail.com

#61 Amar

please tell me what exactly do in intigration testing pleas explain with example ,how we test interface intigrity btwn modul

#62 shamly

can u give sample testcase for looping & condition statement.

#63 Partap

Can Anybody send me User Acceptance Test Cases for any VOIP application ?

#64 dipti

hi ,i am dipti i am currently working in banking domain can anyone send hybrid framework i.e keyword and data driven framework material as weel as real time example and banking domain testcases to understand easily and my emailid is diptimayeebhadra@gmail.com

#65 T.srikanth

this is srikanth iam currently working in a quality analyst.. i need easy steps of test cases and website application testing plz send any body.

#66 shipra

can any buddy plz send me the test cases, test plan sample….with proper example

#67 Revathi.k

Hi please can any one send me the test case format.
or sample example of Test case. my mail ID is revathiilakya@gmail.com

#68 leena dsouza

Pretty helpful. Can any one in the group send me a sample of the test case template / format.

You can send me it to me at leena.dsouza@credit-suisse.com or ldsouza4210@hotmail.com. The security system at Credit Suisse is very high hence providing my personal email

Thanks
Leena Dsouza

#69 suresh

Nice article to understand about the test cases. Pls send me some sample test cases also.

#70 k Roma

Hi sir
Actually I want more details about test cases and test scenarios please send me details on my I’d kromi_1234@yahoo.co.in
Thanks

#71 Amandeep Singh

Nice list of tips – I have also tried to cover a few important tips which one can practice while writing test cases, do check it out on my software testing blog..

Cheers!
Aman

#72 Jaya Saini

Hello Vijay,
I am Jaya Saini. I am recently Join a MNC group. and i am in testing so may you help me to build the test cases and give me some test cases relate excises. because i am a naive. i do not have any knowledge about testing. so may you help me and suggest me.

#73 Aasim

hi, i’m new with this too and have no idea, how to write Test case, either start from field level or general functionality like New, Edit, Delete Or from Scenarios.
I hope anyone of you could be able to send me test cases regarding desktop application (like input form having 6 to 7 fields) to walk me through this .thanks
m_aasim@hotmail.com

#74 Preeti

Hi,

I have got the project on excel sheet, need to test excel application macros. Not getting how to start with it. Please give ny simple way to test this application. and also share the TCs for windows based apllication.

#75 shriniwas

Hiii…
I want test case about metro lift….with all possibilities…help me

#76 dolly

Hi Sir
I am learning how to write a test plan and effective test cases.. can you please send me the sample of the test plan and test cases…. I really appreciate your help
thanks

l.childdaycare@gmail.com

#77 Omar Ansari

Hey guys!
I’ve been doing this all in manual testing, can someone please guide me to automation testing? that’ll be helpful.
Thanks

#78 DHIVYA

Can any one send me the sample test cases ….my mail id is kanageshwarip@gmail.com

Leave a Comment