Top 10 tips for writing effective Test Cases

18
Top 10 Tips for Writing Effective Test Cases

Transcript of Top 10 tips for writing effective Test Cases

Page 1: Top 10 tips for writing effective Test Cases

Top 10 Tips for Writing Effective Test Cases

Page 2: Top 10 tips for writing effective Test Cases

www.kanoah.com

ABOUT US

Kanoah is an innovative company providing ground-breaking solutions to software testing professionals on the

Atlassian JIRA platform

Page 3: Top 10 tips for writing effective Test Cases

About Kanoah Tests

Kanoah Tests is a full featured test management, integrated seamless into JIRA with the same look-n-feel. No need to learn or switch between different applications

Coordinate all test management activities including test planning, authoring, execution, tracking and reporting from a central location

Kanoah Tests enables you to track testing progress and quality to foster collaboration and visibility across traditional and agile teams

Get real-time insights into your testing progress with out of the box reports

Easily integrate your automated tests and submit test results with Kanoah Tests’ powerful REST API or use the API to automate many areas of the application

Page 4: Top 10 tips for writing effective Test Cases

After looking for several years at plugins for test management we finally found Kanoah Tests. The other solutions were either too complex, didn't integrate well with Jira, or were focused on a single project. Kanoah Tests proved to be an elegant solution that allowed linking between any project. Kanoah has been very responsive to feedback, requests, suggestions as well bugs. The customer service is awesome. I'd highly recommend Kanoah Tests to teams of any size looking to simplify test management and consolidate tools.

Don Pierce

Robert Murhamer

Liked Kanoah from the moment I discovered it. Integrates nicely with JIRA and especially with Agile. Test cases can be authored right from the story level, but has all other functionality a Test Case Management solution would need to have, ranging from creating test plans, executing test cases, importing test cases, API for automation, a.s.o. Additionally the team at Kanoah is amazing and responding to any question very quickly. It wasn't hard to sell to my management to purchase Kanoah. Will highly recommend Kanoah to anybody.

Zour Brosh

I just start working with Kanoah and I am impressed how it's simple to manage tests without unlimited non-used features like in most of the test management tools and still to get the needed functionality and results. The integration with Jira is a great working solution that enable to share testing and development in simple way on one system. I recommend to use Kanoah for testing management. It will help to do Kanoah as much as possible customizable like Jira to match each group methodology

For more reviews, visit: https://marketplace.atlassian.com/plugins/com.kanoah.test-manager/server/reviews

Reviews

Page 5: Top 10 tips for writing effective Test Cases

Key Features

Native seamless integration with JIRA

No need to learn or switch between different applications

Perfect for agile & traditional testing approaches

Manage, organize and track all your testing efforts in a central place

Reuse test cases across your projects

Powerful REST API

Establish clear traceability between requirements, test cases, and defects

Execute test cases and track results that matter

Get real-time insights into your testing progress with out of the box reports

Live statistics accessible to your entire team

Page 6: Top 10 tips for writing effective Test Cases

Benefits for the testers

No need to lear or switch between different applications

Reuse test cases across projects for regression

Link test cases to requirements and defects

API support for automated efforts

Benefits for the teams

Informed decisions based on real-time insights

End-to-end traceability and impact analysis

Centralized Test Management

Save time and increase productivity

Page 7: Top 10 tips for writing effective Test Cases

Why choose Kanoah Tests

Coordinate all test management activities right inside JIRA

1 Testing right inside JIRA

Take advantage of the built-in reports to track the results and measure progress

2Make informed decisions

Kanoah Tests users receive priority support, even during trials

3Stelar support

Page 8: Top 10 tips for writing effective Test Cases

Top 10 Tips for Writing Effective Test Cases

Page 9: Top 10 tips for writing effective Test Cases

What is a Test Case?

A test case, is a set of conditions under which a tester will determine whether an application, software system or one of its features is working as it was originally established for it to do.

Written test cases should include a description of the functionality to be tested, and the preparation required to ensure that the test can be conducted.

A formal written test-case is characterized by a known input and by an expected output, which is worked out before the test is executed. The known input should test a precondition and the expected output should test a postcondition. [1]

Page 10: Top 10 tips for writing effective Test Cases

How to write effective Test Cases?

Before start writing tests, it is necessary to determine the purpose of testing, define verifiable requirements and identify logical sets of test scenarios based on user roles, features, etc.

Applications need to be studied in-depth before designing test cases and testers have to analyze the test objectives thoroughly before writing the test cases.

The basic objective of writing a test case is to provide the testing procedure for the particular application and maximize the verification of code with minimum complexity. [2]

Page 11: Top 10 tips for writing effective Test Cases

How to write effective Test Cases?

