Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumSoftware Testing @ OneStopTestingTest Cases @ OneStopTesting

Message Icon Topic: Pattern Sequence test cases using test scripts

Post Reply Post New Topic
Author Message
Preeti
Newbie
Newbie


Joined: 22Feb2007
Online Status: Offline
Posts: 1
Quote Preeti Replybullet Topic: Pattern Sequence test cases using test scripts
    Posted: 22Feb2007 at 6:02pm
Problem:
There is a need to specify sets of test cases that together achieve some specific testing requirement. At times these test cases must be executed in a specific sequence in order to achieve that goal.

Context:
An individual test case presents a single stimulus to the Object Under Test (OUT). A particular test case may operate properly but leave the OUT in a state in which further stimuli will not be handled properly. An object can only be considered correct when it has been tested over its complete life cycle. That is, after an object has received a set of messages that has thoroughly exercised all of its intended actions, often denoted as all paths through the state model of the object.

Forces:
  • automation of test cases- Application of test cases can be partially automated by grouping in a single test method several test case messages.
  • interaction of messages- Method interaction can be tested by execution of multiple test cases on a single OUT rather than beginning each new test with a fresh object. These actions could be programmed as a single method rather than calling the other, existing, methods.

Solution:
Create test methods that serve as scripts for invoking multiple test cases. The public interface of each test class contains only test scripts that the tester may invoke. The test case methods are protected from direct access. Each test script creates an OUT and so any test cases executed within the test script are stimuli to that single OUT.

Some standard scripts that are created are the baseline test script, Create a baseline test script, and functional, structural and interaction test scripts that ensure that the OUT is tested to specified coverage criteria. For projects with specific performance criteria, there would be a performance suite that concentrates on defining specific types of loads on the system.

Structure:
A test script is simply a method, but one that has responsibility for creating the OUT, applying the test cases and then deleting the object under test.

void SimpTest::test_script9()
{
OUT = new CUT;
*ostr << "Start an interaction of test cases 4 and 6" << endl;
if (test_case4() && test_case6())
*ostr << "Interaction test case completed successfully" << endl;
else
*ostr << "Interaction test case completed unsuccessfully" << endl;
delete OUT;
}

Participants:
The CUT and the associated test class are the primary participants. Methods in the test class either present a single stimulus to the OUT or multiple stimuli.

Applicability:
Use the sequence test cases by using test scripts pattern for tests that can be composed from other, simpler, tests or when a test is investigating the effects of multiple messages on a single OUT.

Benefits:
  • Test scripts provide a means of using multiple test cases to build and test more complex interactions.
  • Various types of standard test coverages such as functional and structural, required for the HIT analysis, can be achieved by aggregating test cases by use of test scripts.

Risks:
Incorrect sequencing of test cases in scripts can result in misinterpreted test results.

Resulting Context:
This compositional organization of test cases results in an increased ease of automation of executing tests.

Patterns Referenced:
Pattern Test a method in the Context of a class



Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting