Test Design Techniques

Test Design Techniques

Test Design Techniques
 

A test design technique is basically a process for selecting test cases. It helps us to select a good set of tests from the total number of all possible tests for a given system.

Overview


We use test design techniques to identify test conditions and test cases through which effective and efficient test cases can be written. It is the best approach rather the test cases picking out of the air. These test design techniques helps us achieving high test coverage and defining tests that will provide insight into the quality of the test object. These techniques are complementary and may be used as appropriate for any given test activity, regardless of which level of testing is being performed. These techniques could be employed by Test Analysts and Technical Test Analysts.

Types of Test Design Techniques
 

Test Design Techniques are divided in to two categories:
 

I.    Static testing technique.
 

II.    Dynamic testing technique.

I. Static testing technique:
 

Static testing is a kind of software testing methodology in which the software is tested manually or with a set of tools, but they are not executed. There are some methodologies available by which static testing can be made automatic. This testing checks for the correctness of the program or source code, document, and algorithm. Basically the syntax of the program is checked in static testing.
Static testing techniques are further divided into Informal Reviews, Technical Reviews, Walkthroughs, and Inspections.

II. Dynamic testing technique:
 

Dynamic Testing is used to test the application or software at the time of execution, which is done during validation process. The dynamic techniques are subdivided into three more categories. They are as follows:
1.    Specification-based (black-box, also known as behavioral techniques) techniques.
2.    Structure-based (white-box or structural techniques) techniques.
3.    Experience-based techniques.

1. Specification-based techniques (black-box, also known as behavioral techniques):
 

Specification-based testing is discovering what claims are made in the specifications and testing the product against them. It is also known as black-box or input/output driven testing techniques. Specification-based test techniques are based upon the test conditions and test cases derived from the SRS documents. Functional testing is concerned with what the system does its features or functions. Non-functional testing is concerned with examining how well the system does.
 

The Black-box testing techniques are as follows:

a.    Equivalence partitioning.
b.    Boundary value analysis.
c.    Decision tables.
d.    State transition testing.
e.    Use case Testing.


a. Equivalence partitioning: 


Equivalence partitioning is a method for deriving sub sets from main sets. Equivalence partitions can be found for both valid data (values that should be accepted) and invalid data (values that should be rejected). Equivalence partitioning is applicable at all levels of testing.

Example: We have to test ATM machine for withdrawal transaction. The person can withdraw the money minimum 500 and maximum 20000. In this case you could check 100, 200, 300 up to 20000, but here the testing activity eating the time.
Sol:
Input range is 500 to 20000

In this scenario we could not test every data. Like 500, 600, 700 up to 20000. It is not possible so we can use equivalence partitioning.

We can divide as sub groups like
500 -1000}
{1100 - 2000}
2100 - 3000}
.
.
19100 - 20000}
From each we can pick any test data randomly and use for testing. In the first set you can pick 500, 2nd set as 1500, 3rd set as 3000 and so on.

b. Boundary value analysis: 


Boundary value analysis is used to find the error in the boundary area. Boundary values include maximum, minimum, just inside boundaries, just outside boundaries, typical values, and error values. It is relatively easy to apply and its defect-finding capability is high. Boundary value analysis can be applied at all test levels.

Example: A user ID text box has to accept alphabet characters (a-z) with length of 5 to 10 characters.
Sol: BVA is done like this, max value: 10 pass; max-1: 9 pass;
Max+1=11 fail; Min=5 pass; Min+1=6 pass; Min-1=4 fail;
We check the corner values and come out with a conclusion whether the application is accepting correct range of values.

c. Decision Table Testing: 


Decision Table Testing is a good way to deal with combination of inputs, which produce different results. When creating decision tables, the specification is analyzed, and conditions and actions of the system are identified. The input conditions and actions are most often stated in such a way that they must be true or false (Boolean). The strength of decision table testing is that it creates combinations of conditions that otherwise might not have been exercised during testing.

Example:

    Stub    Rule1    Rule2    Rule3    Rule4
Conditions    Flyer member    Yes    Yes    No    No
    Class    Business    Economic    Business    Economic
Actions    Upgrade to first    Yes    No    No    No
    Upgrade to business    -    Yes    -    No

Testcase1: Frequent flyer member, traveling in Business class.
Testcase2: Non-member, traveling in Economy class.

