03 TestCase Development
For a newbie, its easy to assume that Testing is executing various section of code ,on a ad-hoc basis and verifying the results. But in real world, Testing is a very formal activity, and is documented in detail.
The degree of formality depends on the type of application under test , standards followed by your organization ,& maturity of development process.
<div style="position:relative;height:0;padding-bottom:60.94%"><iframe src="https://www.youtube.com/embed/rFMq5bUz7bk?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="591" height="360" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
Resources
1) Refer this guide to download QTP. Flight Reservation comes bundled with thisapplication
2) Refer this tutorial on Flight Reservation for a beginner's introduction to the application.
A Test Scenario is any functionality that can be tested. It is also called Test Condition or Test Possibility. As a tester, you may put yourself in the end user’s shoes and figure out the real-world scenarios and use cases of the Application Under Test.
Scenario Testing is a variant of Software Testing where Scenarios are Used for Testing. Scenarios help in an Easier Way of Testing of the more complicated Systems
Let’s study this with the help of the video below -
Test Scenarios are created for following reasons,
Test Scenarios may not be created when
As a tester, you can follow these five steps to create Test Scenarios-
For the Flight Reservation Application, a few test scenarios would be
Test Scenario 1: Check the Login Functionality
Test Scenario 2: Check that a New Order can be created
Test Scenario 3: Check that an existing Order can be opened
Test Scenario 4: Check that a user, can FAX an order
Test Scenario 5: Check that the information displayed in the HELP section is correct
Test Scenario 6: Check that the information displayed in About section, like version, programmer name, copy right information is correct
Apart from these six scenarios here is the list of all other scenarios
Next, we have already learned exhaustive testing is not possible. Suppose you have time only to execute 4 out of these 6 scenarios which two low priority scenarios of these six will you eliminate. Think, your time starts now
I am sure most of you would have guessed scenarios 5 & 6 since they are not the core functionality of the application. This is nothing but Test Prioritization.
Test Scenario 1: Check the Login and Authentication Functionality
Test Scenario 2: Check Money Transfer can be done
Test Scenario 3: Check Account Statement can be viewed
Test Scenario 4: Check Fixed Deposit/Recurring Deposit can be created
And so on…
A Test Case is a set of actions executed to verify a particular feature or functionality of your software application.
This tutorial describes test case designing and the importance of its various components.
Now, consider the Test Scenario Check Login Functionality there many possible cases like
Test Case 1: Check results on entering valid User Id & Password
Test Case 2: Check results on entering Invalid User ID & Password
Test Case 3: Check response when User ID is Empty & Login Button is pressed, and many more
This is nothing but Test Case. Test scenarios are rather vague and cover a wide range of possibilities. Testing is all about being very specific.Hence, we need Test Cases
Below is format of a standard login Test case
Test Case ID | Test Scenario | Test Steps | Test Data | Expected Results | Actual Results | Pass/Fail |
---|---|---|---|---|---|---|
TU01 | Check Customer Login with valid Data |
|
Userid = guru99 Password = pass99 | User should Login into application | As Expected | Pass |
TU02 | Check Customer Login with invalid Data |
|
Userid = guru99 Password = glass99 | User should not Login into application | As Expected | Pass |
While drafting a test case do include the following information
1. Test Cases need to be simple and transparent:
Create test cases that are as simple as possible. They must be clear and concise as the author of test case may not execute them.
Use assertive language like go to home page, enter data, click on this and so on. This makes the understanding the test steps easy and test execution faster.
2. Create Test Case with End User in Mind
Ultimate goal of any software project is to create test cases that meets customer requirements and is easy to use and operate. A tester must create test cases keeping in mind the end user perspective
3. Avoid test case repetition.
Do not repeat test cases. If a test case is needed for executing some other test case, call the test case by its test case id in the pre-condition column
4. Do not Assume
Do not assume functionality and features of your software application while preparing test case. Stick to the Specification Documents.
5. Ensure 100% Coverage
Make sure you write test cases to check all software requirements mentioned in the specification document. UseTraceability Matrix to ensure no functions/conditions is left untested.
6. Test Cases must be identifiable.
Name the test case id such that they are identified easily while tracking defects or identifying a software requirement at a later stage.
7. Implement Testing Techniques
It's not possible to check every possible condition in your software application. Testing techniques help you select a few test cases with the maximum possibility of finding a defect.
Boundary Value Analysis (BVA): As the name suggests it's the technique that defines the testing of boundaries for specified range of values.
Equivalence Partition (EP): This technique partitions the range into equal parts/groups that tend to have the same behavior.
State Transition Technique: This method is used when software behavior changes from one state to another following particular action.
Error Guessing Technique: This is guessing/anticipating the error that may arise while testing.This is not a formal method and takes advantages of a tester's experience with the application
8. Self cleaning
The test case you create must return the Test Environment to the pre-test state and should not render the test environment unusable. This is especially true for configuration testing.
9. Repeatable and self-standing
The test case should generate the same results every time no matter who tests it
10. Peer Review.
After creating test cases, get them reviewed by your colleagues. Your peers can uncover defects in your test case design, which you may easily miss.
Test management tools are the automation tools that help to manage and maintain the Test Cases. Main Features of a test case management tool are
Popular Test Management tools are : Quality Center and JIRA
Sample Test Case in Excel
Test Case ID | BU_001 | Test Case Description | Test the Login Functionality in Banking | |||||||
Created By | Mark | Reviewed By | Bill | Version | 2.1 | |||||
QA Tester’s Log | Review comments from Bill incorprate in version 2.1 | |||||||||
Tester's Name | Mark | Date Tested | 1-Jan-2017 | Test Case (Pass/Fail/Not Executed) | Pass | |||||
S # | Prerequisites: | S # | Test Data | |||||||
1 | Access to Chrome Browser | 1 | Userid = mg12345 | |||||||
2 | 2 | Pass = df12@434c | ||||||||
3 | 3 | |||||||||
4 | 4 | |||||||||
Test Scenario | Verify on entering valid userid and password, the customer can login | |||||||||
Step # | Step Details | Expected Results | Actual Results | Pass / Fail / Not executed / Suspended | ||||||
1 | Navigate to http://demo.guru99.com | Site should open | As Expected | Pass | ||||||
2 | Enter Userid & Password | Credential can be entered | As Expected | Pass | ||||||
3 | Click Submit | Cutomer is logged in | As Expected | Pass | ||||||
4 | ||||||||||
Test Basis is defined as the source for creation of test Cases. It can be the Application itself or the requirement documents like SRS (Software Requirement Specification), BRS (Business Requirement Specification), etc.
This tutorial explains "Test-Basis". with the help of a case study
Consider a scenario, where the client sends a request to add a functionality to Flight Reservation to allow sending an order via email.
He also specifies the GUI fields and buttons he wants.
Even though, the application is yet to be developed, try and develop a few test cases for this requirement.
A few test cases among the many you could have thought of are listed below
You may have also realized that to create test cases you need to look at something to base your test. This is nothing but Test Basis. This test basis could be the actual Application Under Test (AUT), or maybe even by experience but most of the times, like, in this case, would be based on documents.
In fact, this is what happens during the different phases of V- Model.
Where test plans are created using the corresponding documents, and once the code is ready, it is ready for testing.
A Traceability Matrix is a document that co-relates any two-baseline documents that require a many-to-many relationship to check the completeness of the relationship.
It is used to track the requirements and to check the current project requirements are met.
Requirement Traceability Matrix or RTM captures all requirements proposed by the client or software development team and their traceability in a single document delivered at the conclusion of the life-cycle.
In other words, it is a document that maps and traces user requirement with test cases. The main purpose of Requirement Traceability Matrix is to see that all test cases are covered so that no functionality should miss while doing Software testing.
Requirement Traceability Matrix – Parameters include
Let's understand the concept of Requirement Traceability Matrix through a Guru99 banking project.
On the basis of Business Requirement Document (BRD) and Technical Requirement Document (TRD), testers start writing test cases.
Let suppose, the following table is our Business Requirement Document or BRD for Guru99 banking project.
Here the scenario is that the customer should be able to login to Guru99 banking website with the correct password and user#id while manager should be able to login to the website through customer login page.
While the below table is our Technical Requirement Document (TRD).
Note: QA teams do not document the BRD and TRD. Also some companies use Function Requirement Documents (FRD) which are similar to Technical Requirement Document but the process of creating Traceability Matrix remains the same.
Let's Go Ahead and create RTM Testing
Step 1: Our Test Case is
"Verify Login, when correct ID and Password is entered, it should login successfully"
Step 2: Identify the Technical Requirement that this test case is verifying. For our test case, the technical requirement is T94 is being verified.
Step 3: Note this Technical Requirement (T94) in the Test Case.
Step 4: Identify the Business Requirement for which this TR (Technical Requirement-T94) is defined
Step 5: Note the BR (Business Requirement) in Test Case
Step 6: Do above for all Test Cases. Later Extract the First 3 Columns from your Test Suite. RTM in testing is Ready!
Everybody knows that testing is a process that produces and consumes large amounts of data. Data used in testing describes the initial conditions for a test and represents the medium through which the tester influences the software. It is a crucial part of mostFunctional Testing. But what actually is the test data? Why is it used? Maybe you would wonder ‘Designing Test cases is challenging enough, then why bother about something as trivial as Test Data’ The purpose of this tutorial is to introduce you to Test Data, its importance and give practical tips and tricks to generate test data quickly. So, Let's Begin!
Test data is actually the input given to a software program. It represents data that affects or is affected by the execution of the specific module. Some data may be used for positive testing, typically to verify that a given set of input to a given function produces an expected result. Other data may be used for negative testing to test the ability of the program to handle unusual, extreme, exceptional, or unexpected input. Poorly designed testing data may not test all possible test scenarios which will hamper the quality of the software.
Depending on your testing environment you may need to CREATE Test Data (Most of the times) or atleast identify a suitable test data for your test cases (is the test data is already created).
Typically test data is created in-sync with the test case it is intended to be used for.
Test Data can be Generated -
Typically sample data should be generated before you begin test execution because it is difficult to perform test data management. Since in many testing environments creating test data takes many pre-steps or test environment configurations which is very time consuming. Also If test data generation is done while you are in test execution phase you may exceed your testing deadline.
Below are described several testing types together with some suggestions regarding their testing data needs.
In White Box Testing, test data is derived from direct examination of the code to be tested. Test data may be selected by taking into account the following things:
Performance Testing is the type of testing which is performed in order to determine how fast system responds under a particular workload. The goal of this type of testing is not to find bugs, but to eliminate bottlenecks. An important aspect of Performance Testing is that the set of sample data used must be very close to 'real' or 'live' data which is used on production. The following question arises: ‘Ok, it’s good to test with real data, but how do I obtain this data?’ The answer is pretty straightforward: from the people who know the best – the customers. They may be able to provide some data they already have or, if they don’t have an existing set of data, they may help you by giving feedback regarding how the real-world data might look like. In case you are in a maintenance testing project you could copy data from the production environment into the testing bed. It is a good practice to anonymize (scramble) sensitive customer data like Social Security Number, Credit Card Numbers, Bank Details etc. while the copy is made.
Security Testing is the process that determines if an information system protects data from malicious intent. The set of data that need to be designed in order to fully test a software security must cover the following topics:
In Black Box Testing the code is not visible to the tester . Your functional test cases can have test data meeting following criteria -
Note: Depending on the software application to be tested, you may use some or all of the above test data creation
In order to generate various sets of data, you can use a gamut of automated test data generation tools. Below are some examples of such tools:
Test Data Generator by GSApps can be used for creating intelligent data in almost any database or text file. It enables users to:
Test Data generator by DTM, is a fully customizable utility that generates data, tables (views, procedures etc) for database testing (performance testing, QA testing, load testing or usability testing) purposes.
Datatect is a SQL data generator by Banner Software, generates a variety of realistic test data in ASCII flat files or directly generates test data for RDBMS including Oracle, Sybase, SQL Server, and Informi.
In conclusion, well-designed testing data allows you to identify and correct serious flaws in functionality. Choice of test data selected must be reevaluated in every phase of a multi-phase product development cycle. So, always keep an eye on it.
A good Test Case template maintains test artifact consistency for the test team and makes it easy for all stakeholders to understand the test cases. Writing test case in a standard format lessen the test effort and the error rate. Test cases format are more desirable in case if you are reviewing test case from experts.
The template chosen for your project depends on your test policy. Many organizations create test cases in Microsoft Excel while some in Microsoft Word. Some even use test management tools like HP ALM to document their test cases.
Irrespective of the test case documentation method chosen, any good test case template must have the following fields
Test Case Field | Description |
---|---|
Test case ID: |
|
Test Priority: |
|
Name of the Module: |
|
Test Designed by: |
|
Date of test designed: |
|
Test Executed by: |
|
Date of the Test Execution: |
|
Name or Test Title: |
|
Description/Summary of Test: |
|
Pre-condition: |
|
Dependencies: |
|
Test Steps: |
|
Test Data: |
|
Expected Results: |
|
Post-Condition: |
|
Actual Result: |
|
Status (Fail/Pass): |
|
Notes: |
|
Optionally you can have the following fields depending on the project requirements