03 TestCase Development
Posted by Superadmin on May 01 2018 10:28:30

 

03 TestCase Development

 

Introduction to Test Formality

 

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.

 

What is Test Scenario?

 

 

What is a Test Scenario?

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.

What is Scenario Testing?

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 -

 

Why create Test Scenarios?

Test Scenarios are created for following reasons,

When not create Test Scenario?

Test Scenarios may not be created when

How to create a Test Scenario

As a tester, you can follow these five steps to create Test Scenarios-

Tips to Create Test Scenarios

Example 1: Test Scenario for Flight Reservation

For the Flight Reservation Application, a few test scenarios would be

Test Scenario 1: Check the Login Functionality

 

What is Test Scenario?

Test Scenario 2: Check that a New Order can be created 

What is Test Scenario?

Test Scenario 3: Check that an existing Order can be opened 

What is Test Scenario?

Test Scenario 4: Check that a user, can FAX an order

 


What is Test Scenario?

Test Scenario 5: Check that the information displayed in the HELP section is correct 

What is Test Scenario?

Test Scenario 6: Check that the information displayed in About section, like version, programmer name, copy right information is correct

 

What is Test Scenario?

 

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.

 

 

Example 2:  Test Scenarios for a Banking Site

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…

 

 

 

How to Write Test Cases: Sample Template with Examples

 

What is Test Case?

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

 

 

Please be patient. The Video will load in some time. If you still face issue viewing video click here

Video Transcript

Format of Standard Test Cases

Below is format of a standard login Test case

Test Case IDTest ScenarioTest StepsTest DataExpected ResultsActual ResultsPass/Fail
TU01 Check Customer Login with valid Data
  1. Go to site http://demo.guru99.com
  2. Enter UserId
  3. Enter Password
  4. Click Submit
Userid = guru99 Password = pass99 User should Login into application As Expected Pass
TU02 Check Customer Login with invalid Data
  1. Go to site http://demo.guru99.com
  2. Enter UserId
  3. Enter Password
  4. Click Submit
Userid = guru99 Password = glass99 User should not Login into application As Expected Pass

While drafting a test case do include the following information

Best Practice for writing good Test Case Example.

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 Case Management Tools

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

  1. For documenting Test Cases: With tools you can expedite Test Case creation with use of templates
  2. Execute the Test Case and Record the results: Test Case can be executed through the tools and results obtained can be easily recorded.
  3. Automate the Defect Tracking: Failed tests are automatically linked to the bug tracker , which in turn can be assigned to the developers and can be tracked by email notifications.
  4. Traceability: Requirements, Test cases, Execution of Test cases are all interlinked through the tools, and each case can be traced to each other to check test coverage.
  5. Protecting Test Cases: Test cases should be reusable and should be protected from being lost or corrupted due to poor version control. Test Case Management Tools offer features like

 

Popular Test Management tools are : Quality Center and JIRA

Resources

 

 

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        
         
         

 

 

 

 

 

What is Test Basis in Software Testing?

 

 

 

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.

 

 

 

 

What is Test Basis in Software Testing?.

Where test plans are created using the corresponding documents, and once the code is ready, it is ready for testing.

 

 

Please be patient. The Video will load in some time. If you still face issue viewing video click here

 

 

How to Create Requirements Traceability Matrix (RTM)

 

 

What is Traceability Matrix?(TM)

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.

What is RTM (Requirement Traceability Matrix)?

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

Types of Traceability Test Matrix

How to create Requirement Traceability Matrix

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.

How to Create Requirements Traceability Matrix (RTM)

While the below table is our Technical Requirement Document (TRD).

How to Create Requirements Traceability Matrix (RTM)

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"

How to Create Requirements Traceability Matrix (RTM)

 

Step 2: Identify the Technical Requirement that this test case is verifying. For our test case, the technical requirement is T94 is being verified.

How to Create Requirements Traceability Matrix (RTM)

 

Step 3: Note this Technical Requirement (T94) in the Test Case.

How to Create Requirements Traceability Matrix (RTM)

 

Step 4: Identify the Business Requirement for which this TR (Technical Requirement-T94) is defined

How to Create Requirements Traceability Matrix (RTM)

 

Step 5: Note the BR (Business Requirement) in Test Case

 

How to Create Requirements Traceability Matrix (RTM)

Step 6: Do above for all Test Cases. Later Extract the First 3 Columns from your Test Suite. RTM in testing is Ready!

How to Create Requirements Traceability Matrix (RTM)

Advantage of Requirement Traceability Matrix

Let's learn RTM with a example in the Video

 

 

Please be patient. The Video will load in some time. If you still face issue viewing video click here

 

 

Tips and Tricks to Generate Test Data

 

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!

What is Test Data? Why is it Important?

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. 

Tips and Tricks to Generate Test Data

What is Test Data Generation? Why test data should be created before test execution?

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.

Test Data for White Box Testing

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:

 

Test Data for Performance Testing

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.

Test Data for Security Testing

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:

 

Test Data for Black Box Testing

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

 

Automated Test Data Generation

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.

 

 

 

Download Sample Test Case Template with Explanation of Important Fields

 

 

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 FieldDescription
Test case ID:
  • Each test case should be represented by a unique ID. To indicate test types follow some convention like "TC_UI_1" indicating "User Interface Test Case#1."
Test Priority:
  • It is useful while executing the test.
    • Low
    • Medium
    • High
Name of the Module:
  • Determine the name of the main module or sub-module being tested
Test Designed by:
  • Tester's Name
Date of test designed:
  • Date when test was designed
Test Executed by:
  • Who executed the test- tester
Date of the Test Execution:
  • Date when test needs to be executed
Name or Test Title:
  • Title of the test case
Description/Summary of Test:
  • Determine the summary or test purpose in brief
Pre-condition:
  • Any requirement that needs to be done before execution of this test case. To execute this test case list all pre-conditions
Dependencies:
  • Determine any dependencies on test requirements or other test cases
Test Steps:
  • Mention all the test steps in detail and write in the order in which it requires to be executed. While writing test steps ensure that you provide as much detail as you can
Test Data:
  • Use of test data as an input for the test case. Deliver different data sets with precise values to be used as an input
Expected Results:
  • Mention the expected result including error or message that should appear on screen
Post-Condition:
  • What would be the state of the system after running the test case?
Actual Result:
  • After test execution, actual test result should be filled
Status (Fail/Pass):
  • Mark this field as failed, if actual result is not as per the estimated result
Notes:
  • If there are some special condition which is left in above field

Optionally you can have the following fields depending on the project requirements