Writing Test Cases from SRS Document (Download Live Project Sample Test Cases) – Software Testing QA Training Day 4

Just to rehash what we have been doing so far – we are working our way through the Software Testing Training mini-course on a live project OrangeHRM.

In this free online QA training series so far, we are done with:

  1. SRS review,
  2. Test scenario/Test scope identification and
  3. Documented the Test plan.

writing test cases samples

Now, we have reached the part that is the real-deal, the test cases.

As indicated in the article before this: Test cases are documented by the QA team while the Code phase of the SDLC is going on. In other words, while the Dev team builds the software system, the testing team gets ready with the test cases that would help us test the system once it is ready, i.e. at the end of the code phase.

So, in today’s article, we will work on understanding what test cases are, how to create them and write few sample test cases for our live project.

Let us get to it right away.

Basics of Writing Test Cases:

#1. If test scenarios were all about, “What we are going to test” on the AUT – the test cases are all about “How we are going to test a requirement”.

For example, if the test scenario is “Validate the Admin login functionality” – This would yield in 3 test cases (or conditions) – Login (successful), Login-unsuccessful when incorrect username is entered, Login-unsuccessful when incorrect password is entered. Each test case would in turn have steps to address how we can check a particular test condition is satisfied or not.

#2. The input to create a test case document is FRD, Test scenarios created in the earlier step and any other reference documents if present.

#3. The test cases documentation is an important deliverable by the QA team and is shared to BA, PM and other teams, when done for their feedback.

#4. Work is divided among the team members and each member is going to be responsible for creating test cases for a certain module or a part of a certain module.

#5. Just like with the test scenarios, before we begin Test case documentation, a common template has to be agreed upon. Practically anything can be used to create test cases. The 2 most often used choices are MS Excel and MS word.

#6. The MS word template looks something like this:

Test cases MS word template

#7. The Excel template could look like the following:

qa training test cases samples xls

#8. From the above two templates it can be observed that the fields (or the components) that make up for a test case are the same, the only difference is the way in which they are organized.

So, as long as there is a field for each of the type of information to be included in a test, the format of the template does not matter. However, my personal favorite happens to be the excel sheet, because it is easy to expand, collapse, sort, etc. But again, choose any format that works best for you.

Fields in Test Cases:

Let us take a moment, to observe the fields that are part of a test case.

Test case Id and Test case description – these are the generic ones.

The other fields can be explained as follows:

a) Precondition – state of the AUT (the state in which the AUT needs to be for us to get started)
b) Input – data entry steps. For these steps it is important to note what kind of input info is required – Test data
c) Validation point/trigger/action – what is causing the validation to happen? (Click of a button or toggle or the link access. Make sure there is at least one validation point to a test case- otherwise it is all going to be data entry with nothing to look for. Also to ensure that we have enough modularity, try not to combine too many validation points into one test case. 1 per test case is optimum.)
d) Output – expected result
e) Post condition – This is additional information that is provided for the benefit of the tester, just to make the test case more insightful and informative. This includes an explanation about what happens or what can be expected of the AUT once all the test case steps are done.

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

See Also => Sample test case template.

Live Project Sample Test Cases:

Now that we have enough background information to get started on the test case creation process, let us get going and create few test cases for our Live Project.

Based on the process mentioned above we have created some sample test cases for the OrangeHRM account module.  These should give you exact test case format and idea on how to approach for writing test cases.

=> Download Sample Test Cases Document for our Live Project here.

Note – there are few images referred in sample test cases xls document. If you are viewing this on older MS Office version, you may face compatibility issues. So we have listed those images below as per their names in the xls files:
View Pic 1
View Pic 2
View Pic 3

There, all done and all good.

Test Cases Writing/Optimization Methods

Now, imagine a situation where a certain page has a few 10’s of fields on it or has a complex business logic that is implemented in there. To make sure that we optimize the test case creation process in situations like that, we testers have certain Test case optimization methods.

 Below is a list and please check out the links provided for more information on these methods.

Using the above techniques and following the general test case creation process, we create a set of test cases that would effective test the application on hand.

A few important points to note:

  • The test cases we create are not only the point of reference for the QA phase but also to the UAT.
  • Internally test cases are peer reviewed within the team.
  • When a certain situation is not addressed by a test case – the rule of thumb is, it is not going to get tested. So, this is a good place to check whether the test suite we created achieves the 100% test coverage goal or not. To do so, a traceability matrix can be created. Check out all there is to know about traceability matrix here.
  • Tools – Test management tools like QC, qTest help us with the test case creation activity. For an example on how test cases can be dealt with using Quality Center, check out this Quality Center tutorial.
  • Automation tools can be used to create test cases- in which case, they are referred to as, Test scripts.

Tip: Please perform a spell and grammar check on each and every document we create. We are the quality representatives for IT projects – and it doesn’t reflect positively on us if our deliverables themselves are of inferior quality.

That brings us to the finish of another interesting segment.

Conclusion:

The end of test creation process/test design phase (STLC) and the end of the Code phase (SDLC) will generally mark the end of test preparation phase and the beginning of the Test execution phase.

Next tutorial in this Software Testing CourseIn the coming article, we will talk about what test execution is, what it includes and what are the expectations from the QA team during this phase.

=> QA Training Day 5: Test Execution

We hope all of you are working along with this series. For the sake of simplicity, only a few test cases have been created. However, best results can be seen when you work on testing extensively, which means writing more and more test cases. So, please don’t limit your work and do as much as you can.

