GO LIVE with us
Csaba Köböl

How to write the most effective test case for web application ?

Knowledge center, Software Testing

What is a Test Case?

Test cases are series of steps to validate whether a web application has no bugs and working mandatory by the end user requirements . Learning curve of how to write test cases in web application development needs basic writing skills and crying out for attention to detail, and  good understanding of the application of seven test principles :

  • Testing shows presence of defects
  • Exhaustive testing is impossible
  • Early Testing
  • Defect Clustering
  • Pesticide Paradox
  • Testing is conditions dependent

When you write a test case, it’s crucial to put yourself in the user’s vision and include all the needed fine point. Putting time to the extra effort to write effective test cases alway will save you time and effort later in repetitive tasks. An outstanding test case should allow for any newcomer tester to master and execute the test.

Writing test cases can be taking up a great part of  your time, notable at bulk writing . Here, you will learn some tips on how to write effective test cases, a sample of a test case attached .

How to write effective test cases for web application:

Use a declaring title

An outstanding test case starts with a  declaring title. As a best practice, the  ideal  title for the test case is along the same lines as the screen/page which you’re testing. For example, if you’re testing the login procedure, include “Login Page” within the title of the test case.

Include a storytelling Description

The description should visualize in the tester what they’re going to test and embrace any other relevant info such as the environment where the test case is executed with purpose test data, and applicable preconditions/assumptions.

Don’t forget to add Assumptions and Preconditions

For outstanding test case is mandatory to enclose any assumptions that impact to the test and any preconditions that have to have settled before to the test be carrying out. This should include where to start the test on,  configuration and naming of the test environment, and any setup of initialization setting that must be done prior to executing the test. This practice supports shortness of the test and its lucidity.

Be KISS

This is perhaps the most crucial part of a test case, so use the well-tried “Keep it simple, stupid”. Share the how to run the case, where to run, what data to use. Keep this section simple and short, but don’t forget any vital specifications.

Describe the expected state

The expected state of result should make known the tester what he/she should suppose to see as a result of the test steps. Based on this tester would decide where he/she choose if the test case result is a “pass the test” or is a “fail the test” .

Make it Reusable

An outstanding test case which ought to be reusable changes to an asset to the  testing team. When structuring a test case, keep this in mind. You can save time later by re-using the test case rather than writing it .

Sample of a Test Case

Title: Login Page – Authenticate Successfully X-platform on mypage.tld with Google account

Description: A registered user should be able to successfully login at mypage.tld

Goal: successful login

Precondition: the user must already have an active Google account
Use registered user google account :

login :ourlogintcase@gmail.com

password: H3llo_K1ttY  (password is case-sensitive)

Assumption: a supported browser and operation system(OS) are being used.
Test Steps:

Open a supported BROWSER_N in supported  OS

Navigate to mypage.tld
Click the ‘Use my Google’ button.

google login example
Enter the Google login and password of the registered user
Click ‘Sign In’

Expected Result for 1st run in BROWSER_ in OS_:
An Terms of Usage page should load
Click ‘Accept it’

A page displaying the mydomain.tld registered user’s personalized welcome page should load, showing unread messages at the top of the page.

Expected Result for 2nd and next run in BROWSER_ in OS_:  : A page displaying the mydomain.tld registered user’s personalized welcome page should load, showing unread messages at the top of the page.

Conclusion

Writing test cases for software takes a little practice and knowledge of the software that’s being tested. Well-written test cases can make your testing process smoother, and save you time in the long run.

Related Posts

Software Testing BEER.EX 2023

Check the unique atmosphere of SANAE Software Testing BEER.EX 2023.

Partnership

Sanae is ISTQB Gold Patner

About us

SANAE is a well-established provider of software testing and QA solutions. We believe that true success can be reached by cooperation and networking rather than through competition, therefore apart from the main area of business, we are working hard to build, maintain and enlarge a community of testers in the Bratislava region and beyond. This effort resulted into SANAE Software Testing BEER.EX.