How to write and Test Cases to improve software Quality

ronchoqa
6 min readJan 24, 2020

--

Now anyone can write test case and become a QA 💰

For more than eight years… I’ve worked as a QA with many companies from small startups to big organizations.

My job title would vary from Quality Analyst to Software Tester to Test Automation Engineer but my role and responsibilities remained the same no matter company or application.

My Job is to TEST an application and make sure there are no defects or bugs, so if I do my job correctly and find issues and the developers fix it, this process ensures Quality!

What is a Test Case?

  • A Test Case usually consists and sticks to specific format or a template. It consist of small concise tasks or user interactions so that developers and business can manage expectations. 👥
  • A Test Case can written in multiple ways or format either in excel or word document or using a test case management tool which we will later use and demonstrate its advantages. 📑
  • An Example of Test Case format includes but not limited too and can be edited per business needs. ⏩

A Description Field — which describes a specific part you are testing either user or application behavior. (i.e):-

User should be able to search for specific product by inputing the search term and search result should be relevant. 🔍

Steps — What steps are needed to perform your testing such as

  • New user lands on the homepage
  • They click on the Search Bar
  • They type for a specific product search term i.e “bracelet”
  • They hit the Enter Key
  • They land on the Search Page

Expected Result — Based on the result and steps, we can assume or expect a result that the application will display (i.e):-

The user should be able to search and the application should display the relevant product or category page.

Sometimes we can include other fields like

  • Test Case ID
  • Pre Conditions
  • Post Conditions
  • Environment
  • Adding Screenshots or Video
  • Pass / Fail

In short, we want to create our test cases to break down application functionality into smaller parts and be able to reproduce the steps to expect same results. 🔁

Let’s take a look simple excel format 👇

What is the process to ensure the quality of an application?

Well, you write Test Cases!

As a software tester or business stakeholder, it is your responsibility to ensure the application or the “product” is working as expected. We need a set of standards that the users expect and behavior that the user of the application assumes they can perform while using the product.

Project Example

  • Let’s take an E-commerce website www.artsyjewels.com — The user or customer expects the website to perform with standards they have been familiar with such as a mobile-friendly site, search functionality, inputting data and button interactions, etc.
  • The user wants to purchase an item — The website should allow the user to easily find an item and buy the item!
  • They can search for the product or navigate to a specific category from the menu. Users expect to complete the entire checkout process and place an order. They should be able to create an account by adding personal and payment information then feel confident the order is placed using the website.

When we break-down the user expectations and behaviors when they use the application — We get Test Cases! 🔎

☝️We can analyze the above example and break the functionalities into smaller tasks such as:

  • Let’s make sure the website is Mobile Friendly 📱
  • Search for a product and the search functionality should give you a result based on the search term. 👀
  • Validate each of the Menus from the headers are working and show related page. ✌️
  • User flow of logging into the site then adding a product to the cart and then complete the checkout process. 🛒

Usually, the scenarios mentioned above are called POSITIVE Test Cases which are common and easy to perform and understand, but as Testers we have to think of all the ways user can or may interact and potentially “break” the application by coming across error message or page timeout leading them to abandon the site and therefore from business perspective they will lose the sale, which is bad!

Let’s take a look some NEGATIVE Test Case Scenarios

  • During Checkout, the user fill out wrong information by mistakes 👲
  • Does the site perform as expected on different browsers 💻
  • What if they forget their password? ㊙️
  • While searching for product they misspell the Search term. 📿
  • What if they want to change their mailing address, are they able to edit their personal information. 🌎
  • What happens if during checkout the transaction fails? 💸

As we start to explore the mindset of the User we can slowly start to discover the results of the “what ifs” and that leads to finding defects or bugs!

Why Quality Assurance needs Test Cases to find Bugs and Defects ?

Imagine you are building a new house from ground up and your responsibility is to make sure house is built properly with all the features & requirements.

The home owners expect and it matches the blue print, all the doors are working, facets and electricity etc are working as expected.

Photo by Evan Dvorkin on Unsplash
  • What would you do if the house is half built ? ✋
  • Would you randomly start checking all the doors to make sure they open and close? 😵
  • One day you check electricity and the next water or would you start measuring all the rooms and check the paint? 🚱

No, you would create a big list of things to check! 🗒

Once walls are built — you check measurements or the paint — once the electricity is wired up, you would check all the sockets and light-switches and you keep moving down the list!

By creating a list you get step by step instructions and scenarios to ensure all the aspects of the house construction are built as expected.

Similarly in software development, we can analyze what is the requirements and functionalities of the application then we make our list aka TEST CASE! then we move through the list and when we come across an issue we can mark it a defect or bug so that developers can fix it!

  • TIP the earlier in the process we can find the defect that better to fix the issue. 💁
  • What is after the whole house is built you realize the rooms are too small?— you would have to break or move the walls around the whole house to make room leading to major headache and extra cost. 😔
  • For software testing we should have the same mindset — we want to find any issues early as possible and as the features are being implemented so that it can be fixed easily! 👼

Who writes Test Cases and Documentation of an application?

Test cases can be written by business owners, developers or any stakeholders, who wants to make sure the functionality of the application is performing as expected. Software Testers and QA responsibilities include to perform testing and go through all the test cases and become a different types of users or customers that will interact with the application.

Typically, a QA will create test cases and perform them as well as writing documentation such as Test Plan and Test Strategy.

Since the QA has spent time analyzing user behavior they will document certain processes and steps needed to perform certain scenarios.

The core role of a QA is to find bugs and defects, The more organized we are the better chances of findings issues more efficiently!

Please comment on your thoughts and if you like this article give a 👏 🙌

Stay tuned for Next Steps, Using a Test Case Management tool Qase.io to make our lives easier 😜

--

--

ronchoqa

QA Automation Testing Engineer..Love to automate the Web and make Testing Frameworks with Selenium and Javascript