Please do let us know your questions and comments below. Happy testing!

Recommended reading

41 comments ↓

#1 Ganesh

very informative, practical, in-depth and useful series so far. keep up the good work!

#2 Vedan

excellent. the test cases samples are really useful. can you provide details of how to use test cases in test management tools?

#3 Kingsley

This statement ‘The end of test creation process/test design phase (STLC) and the end of the Code phase (SDLC) will generally mark the end of test preparation phase and the beginning of the Test execution phase’ is incorrect. STLC is part of the SDLC and coding is part of SDLC. It is always important to consider testing and coding activities as part of the SDLC and not separate them as above.

#4 Siddhant raut

Thank you …keep on exploring

#5 DORA

Clean and neat work.Since i am at a beginner level, very confused to write all the possible test cases, so could you please include few more test cases , so that I can clarify my doubts.

#6 Atula

Good work as always – keep it up.
Few things to clarify. How do you select, which method/s to create test cases ? Like are we using BVA, EP etc. for all applications OR is there a way of deciding the method/s to create test cases.
And also like to know how test cases for Regression testing is defined/created. Is it actually a subset or full set of test cases used for Functional testing OR does it contain additional test cases specific for Regression testing ?

#7 Ritesh

Great stuff..

#8 Muthukumar.R

Very informative. keep posting

#9 Mayank Srivastav

absolute practical content ….hats off to the team behind the scene

#10 Jyothi

Thankyou so much

#11 Anil

Thanks..
Eager to view answers for Atula’s Clarifications.

#12 Tika Ram

Thank you very much. The test cases samples are really useful for me. Could you provide details of how to use test cases in test management tools?

#13 Swati

@Vedan: We have HP QC and Altlassian JIRA tutorials on the site. These are a great help for the information you are looking for.
HP ALM: http://www.softwaretestinghelp.com/learn-hp-quality-center-qc-in-4-days/
JIRA: http://www.softwaretestinghelp.com/atlassian-jira-tutorial-1/

#14 Swati

@Atula: BVA, EP or any other test data/case optimization techniques are used on an ondemand basis. It does not mean that for every project, we have to use these methods.
Regression Tests are usually a subset of the entire tests that we have.

#15 Robin Mehta

Good Test case Forum

Positive test scenario and negative test scenario also need to put into test case, what we are going to test for particular module and how we can think out of the box as suggest Softwaretestinghelp.com

we need to put at least two iteration for Testing the module means when first iteration done and when developer solve that particulate iteration 1 test case then we need to again check and whatever updates done we need to update it on iteration 2.

#16 pratap

What is the architecture for the HRM project which was explained in above training

#17 amit chand

great work , keep it up…..

#18 aaryan

plzprovide some effective test cases examples in ms excel sheets.
thanku

#19 yaswanth

i want all types of testing test cases on hospital on patient. please give me if you have.

#20 Ganesh

Very clearly explained. The excel sheet with the sample is impressive.

Can u also help on what the methodologies or processes that are used in an organization like agile,.. in a real time environment.

#21 vikram

I had a doubt with writing a test cases in gmail creation for the fields date of birth and captcha . can some one help with that how to write +&- test cases

#22 koti

your information is very useful for me.please give the detailed information about SAP Testing Process.

#23 PM

Amazing article. Do you have anything for Firmware Testing. I know it’s a similar procedure but there are certain differences, if you can guide me to the Firmware Testing link, it would be helpful. Thanks in advance

#24 mm

do you have any srs file format ??
if you have plz send me….

#25 chaitanya

can any one tell me when will you prepare test cases

#26 Azhar

The content is excellent and very self explanatory.
Can you pls provide with an example of test scenario and all test cases written for that scenario.
This would help us in getting how to cover every requirement specified in test scenario.
request you to do the needful .

#27 NEETHU

Please provide me the details about the sdlc in terms of fuel gaue and its test cases in excel sheet format..If you have ,please provide it.

#28 NEETHU

Please provide me the details about the sdlc in terms of fuel gauge and its test cases in excel sheet format..If you have ,please provide it.

#29 venkat

hi this is venkat looking for a live project.

#30 rak

Excellent matter

#31 Rishabh

Really it is call Live Project OSSSSAM

#32 Rishabh

Chaitanya when your test scenario will be validate by your lead or peer review then u can start writing test cases.

#33 sumit

please send me sample of test cases

#34 prashant

it is very important stuff for fresher tester thank you !!!!

#35 MT

Your use of acronyms can be very frustrating. For instance, ‘AUT’. What?
Please write the full phrase out at least once per page.
Thank you.

#36 Praveen

Hello sir which document we follow for writing system test cases .

#37 Anil

Hi Team,

Req: Got High level Scenarios and Need to write test scripts/cases based on the test scenarios.

Please can you explain what kind of questions/information we should know before writing test scenarios.

Thanks in advance :)

Regards,
Anil

#38 Mdk

Quite impressive

#39 Fan

good

#40 ANISH KUMAR

your information is very useful for me.please give the detailed information about SAP Testing Process.

ER ANSH KUMAR
9472615529

#41 viresh

Hi guys please help me
while adding card i am getting ” Recurring 3d Secure Order is not allowed”” i am getting this issue so anyone can know please tel me
viresh015@gmail.com
8553755806

Leave a Comment