Skip to main content

Basic Things to be Considered While Writing a Test Case


Test case writing is an activity which has a great impact on the testing phase. So, writing test cases which are effective as well as reusable is very important. Here are some points you have to keep in mind while writing test case.
  • Requirement understanding and Clarification: Before starting writing test cases, needs to understand user requirements and scope of the testing. If you have any queries then get it clarified. Never ever assume anything, which leads incomplete or mislead testing. While requirement understanding, if you find any missing requirement or scenarios, confirm it.
  • Test Coverage using Traceability matrix: List down all the functional and non-functional requirements. You can get this information from requirement documents or impact analysis documents. Use Traceability matrix to ensure test coverage.
  • Prepare Real Life scenarios: 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. Always include end to end testing scenarios and clients use case.
    Image Source : http://www.softwaretestinggenius.com/mastering-the-art-of-writing-intelligent-test-cases-especially-for-test-automation
  • Select test strategy in such way that all requirement mentioned in documents should be covered.
  • Test Cases should be Simple, to the point (not essay type) and understood by any one. Group your test cases module vise or functionality wise. eg. user story wise if Agile methodology is used.
  • 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. All scenario related to specific control/functionality should be covered in one test case/test suite.
  • Avoid repetition of test cases which help to get exact scope of testing. Separate out UI, Functional, integration and System testing related test cases based on functionalities. Defect should be linked with test cases. Test only one thing at a time.
  • Take care for Format used for your organization :
  1. Title: It should clearly describe purpose of the test case.
  2. Description: Put detailed information related to test case.
  3. Pre-requisite: Whatever prior data setup or steps user has to perform should be mentioned here.
  4. Steps to be executed: Keep the test steps clear and concise.
  5. Priority: High/Moderate/Low Priority are available for any test case.
  6. Expected Result: Include the Expected Result. There must not be any test case without expected result.
  7. Status: Pass/Fail/Blocked/Note run/On Hold this status are available for any test case.

    Apart from above fields, there can be more fields like Project Name, Reviewer,Owner,Creation Date,Defect ID etc.
  • Testing Priority should be assign to each test case. Priority can be set depending on how important the functionality is or when tester fails it of which severity bug it can produce. In execution queue, high priority test cases should be picked first then medium and then Low priority test cases. To perform Build Acceptance test or Smoke test, only High priority test case should be executed.
  • Use test case design techniques like “EP, BVA, Decision Table, State Transition table, Error guessing and experience base. Clearly mention test data and test conditions in your test cases. Include all types of test data like valid, invalid, positive/negative scenario, etc.
  • Proper review should be done for your test cases. Before finalizing test case it should be peer reviewed.
Conclusion:
It’s a very big task to write effective test cases with all required details for any requirement. While writing test cases user has to make sure to think from end users perspective, know the application end-to-end and follow above mentioned points for test case writing. It can be useful to you.:)

Comments