Software Testing Models





Tips/Guidelines for writing test cases

Writing good test cases is a talent and it can be achieved by experience and comprehensively studying application under test. In this article I will talk about basics tips on how to write test cases, what is test case, why use Test Case Management Tools, test case template & How to handle Test case maintenance. So lets begin with first point which is part of testers daily day to day life activity:

 

What is a test case?

Test case is set of activities with expected and actual results executed in sequence to validate the feature of an application. Test case is the document and is designed by the tester based on the SRS document and Use case document.

Definition by Wikipedia: Test case

 

How to write test cases?

  1. First understand the requirements & while writing test cases do not assume any requirements by your own. Raise the question which is not clear in requirement or requirements are misleading or incomplete, feel free to ask questions to your business analyst or client. Don’t ask to developers on this.
  2. Prior to design the test cases figure out all features of application.
  3. Ensure that test case should cover all functionality mention in requirement document. Use traceability matrix to make sure that all requirements are left untested.
  4. Avoid repetition of test cases which help to get exact scope of testing.
  5. Generic test cases should be collected & combine together in test suite, which helps to minimize the effort of writing standard common test cases every time and can be used over the project life cycle.
  6. Testing Priority should be assign to each test case. Select the Test case priority depending upon how important the test case is for that Feature, component or the product. In execution queue, high priority test cases should be picked first then medium and then Low priority test cases.
  7. As end users or clients are always interested in reports, so test cases should be group properly (PhaseI, II wise, Module wise, Sprint wise or User story wise if Agile methodology), so end user will come to know about Quality of the product based on test case execution (number of test cases Pass/Failed).
  8. While writing test cases Keep in mind all your test cases should be simple and easy to understand. Don’t write explanations like essays. Be to the point.
  9. Keep in mind input data for test cases is very important part in testing, your test cases should validate range of input data. Also check how system behaves in the normal & abnormal conditions.
  10. While writing test cases you should concentrate on real life scenarios first which end user going to use day to day life activity and accordingly test cases should be prepare.
  11. Every test case may or may not have defect linked but each defect should have test case linked.

 

What should be format of test case?

The test case template is may vary from company to company, here I am explaining standard test case format:

  • Test case id – (Unique Identifier)
  • Test case Title – (Short description of test case & should be effective to convey the test case)
  • Test case Summary – (Detailed description of test case & additional information needed for the test case to execute)
  • Pre-condition/Test data – (Any pre-requisite required to execute the test case)
  • Test Steps – (Actual step to be followed or executed)
  • Excepted Result – (Result which is expected as a normal behavior)
  • Actual result – (Result which we actually get after we execute the test step)
  • Test Case Status(Pass/Fail)
  • Comments – (Additional Comments or any note required to while executing test case or special note to tester which need to be consider)
More explanation on test case template fields:

Test case title:

  1. Many of the times the test case title is not clear, which leads to difficulty to understand what is the test case is all about. As a tester you make sure that it is gives complete idea about the test cases.
  2. Test cases are nothing but user’s action on the application. So while writing test cases make sure that user is performing those actions.  Cross verify that user is able to login, Verify that user be able to perform the necessary tasks.
  3. Try to follow following format whenever possible:
    • [Verify] – If writing Functional test cases
    • [Using] – IF test case is about use of Tool name, Tag name, Dialog, etc.
    • [With]- If test is related to any condition
    • [To]- If test case talking about what is returned, shown, demonstrated etc.

Test Case Summary:

  • Test case summary means describe the test case in short.
  • Make sure that you document the additional information needed for the test case to execute, such as Assumptions, Test data location, URLs and test credentials.

Test case Steps:

  • It’s very important to write each and every step.
  • If it’s not possible to write each and every test case, then combine the test steps logically but do not skip them.

Test case Expected Result:

As a consequence of the execution of the test cases, something has to be observed in the application. That will lead test executor to decide whether execution was successful or not.

Design & write test cases for complex application is challenging task. Even if effective Test cases written but if it is not well maintained then it could leads to confusion of execution & completion of test cases. So best options is to use Test management tools which allow you to manage & maintain test cases. In the market many more open source & commercial tools available. Using popular Test Management tools like Quality Center and JIRA you can manage test cases in efficient way. Also if you prepare set of generic test cases this can be used in different releases.
Failed test cases will allow us to link to defect & defects assigns to developer & send automatic email notifications. Upon executing test cases the result can be easily obtain in predefined & custom graphs & reports. Most important thing is tractability, it means Requirements, Test cases, Execution of Test cases are all interlinked through the tools and each case can be traced against each other to check test coverage.

 

How to handle Test case maintenance?

Today’s fast growing world software application requirements of keeps on changing on every software upgrade. So in every upgrade test suite needs to be updated or maintained based on new requirements.  While updating test cases following key points needs to be considered:

Add new test cases: Add new test cases in the test suite for new requirements which introduced in this release. While testing, tester may found scenario for white test case is not added in test suite; hence such missing test case should be created & added in the test suite.

Test cases for Production defects: Upon releasing the software on production, the end user may report defects which observed on production environment. This is due to comprehensive test cases are not written for particular area, as a result defects are observed in production. Hence based on defects found during previous release, new test cases should be added or modified which are missed to add in previous release.

Remove obsolete test cases: Upon changes in the requirements, it could add new features & same time few exiting features no longer valid or not supported in this release, so such obsolete test cases should be removed from current test suite.

Remove unnecessary test cases: In test case design phase there is a chance to create duplicate test case or added different test case which functioning similarly in testing. Presence of such test cases may lead wrong status of testing. So it is important to clean up such duplicate test case to get real picture of testing.

I think I have addressed all important tips on test case writing with test case example. I want to ask one question to you, Which testing tool you daily use for writing test cases. Please share your experience to newbie, so they can get idea on writing test cases.

If I missed out addressing some points on test cases then let me know in comments below. If you like this article you would also like to Subscribe to our software testing email newsletter for software testing latest updates.

 

8 comments to Tips/Guidelines for writing test cases

Leave a Reply

  

  

  


*

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>