There is no high-quality software without testing, and there is no testing without written test cases. And for the software testing to be efficient – i.e. purposeful and easy to execute – you need to write transparent test cases. But what does the word transparent actually mean in this context? Read on to find out!

What is a test case?

Before we start: for those of you who are not familiar with software testing, here comes a short explanation. A test case is written by a tester or a QA specialist and describes a set of actions executed in order to verify if a particular feature of software works as per the requirements of the customer. This is determined by comparing the expected and actual results of a single test.

The basic condition to start writing tests is knowing how the app should behave in given circumstances. Only then a tester is able to determine which potential result of a test case is considered a defect and when it can be considered successful.

What elements should tests contain?

  • name of the software that is being tested

  • defined desired input of a specific test case

  • test preconditions – what needs to be prepared before the test starts (e.g. login data)

  • starting date, names of testers and developers assigned to the case

  • location (web links or app exact location)

  • acceptance criteria – when the test should pass and when it’s considered failed

  • the information what tools and environments are necessary to execute testing, including devices and operating systems

  • specified requirements connected directly to related tests

  • nature of tests (manual/automated)

  • timelines and deadlines

  • priority of a specific test

How to write tests in Jira [examples]?

Test cases should be written in a way so that the reader understands what the goal of testing is. They should have supporting pictures or screenshots so that testers can easily identify them — this ensures that they are not executing something which they are not supposed to be doing. Jira makes it possible to add attachments, which makes it possible to illustrate all necessary information.

This is how a well-written test case should look like:

Test Case ID

Test Name

Test Description

Pre-conditions

Test Steps

Test Data

Expected Results (Post-condition)

Actual Results

Status (Pass / Fail)

TC-01

User login – correct credentials

A user should be logged in to the app using the correct username and password

User should have correct login data

  1. Go to the app

  2. Enter User name

  3. Enter Password

  4. Click Log-in button

User name = id123 Password = pass123

User should successfully login into the application

User is logged in

Pass

TC-02

User login – incorrect credentials

If credentials are incorrect, user should get an error message

  1. Go to the app

  2. Enter invalid User name

  3. Enter invalid Password

  4. Click Log-in button

Error message should appear on the screen

Error message appeared

Pass

Here’s the example of failed test cases:

Test Case ID

Test Name

Test Description

Pre-conditions

Test Steps

Test Data

Expected Results (Post-condition)

Actual Results

Status (Pass / Fail)

TC01

User_login

A user should be logged in to the app using the correct username and password

User should have correct login data

  1. Go to the app

  2. Enter User name

  3. Enter Password

  4. Click Log-in button

User name = id123 Password = pass123

User should successfully login into the application

User is unable to log in. The next screen doesn’t load.

Screen in the attachments.

Fail

If credentials are incorrect, user should get an error message

  1. Go to the app

  2. Enter invalid User name

  3. Enter invalid Password

  4. Click Log-in button

Error message should appear on the screen

Users logs in successfully despite the wrong input.

Screen in the attachment

Fail

Now that you know what a test case is, what it should contain, and what it looks like, let’s discuss the best practices for writing it.

Writing Test Cases – best practices

1. Stick to the template and make your test case easy to understand.

As in any type of written communication, a good test case should be easy to understand for the tester. He or she should be clear about what is being tested and how, as well as what exactly it is they are expected to do. So, a written test case should:

  • – Include a description of the feature to be tested (Test Description).

  • -Include the preparation necessary to ensure that the test can be conducted (Test Pre-conditions).

  • -Be broken down into a series of quick steps (Test Steps).

  • -Provide any relevant additional data (Test Data).

  • – Clearly state the expected result (Expected Result / Post-condition). It will allow the tester to decide if the test case has passed or failed.

Bear in mind that the IT industry has become more and more international and not all of the testers that will be performing the actual tests according to your test cases are native English speakers. So, make sure that the language you use in your test cases is clear, easy to understand, and does not allow for misinterpretation.

2. When writing your test case, keep the end-user perspective in mind.

Remember that there is a person – the end-user – at the end of each finished software development project. This user has certain experiences, requirements, hopes, habits, and ways of doing things. Keep them all in mind when writing your test cases. To be on the safe side, anticipate every possible combination of logic flow from the end-user. He or she may even want to attempt any kind of unconventional or random behavior.

