Saturday, August 23, 2008

What is Testcase & How to create Testcase

Topics:
  • What is a test case?
  • How to create a good test case? Example...

Q:What is Test case?

Ans:Test cases is a sequence of steps to test the correct behavior of a functionality/feature of an application A test case should have an input description, Test Sequence and an Expected Behaviour. ex., Test Sequence: Schedule a report [ This can be treated as a Title as well as Test Sequence. Sequence here is the order in which this step is to be executed. The test case document should be prepared in such a way that the test cases should follow a sequence]

Test Input Description: 1.Login to as administrator. 2. Go to Reports page 3. Click on the ‘Schedule reports' button 4. Add reports 5. Update Expected Results: The report schedule should get added to the report schedule table. Provisioning status of the reports should get handled

How to create a good test case? Example...we will derive test cases using Patient System..... :)

Patient System consist Calculate Payment application, applications include a graphical user interface. The system is based on a multi-user database.

Figure 1
Requirement 1: Patient Type
User is able to choose patient type (male, female, child)

Requirement 2: Patient age
User is able to enter patient age as a positive integer value.

Requirement 3: Payment
Payment is calculated based on age and type of the patient. The result will be displayed on the screen.
Equivalence Partitioning :All input fields in the application must be tested. However, the system cannot be tested with all possible inputs because it requires too much time and work. The set of input values for the system must be partitioned for example by using a test case selection like equivalence partitioning.For each input parameter we can derive equivalence classes from requirements specification. Each equivalence class should represent a main processing path of input values through the system. Test cases should also be created for boundary values, special characters and decimal values. The system should give for user warnings of illegal inputs (Error Messages). The following example shows how equivalence classes and test cases can be created for a simple application that calculates patient payments (Figure 2). At first the user of this application chooses patient type in checkboxes (Male, Female, Child). Checkboxes cannot be left empty which reduces the possibility to give incorrect input values (default value is Male). Age should be given as whole years (positive integer). By pressing Calculate button application calculates the payment based on information about the patient type and age.
Figure 2 (User has filled data fields in Calculate Payment application)
Equivalence classes for Calculate Payment application
There are two input parameters that user can enter in Calculate Payment
application: patient type and age.
Patient Type
· Male
· Female
· Child
Age
· < 0 (invalid)
· 0-17 (valid)
· 18-35 (valid)
· 36-50 (valid)
· 51-145 (valid)
· > 145 (invalid)
· not integer (illegal)
Test Cases for Calculate Payment Application
Following tables consist of designed test cases. Three first columns include input values that user has given to the system. The last column Expected results shows the end state or message from the system. Expected results are derived from Requirements Specification. If a user has entered an invalid input value (for example negative values), the system returns an error message.


TestCases:

This Post may help What is Testcase & how to create testcases .... :) For more information mail to testingblog4u@gmail.com















No comments:

Performance Testing News:

Loadrunner v12:
- Targeting an April 2012 Development release. Not sure when it will be available for public.
- Customers can participate in the beta program after legal procedures are completed.
- Availability of LR Mobile protocol. Performance testing for mobile (both web browser based as well as native mobile device) – Supports HP Palm Pre, iPhone (3GS, 4), Android, Blackberry phones and many other actual mobile devices.
- Support for Windows7, TruClient IE9.
- VUGen will be completely redesigned and new IDE (called Sharp Develop) will be built.

Performance Testing,Monitoing & Analysis Useful Documents

Download Performance Testing,Monitoing & Analysis Useful Documents


Loadrunner

Design scenario - Download

Record & Replay Issues with VUGen - Download

LR8.1 Protocol Footprint - Download

Monitoring & Analysis

HP Performance monitoring best practice - Download

Others

Load test plan - Download