How To Write Effective Test Cases?

How To Write Effective Test Cases: In the Software Tester or QA profession writing Test Cases plays a vital part in the software testing process. Writing test cases does not only mean jotting down the requirement into the scenario, rather it deals with writing down all the possible scenarios after the proper understanding of the project and business requirement. And it’s the effective test cases based on which the testing of the product is to be performed.

So, test cases should be given more priority and created before the testing starts. For a fresher in the Software Testing industry, it is very important to follow the guidelines to write test cases effectively for any of the given features. In this article, we will focus on the Guidelines to write test cases effectively for general functionalities which helps to achieve a better test case design.

Post On:How To Write Effective Test Cases
Post Type:Test Case Template
Published On:www.softwaretestingo.com
Applicable For:Freshers & Experience
Get Updates:Software Testingo Telegram Group

Guidelines To Write Test Cases

Nowadays, when going for an interview for any Software testing opening, the applicant can expect several questions related to Test Cases for different scenarios. A few of the common questions generally asked by the interviewer are- What are the test cases for checking the Registration process?

What are the possible test cases for validating the Email field on the website? What are the possible test cases for Login Page? What are the common Guidelines to write test cases effectively? and many more. We will discuss all these types of questions later in this document.

Guidelines to Write Test Cases Effectively

When writing test cases for any project, there is always some general test cases that are to be written and followed during testing. Follow the below guidelines to write test cases for general scenarios in most of the applications:

  • Proper Email validation – There should be proper validation for the field like email and it should follow the proper regex format, which is xxxx@xx.xx.
  • Proper Phone number Validation – It should have proper validation for numeric content in the phone number field and it should be between 10-12 based on the requirement. It should not accept more than that.
  • Proper Validation of text field – There should some proper validation on the input character for text fields like- Firstname, Lastname, Address, and so on. The general validation should be the word count, something like a maximum of 100 or less than 150.
  • Mandatory field validation – All the mandatory fields marked in Asterisk(*) should be properly validated.
  • Error message validation – Verify that the error message is displaying properly for the respective field and the position should also be proper.
  • Numeric Values – All numeric values should be properly formatted. All check numeric fields with maximum, minimum, and float values.
  • Button Functionality – All the available buttons should work properly and should be clickable based on the functionality.
  • Exception Handling – Exception for any field while value population through API should be properly handled.
  • Online and Offline Mode – While performing testing, the tester should check the application in both online and offline mode.
  • Negative Scenario – Along with the happy path scenario, there should be some test cases for the negative scenarios in order to find undiscovered errors.
  • Confirmation message validation – There should be a valid confirmation message displayed after the successful submission of any form and page.
  • Delete Confirmation – When deleting any value for any field, then there should be a confirmation pop confirming the user before the Delete functionality is invoked.
  • Reset Functionality – If there is Reset functionality, then clicking on Reset should reset the whole page.
  • Timeout – There should be a test case for the page timeout and it should be configured from the developer side.
  • Spelling and Grammar check – The spelling and grammatical mistakes should be properly validated.
  • Alignment Validation – The fields like- textbox, dropdown list, checkbox, etc should be properly aligned.
  • Spacing – There should be proper spacing between the fields and labels.
  • Font style – The font style and size should be uniform and should be as per requirement.
  • Tab functionality – Proper validation should be done for the Tab key. Whenever the tab key is pressed from the key, then the pointer should get changed from one field to the other.
  • Broken images and links – Proper checking should be done to find out the broken links and images in the application.
  • Cross-browser and multi-device validation – The UI of the application should look the same for different browsers and mobile devices.
  • Security Testing– Trying to access the internal functionality of the application functionality in the logged-out state by changing the URL.
  • Error Highlight – Proper checking should be done to verify the field with the error is getting highlighted in red.
  • Upload Functionality – Check image and file upload functionality are working properly. Also check by uploading images and files of different formats like- JPEG, JPG, doc, pdf, exe, etc.
  • Export Functionality – The file should get exported properly in the proper file extension. Check export functionality by exporting the large file containing a special character.

Conclusion

Following the proper guidelines to write test cases enhances the quality of test case design and will be more effective during execution. Keeping test cases simple yet effective is the skill that any software tester should possess so that maintenance at the later stage would be easy.

Guidelines to write test cases has to be followed by all the team members in the project and the written test cases have to be reviewed to ensure that the set guidelines to write test cases have been followed.

Avatar for Softwaretestingo Editorial Board

I love open-source technologies and am very passionate about software development. I like to share my knowledge with others, especially on technology that's why I have given all the examples as simple as possible to understand for beginners. All the code posted on my blog is developed, compiled, and tested in my development environment. If you find any mistakes or bugs, Please drop an email to softwaretestingo.com@gmail.com, or You can join me on Linkedin.

Leave a Comment