How to write testcase for beginners – Concepts and types of test cases

Tram Ho

Software nouns are often confusing. Test case, test script, test scenario, test plan; They all sound the same. Whether you are an experienced or novice tester, it’s important to understand concepts to avoid confusion in software testing. That is why in this article, we will learn about “Test case”. So, what is test case in software testing industry?

1. Definition – What is test case in software testing?

At its simplest, a test case is a set of conditions and parameters below the definition of a tester to determine whether the software is functioning as required and functional.

A test case is a single unit of test that a tester performs. It guides how to follow each step to test. You can think of a test case as a set of step-by-step instructions to verify that something is right.

1.1 A test case usually contains:

  • Title
  • Describe
  • Test step
  • Expected result (Expected result)
  • Actual result (Actual result)

1.2 Who wrote test cases?

Typically, a member from the QA team will write a test case. Unit tests are not included here, written by the development team, but we will not refer to unit tests in this post. Make sure that everyone who is writing the test case has the writing skills, understands the purpose and value of the test case.

1.3 What is the value of it?

Test cases have a big thought in the testing phase. Writing test cases is an important step in the testing process. Writing test cases will help you through the details and make sure you have checked all the cases if possible

The value of test cases in the long run is that anyone can view and test it again using the test case. Test case is to support other members of the team in the future. In short, test cases will help us:

  • Definitely covering the whole system (the main functions will not be forgotten during the test).
  • Allow testers to think about problems in different ways to verify features.
  • Negative test cases are also saved for reference
  • They are reused in the future, anyone can view and run the test again

1.4 When to use test cases?

Test cases are used after the development ends a function or a set of functions. While waiting for development to complete, or right from the start, the tester can prepare a test case to run. The goal is to have a test case ready when the test begins.

When testing begins, the tester follows the test case or “script” they wrote to run the test and verify the software. A group of test cases is called a test suite.

1.5 Best practice while writing test cases

When writing test cases, think about this:

  • Keep the title short
  • Include a detailed description
  • Clear and concise
  • Include expected value

You will also want to try writing reusable test cases, so you can manage the tests and reuse them later.

While writing test cases can be a waste of your effort, it can also be valuable to the testing process and improve the quality of your software.

2. Types of test cases in software testing

2.1 Functionality Test Case

Functionality Test Case is used so that if an application interface operates with the interaction between the system and its users. Testing to determine success or failure of a software function is the expected value.

These cases are a type of black-box test, the requirements or user story of the software set for testing. This allows the test to be performed without having to access the underlying structure of the software being tested. The QA team usually writes functional test cases because it is a task in the normal QA process. They can be written and run early in development as the first function tested. To help direct development, they can be written in code, if all testers are required.

The above rules, they can be written and run before doing and they should be repeated whenever there are changes or additions.

For example: Confirm a user has successfully uploaded the avatar

2.2 User Interface Test Case

The user interface test case is used to verify special cases that are part of the GUI and expect it to work properly. This type of test case can be used to verify aesthetics, grammar and translation errors, links and any components that the user using the interface can see.

These cases are usually written by the testing team but the design team can also join because they are familiar with the interface. UI test cases are test cases in software testing that often use cross-browser testing. Different browsers render differently and the UI test case helps to make sure your application works properly through browsers.

These test cases will run once in the development phase upon completion.

For example: What happens when the website is displayed on a small phone screen? Did it break the UI?

2.3 Performance Test Cases

Performance test is performance test on response time and overall effectiveness of an application. That is, after taking an action, how long does it take the system to respond? Performance test cases should have a very clear set of criteria.

Test teams often write these test cases and they are usually checked automatically. A large application can have hundreds or thousands of performance tests. Automating these tests and running them often see situations in which the application is not working as expected.

Performance test cases help understand how the application will work in real life. These cases can be written when the test team has received a performance request from the product team.

For example: How long does it take the system to authenticate users and load the next page? When multiple people are logged in at the same time, is the application stable?

2.4 Integration Test Cases

Integration test cases are meant to determine how different modules interact with each other. The main purpose with integrated test cases is to ensure that the interface between the various modules works well.

The test team will determine which areas will undergo integration testing, while the development team will have input on how these test cases are written. Either of these teams can work to execute cases. They verify that the modules have worked individually, may also work together.

For example: Check the link between the [Home] page and the “favorites” section. When you add an item as a “favorites” section, from the home page, does it appear in the user’s favorites?

2.5 Usability Test Cases

Usability test cases can often be called “tasks” or “scenarios”. Instead of providing detailed step-by-step instructions to perform the test, the tester will present with a “scenarios” or “task” to complete.

Usability test cases help determine how users naturally approach and use the application. They help guide the tester through different situations and flows.

These test cases are usually prepared by the design team and the test team. Usability testing should be done before accepting testing.

For example, Can users successfully add more than one item to their cart? How was that experience?

2.6 Database Test Cases

The test cases for checking database testing are to check the flow of processing, the direction in the DB. The user interface is clean and everything seems to be working but where does all that data go?

To write these test cases, you need an in-depth understanding of the entire application, database tables, and stored procedures. Test teams will often use SQL queries to query database test cases.

Check the database used to verify that the developer wrote the code in the correct way to store and process the data.

For example, consider creating a user profile. When a user submits their profile, the following should be checked regarding the database.

  • Are all data stored in the database?
  • Were any data lost during the process?
  • If data is only partially performed, is it possible to save or not? X

2.7 Security Test Cases

Security test cases help ensure the application restricts actions and permissions whenever necessary. These test cases are written to protect data

Authentication and encryption are often the main focus in security test cases. The security team (if applicable) is usually responsible for writing and performing these tests.

For example: If the user reaches X number of login failures, is the account locked? Is the user able to upload data without logging in?

2.8 User Acceptance Test Cases

Accept testing tests, or UAT test cases, will help the test team test the user’s acceptance environment. These test cases must be broad, covering all areas of the application.

The purpose of these test cases is to not find errors (hopefully they have been found and fixed in previous tests), but to verify the application is acceptable to the user. So when they execute the test, are the results of that test and their experience acceptable?

When many other types of testing were done at the time UAT started, it did not focus too much on the level of detail, but went on the overall level. User acceptance test cases are used by end users or customers and are prepared by testing team or product manager. This is probably the most important testing phase as this is the final step before going into production.

For example: If testing for example, a photo management application for a photography studio, customers (users) should check if they can upload and manage photos in a way that suits their business needs. .

Finally

The case of the test case will depend on the type of test case written, you may need a more technical background or one of UX to write a good test case.

Each type of software testing requires different types of test cases. By examining the test case categories when you design your tests, you maximize the scope of your test and produce the product with more confidence.

Refer:

Share the news now

Source : Viblo