BLOG

HOW NOT TO WRITE TEST CASES (TIPS FOR NEW AND EXPERIENCED TESTERS)

HOW NOT TO WRITE TEST CASES (TIPS FOR NEW AND EXPERIENCED TESTERS)

Test case writing is one in every of the first activities of the QA team. We have a tendency to pay most of our time writing, reviewing, execution or maintaining these. It’s quite unfortunate that check cases are the foremost error prone.
The variations in understanding, organization testing practices, lack of your time etc. are a number of the explanations why we regularly see test cases that leave plenty to be desired.
There are heaps of articles on our website on this topic, however, today post is going to be regarding how to avoid mistakes in writing test cases – many tips which will be instrumental in making distinctive, quality and effective check cases.

3 MOST COMMON ISSUES IN TEST CASES:

Now, the most common issues I see within the test cases recently are:
1. Composite steps
2. Application behaviour is taken as expected behaviour
3. Multiple conditions in one test suit
These 3 have to get on my top three list of common issues within the test case writing method.
These common mistakes happen with each new and experienced testers and that we simply keep following a similar imperfect process never realizing that many easy measures will sort things simply.’

LET’S GET TO IT AND DISCUSS EACH IN DETAIL:

1. COMPOSITE STEPS:

First off, what’s a composite step?
For instance, you’re giving directions from purpose A to purpose B: if you say that “Go to XYZ place so to ABC” this is often not planning to build lots of sense, as a result of here we discover ourselves thinking — “How do I purchase to XYZ within the initial place”- instead beginning with “Turn left from here and go one mile, then turn right on Rd. no eleven to make XYZ” may reach higher results.
The exact same rules apply to check cases and its steps yet.
For example, I’m writing an action for Amazon.com — place Associate in nursing order for any product
The following square measure my action steps (note: I’m solely writing the steps and not all the opposite elements of the action just like the expected result etc.)
a. Launch Amazon.com
b. seek for a product by coming into the merchandise keyword/name into the “Search” field on the highest of the screen
c. From the search results displayed, select the primary one
d. Click on increase Cart within the product details page
e. Checkout and pay
f. Check the order confirmation page
Now, are you able to establish that of those could be a composite step? Right- Step (e)
Remember, actions square measure perpetually regarding “How” check|to check} thus it’s vital to put in writing the precise steps of “How to examine out and pay” in your test case.
Therefore, the higher than action is simpler once written as below:
a. Launch Amazon.com
b. seek for a product by coming into the product keyword/name into the “Search” field on the highest of the screen
c. From the search results displayed, select the primary one
d. Click on increase Cart within the product details page
e. Click on Checkout within the cart page
f. Enter the CC info, shipping and request info
g. Click Checkout
h. Check the order confirmation page.

2. APPLICATION BEHAVIOUR IS TAKEN AS EXPECTED BEHAVIOUR:

More and additional comes got to cope with this case of late.
Lack of documentation, Extreme programming, speedy development cycles area unit few reasons that force USA into hopping on the appliance (an older version or so) to either write the take a look at cases or to base the testing itself on. As always, this is often a proved dangerous practice- not forever very. It’s harmless as long as you retain associate open mind and keep the expectation that the –“AUT might be flawed”. It’s only if you are doing not assume that it’s, things work badly.

CASE 1:

If my action steps area unit as below:
1. Launch the searching website
2. Click on Shipping and come back- Expected result: The shipping and returns page is displayed with “Put your data here” and a “Continue” button
Then, this is often incorrect.

CASE 2:

1. Launch the searching website
2. Click on Shipping and return
3. Within the ‘Enter the order no’ text box gift during this screen, enter the order no.
4. Click Continue- Expected result: the main points of the order associated with shipping and returns area unit displayed
Case two may be a higher action as a result of even supposing the reference application behaves incorrectly, we have a tendency to solely take it as a tenet, do any analysis and write the expected behaviour as per the anticipated correct practicality.
Bottom line: Application as a reference may be a fast shortcut however it comes with its own perils. As long as we have a tendency to area unit careful and demanding it produces superb results.

3. MULTIPLE CONDITIONS IN ONE TEST SUIT

Once again, let’s learn from example — Take a look at the below test case steps: the following are the test steps among one test suit for a login operate.
a. Enter valid details and click on Submit
b. Leave Username field empty. Click Submit
c. Leave the watchword field empty and click on Submit
d. select AN already logged in username/password and click on Submit
What had to be four completely different test cases is combined into one. You would possibly be thinking- What’s wrong with that? It’s saving plenty of documentation and what I will knock off four, I’m doing it in 1- isn’t that great? Well, not quite. Reasons? Browse on:
• What if one in every of the conditions fails — we’ve got to mark the whole test suit as ‘failed’. If we mark the whole test suit ‘failed’, it means that all four conditions aren’t operating, that isn’t extremely true.

Leave a comment

Your e-mail address will not be published.

Enjoy this blog? Please spread the word :)