So, do not make the mistake of expecting the end-user to be a person in any way similar to you. Keeping that perspective in mind will allow you to come up with test scenarios that are truly real-life-like and will increase the overall functionality of the software being tested.

test case screen

Test Cases view in Requirements and Test Management for Jira app

There are apps that help users to create complete tests which will serve the whole team later on. Requirements and Test Management for Jira extension guides you through test case creation step by step. The dedicated tabs: Details, Steps, and Relations allow making sure that all necessary information is provided. Inside the Details tab, there is a description field where it’s advisable to write the specific information about the software and particular test. The Preconditions section on the Steps tab needs to be filled with initial details. Under the list of preconditions, there is a table for Test Steps, already divided into all recommended sections such as Action, Input, Expected results, and the possibility of adding attachments.

3. Use correct naming conventions for all your test cases.

To help all the stakeholders to identify different test cases and track how particular requirements are met, use correct naming for your test cases. First of all, name the test as if you were describing your scenario to a non-programmer, e.g. a business analyst. Make each test case title unique and as descriptive as possible. Second, separate words by underscores to improve readability. Keep the test case name one sentence long but not longer than 40 characters. Third, have a well-known naming pattern for the entire project. If a test suite includes a number of similar tests, you can shorten their names, e.g. Login_with_empty_password _fails can be shortened to Empty_password, and Username_with_special_numbers_fails – to Invalid_username, etc.

There are many naming conventions used for software testing purposes these days and you are free to choose one that suits your needs best. But once you decide on it, make sure everyone in your organization is familiar with it, stick to it and be consistent throughout your entire software development process.

4. Make your test cases reusable and modular.

Do not write test cases that are exclusively dedicated to a single application. Doing so means that each and every time you want to test a new solution, you write your test cases from scratch. It is an uphill battle. Instead, make your test cases reusable. Remember that some features are simply similar across different pieces of software. So after some time, you will have your own repository of test cases created for testing a variety of products. Reusing them in your next software development project will save a lot of your time and effort, and will ensure that the agreed deadlines are met.

linked test steps rtm

Linking tests in RTM for Jira makes them reusable

Also, it is a good practice to make your test cases modular. Each one of them should be independent and have no influence over other test cases. Sticking to this rule will allow you to avoid dependency or conflict among them. Also, you will be able to duplicate particular test cases for future testing, as explained in the previous paragraph. But if for some reason some of your test cases need to be interdependent, you should clearly state it in the test case.

5. Make your test cases traceable.

Each and every test case – or group of test cases – you write should be traceable and linked to a specific Requirement. This will allow you to check if all functionality has been verified and if all the requirements have been fully covered. Also, it enables you to quickly test specific areas of the application whenever software fixes are applied. And if any requirement gets changed, then based on this mapping you will be able to do the impact analysis and change the affected test cases accordingly.

Making your test cases traceable is particularly important in the case of more complex applications developed by a bigger team. It brings order to your work and saves a lot of time and frustration. Test traceability not only makes your product owners’ life easier, allowing them to trace a particular test case to a specific Requirement, but it also allows for reporting problems and creating descriptive bug reports, giving your developers its full context.

But how to make test cases possible to track? There are a few ways of doing that and RTM for Jira app support the most popular two of them. The first one is through a dedicated report: Traceability Matrix, which makes it possible to track not only tests but all the other two-baselined testing objects.

traceability matrix in RTM for Jira

Traceability Matrix

The second one is the Relations tab. By clicking on the tab, a user is able to see all connections between the given object and other testing elements. Everything is linked and easy to spot – this gives all the stakeholders a possibility to keep up during the process and find any uncovered elements in a few seconds.

Conclusion

As you can see, writing a transparent test case is not as simple as it seems. Fortunately, if you stick to the above 5 best practices, you are on the fast track to success. Also bear in mind that it is a good practice to have your test cases reviewed by colleagues. It will allow you to maintain the same high level of test case writing throughout all of your software development projects.

If you would like to make your software testing process more efficient, we highly recommend trying out our dedicated Jira extension, Requirements & Test Management for Jira. Here you can learn more about what it does and sign up for a free, no-obligation 30-day trial.