Possible Answers:
1. Testcase1–Don’t offer any upgrade, Testcase2–Don’t offer any upgrade.
2. Testcase1–Don’t offer any upgrade, Testcase2–Offer upgrade to Business class.
3. Testcase1–Offer upgrade to First, Testcase2–Don’t offer any upgrade.
4. Testcase1–Offer upgrade to First, Testcase2–Offer upgrade to Business class.

Follow below steps to answer:
1. Match with conditions in with available rules as input.
2. When all the conditions match at that time, verify respective rule section for the answer.

For example in testcase1, frequent flyer member is available with rule1 and rule2. Now check for the traveling business class, here rule 1 only match with the condition. So Rule1 satisfy both the condition 1 and condition2. So according to rule1 testcase1 allows offer upgrade to First.

In testcase2, non member is available with rule3 and rule4. Now check for the traveling economy class, here rule 4 only match with the condition. So Rule4 satisfy both the condition 1 and condition2. So according to rule4 testcase2 allows Don’t offer any upgrade.

So answer is ‘Testcase1–Offer upgrade to First, Testcase2–Don’t offer any upgrade.

d. State transition testing: 


State transition testing is used where some aspect of the system can be described in what is called a “finite state machine”. It allows the tester to view the software in terms of its states, transitions between states, the inputs or events that trigger state changes (transitions) and the actions which may result from those transitions. The process for state transition testing is to draw state transition diagram; determine start state, input, output and finish state; determine coverage level to be achieved (1-switch/switch coverage for these exercises); draw testing tree; define tests. When simple one transition complete at that time, it is called 0-switch coverage. If again perform loop then it is called I-switch coverage. This testing is much used within the embedded software industry and technical automation in general. This technique is also suitable for modeling a business object having specific states or testing screen-dialogue flows (Internet applications or business scenarios).

Example:
Electric toothbrush: A two-speed electric toothbrush is operated by pressing its one button. The first press of the button turns the toothbrush from off to speed one, the second press of the button turns it to speed two. When the button is pressed for a third time the electric toothbrush is turned off.

e. Use case Testing: 


Use case testing is a technique that helps to understand business conditions and flows. It is used to identify test cases that exercise the whole system on a transaction by transaction basis from start to finish. This use case testing describes interactions between actors, including users and the system, which produce a result of value to a system user. Use cases are a sequence of steps that describe the interactions between the actor and the system.

2. Structure-based techniques (White-box or structural testing techniques):
 

Structure-based testing technique is also known as white-box or glass-box testing technique because here the testers require knowledge of how the software is implemented and how it works. It is a method of testing software that tests internal structures of an application. It is usually done at the unit level.
White-box testing techniques are Statement Testing and Coverage, Decision Testing and Coverage, and Linear Code Sequence And Jump (LCSAJ).

Statement Testing and Coverage: 


It is the assessment of the percentage of executable statements, which have been exercised by a test case suite. This testing technique derives test cases to execute specific statements normally to increase statement coverage.

Decision Testing and Coverage: 


Decision coverage testing is related to branch testing, which means the percentage of the decision outcomes that have been exercised by a test suite is called decision coverage.

Linear Code Sequence And Jump (LCSAJ): 


Linear code sequence and jump (LCSAJ) is a software analysis method used to identify structural units in code under test.

3. Experience- based testing techniques:

People’s knowledge, skills, and background are important to the test conditions and test cases in experience-based technique. They use the users' and the testers' experience to determine the most important areas of a system and to exercise these areas in ways that are both consistent with expected use and likely to be the sites of errors this is where the experience comes in. Experience-based techniques go together with specification-based and structure-based techniques and are also used when there is no specification or if the specification is inadequate or out of date. This may be the only type of technique used for low-risk systems, but this approach may be particularly useful under extreme time pressure.

Error Guessing:


Error-guessing in software testing can find number of faults that systematic techniques may be fail to attend. This takes advantage of a tester's skill, intuition and experience with similar applications to identify special tests that may not be easy to capture by the more formal techniques. It is a very simple technique. The main drawback of error guessing is its varying effectiveness, depending as it does on the experience of the tester deploying it.

Exploratory Testing:
 

Exploratory testing is a technique, which combines the experience of testers with a structured approach to testing where specifications are either missing or inadequate and where there is severe time pressure. It is the most efficient and effective approach to testing software, which produces useful results from the first hours of testing and finds the biggest bugs faster than any other approach.

0 comments:

Post a Comment