Get a thorough knowledge of the application: Before beginning to write test cases, gather enough information about the application by means of available documents like requirement specifications, use cases, tutorials or by using the application itself. Find out how the users intend to use the application, list down the several features and find out about the domain where it’s used.

Select a strategy for test case writing: Different features of the application may require different approaches to writing the test cases. Organize your test cases according to the features and select the appropriate method. You might also want to differentiate the test cases based on the different user roles; sometimes a combination of approaches helps write test cases for complex applications. Make sure that the entire flow of the application is covered by your test cases. [2]

Page 12: Top 10 tips for writing effective Test Cases

Appropriate Format

Test case name / ID.

Description – unit under test.

Prerequisites – Assumptions that must be made.

Test data – the variables and their values.

Steps to be followed.

Expected results – clearly state the expected outcome of the test.

Actual results – record the actual results observed.

Status – Pass / Fail.

Comments. [2]

Page 13: Top 10 tips for writing effective Test Cases

Top 10 Tips for Writing Effective Test Cases

The following ranking has been put together by gathering the most relevant information from [3] [4] [5] [6] [7].

1. Identify The Scope And Purpose Of Testing: Identify the testable requirements. You need to understand the purpose of testing & you must understand the features and user requirements.

2. Test Case Description: Description is where you mention all the details about what you are going to test, and the particular behavior being verified by the test. A well-written Test Case clearly mentions the expected result of the application or system under test. Each test design step should clearly mention what you expect as outcome of that verification step.

3. Assumptions and Preconditions: While writing test cases, you should communicate all assumptions that apply to a test, along with any preconditions that must be met before the test can be executed.

Page 14: Top 10 tips for writing effective Test Cases

Top 10 Tips for Writing Effective Test Cases

4. Write a test case for every condition: some developers translates “one test case for every condition” to “one test case for assertion”, that’s just plain wrong, a condition can contain one or more assertions,.When you are picking the condition to test, it is also a good idea to focus on the boundaries of your system, so if you are testing a range, try testing with the last element of your range, the first element.

5. Positive And Negative Test Cases: While writing test cases few test case design methods should be used like equivalence classes portioning, boundary value analysis, normal and abnormal conditions. You should also consider negative testing, failure conditions and error handling which could help to discover most probable defects in the code. Don’t assume any functionality, write the test cases with reference to requirement specification document.

6. Legible & Easily Understandable: Imagine a scenario where the person who wrote all those Test Cases leaves for some reason and you have a completely new team to work on the Test Case execution, the entire effort spent during the design phase could go down the drain.

Page 15: Top 10 tips for writing effective Test Cases

Top 10 Tips for Writing Effective Test Cases

7. Maintenance and Reusability: You should write test cases keeping in mind that they could be re-used in the future for some other project/teams. It’s of umpteen importance to make sure that the Test Cases are always updated as per the newly introduced changes in the application they apply to.

8. Structuring of Test Cases: Tests in a suite should be independent, but, at the same time, grouped by a common idea. Moreover, test cases should be transparent, atomic and easy to understand.

9. Test Data Input: To make your life easy as a tester (and your fellow-testers!), wherever applicable, you can give Test Data to be used for the Test Case within the test case description or with the specific Test Case step. This saves a lot of time in the long run as you won’t have to hunt a new test data every time you need to execute the test.

Page 16: Top 10 tips for writing effective Test Cases

Top 10 Tips for Writing Effective Test Cases

10. Test only one thing: If you don’t write your tests to only test one thing, you may find the following problems.

Over complicated tests. Tests which are difficult to understand.

Overlapping tests. Different tests testing the same functionality, this will carry a lot of overhead when you will have to maintain them.

Low code coverage. Is easier to have higher code coverage if you write simple test cases for all the elements of your code.

Difficulty to track an error. When your test cases fail, ideally it should be pretty straight forward to tell where they are failing. When you are testing several things in every test case is hard to tell what the source of the errors is.

To test only one thing is sometimes hard because of the dependencies in your system. You may want to write a test case for a class that indirectly uses a database, or a third class, in this case, the best solution is to use a mock, stub or a fake object.

Page 17: Top 10 tips for writing effective Test Cases

References

[1] https://en.wikipedia.org/wiki/Test_case

[2] https://blog.udemy.com/how-to-write-test-cases/

[3] http://quicksoftwaretesting.com/test-case-writing-tips/

[4] http://www.makinggoodsoftware.com/2009/08/25/how-to-write-a-good-test-case5-tips-to-write-better-test-cases/

[5] http://www.softwaretestingclass.com/how-to-write-good-test-cases/

[6] http://sysgears.com/articles/the-art-of-writing-effective-and-transparent-test-cases/

[7] http://www.testandtry.com/2010/02/24/8-tips-to-create-complete-test-cases/