-->

Tabs

BVA & ECP

Boundary value analysis :
Testing experience has shown that especially the boundaries of input ranges to a software module are liable to bugs. A developer implement e.g. the range 1 to 31 at an input, which e.g. stands for the days of day January, has in his code a line checking for this range. This may look like: if (day > 0 && day <>= 0 && day < style="font-weight: bold;">Definition :
BVA is a methodology for designing test cases that concentrates software testing effort on cases near the limits of valid ranges BVA is a method which refines ECP. BVA generates test cases that highlight errors better than ECP. The trick is to concentrate software testing efforts at the extreme ends of the equivalence classes. At those points when input values change from valid to invalid errors are most likely to occur. As well, BVA broadens the portions of the business requirement document used to generate tests. Unlike ECP, it takes into account the output specifications when deriving test cases.

Description :
The purpose of BVA is to concentrate the testing effort on error prone areas by accurately pointing the boundaries of conditions,(e.g., a developer may specify >, when the requirement states > or =).To set up BVA test cases you first have to determine which boundaries you have at the interface of a software module. This has to be done by applying the ECP technique. BVA and ECP are inevitably linked together. For the example of the day in a date you would have the following partitions:
.......... -2 -1 0 1 .............................. 30 31 32 33 .....
--------------|-------------------|---------------------
invalid valid invalid

Applying BVA you have to select now a test case at each side of the boundary between two partitions. In the above example this would be 0 and 1 for the lower boundary as well as 31 and 32 for the upper boundary. Each of these pairs consists of a "+ve" and a "-ve" test case. A "+ve" test case should give you a valid operation result of your program. A "-ve" test case should lead to a correct and specified input error treatment such as the limiting of values, the usage of a substitute value, or in case of a program with a user interface, it has to lead to warning and request to enter correct data. The BVA can have 6 testcases.n, n-1,n+1 for the upper limit and n, n-1,n+1 for the lower limit.
A further set of boundaries has to be considered when you set up your test cases. A solid testing strategy also has to consider the natural boundaries of the data types used in the program. If you are working with signed values this is especially the range around zero (-1, 0, +1). Similar to the typical range check faults, developers tend to have weaknesses in their programs in this range. e.g. this could be a division by zero problem where a zero value may occur although the developer always thought the range started at 1. It could be a sign problem when a value turns out to be negative in some rare cases, although the developer always expected it to be positive. Even if this critical natural boundary is clearly within an equivalence partition it should lead to additional test cases checking the range around zero. A further natural boundary is the natural lower and upper limit of the data type itself. E.g. an unsigned 8-bit value has the range of 0 to 255. A good test strategy would also check how the program reacts at an input of -1 and 0 as well as 255 and 256.The tendency is to relate BVA more to the so called black box testing ,which is strictly checking a software module at its interfaces, without consideration of internal structures of the software. But looking closer at the subject, there are cases where it applies also to white box testing.After determining the necessary test cases with ECP and subsequent BVA, it is necessary to define the combinations of the test cases when there are multiple inputs to a software module.

Implementation of BVA :
There are two steps:
STEP 1: IDENTIFY EQUIVALENCE CLASSES
Follow the same rules you used in ECP. However, consider the output specifications as well. For example, if the toatl no of days in the month of january are 31, then add the following classes to the ones you found previously:
1. The valid class ( 1 < = days in January < = 31 ) 2 The invalid class (days in January <0)> 31 )
STEP 2: DESIGN TEST CASES
In this step, you derive test cases from the equivalence classes. The process is similar to that of ECP but the rules for designing test cases differ. With ECP, you may select any test case within a range and any on either side of it with boundary analysis, you focus your attention on cases close to the edges of the range.
1. If the condition is a range of values, create valid test cases for each end of the range and invalid test cases just beyond each end of the range. For example, if a valid range of days on hand is 1 to 31, write test cases that include:
1. the valid test case days on hand is 1
2. the valid test case days on hand is 31
3. the invalid test case days on hand is 0 and
4. the invalid test case days on hand is 32
You may combine valid classes wherever possible, just as you did with ECP, and, once again, you may not combine invalid classes. Don't forget to consider output conditions as well. In our inventory example the output conditions generate the following test cases:
1. the valid test case total days on hand is 1
2. the valid test case total days on hand is 31
3. the invalid test case total days on hand is 0 and
4. the invalid test case total days on hand is 32
2. A similar rule applies where the, condition states that the number of values must lie within a certain range select two valid test cases, one for each boundary of the range, and two invalid test cases, one just below and one just above the acceptable range.
3. Design tests that highlight the first and last records in an input or output file.
4.Look for any other extreme input or output conditions, and generate a test for each of them.

Error Guessing :
Error Guessing is a test case design technique where the tester has to guess what faults might occur and to design the tests to represent them.Ability to guess based on previous experience in Software Testing environment.
Adhoc method to identify tests likely to expose errors based on experience and intuition. Some areas to guess are Empty or null strings, Zero instances, occurrences, Blank or null characters in strings, Negative numbers.The purpose of error guessing is to focus the testing activity on areas that have not been handled by the other more formal techniques, such as ECP and boundary value analysis.Error guessing is the process of making an educated guess as to other types of areas to be tested. For example, educated guesses can be based on items such as metrics from past testing experiences, or the tester's identification of situations in the Functional Design Specification or Detailed Design Specification, that are not addressed clearly.

Equivalence Class Partitioning :
ECP is a method for deriving test cases. In this method, classes of input conditions called equivalence classes are identified such that each member of the class causes the same kind of processing and output to occur. In this method, the tester identifies various equivalence classes for partitioning. A class is a set of input conditions that are is likely to be handled the same way by the system. If the system were to handle one case in the class erroneously, it would handle all cases erroneously.

Description :
ECP is a software testing technique to minimize number of permutation and combination of input data. In ECP, data is selected in such a way that it gives as many different out put as possible with the minimal set of data.If software behaves in an identical way for a set of value, then the set is termed as equivalence class or a partition. It can be assumed safely that functionality of the software will be same for any data value from the equivalence class or partition. In ECP, input data is analyzed and divided into equivalence classes which produces different output. Now, data from these classes can be representative of all the input values that your software expect. For equivalence classes, it can be assumed that software will behave in exactly same way for any data value from the same partition.
The testing theory related to ECP says that only one test case of each partition is needed to evaluate the behaviour of the program for the related partition. In other words it is sufficient to select one test case out of each partition to check the behaviour of the program. To use more or even all test cases of a partition will not find new faults in the program. The values within one partition are considered to be "equivalent". Thus the number of test cases can be reduced considerably.An additional effect by applying this technique is that you also find the so called "dirty" test cases. An inexperienced tester may be tempted to use as test cases the input data 1 to 12 for the month and forget to select some out of the invalid partitions. This would lead to a huge number of unnecessary test cases on the one hand, and a lack of test cases for the dirty ranges on the other hand.

Implementation of ECP :
The tendency is to relate ECP to black box testing, which is strictly checking a software module at its interface without consideration of internal structures of the software. But having a closer look at the subject there are cases where it applies to white box testing as well. Imagine an interface to a module which has a valid range between 1 and 31 as in the example above. However, internally the function may have a differentiation of values between 1 and 15 and the values between 16 and 31. Depending on the input value the software internally will run through different paths to perform slightly different actions. Regarding the input and output interfaces to the module this difference will not be noticed, however in your white-box testing you would like to make sure that both paths are examined. To achieve this it is necessary to introduce additional equivalence partitions which would not be needed for black-box testing. For this example this would be:
.......... -2 -1 0 1 ......... 15 16 .......... 31 32 33 34 .....
--------------|---------|----------|----------------
invalid1 valid 1 valid2 invalid2
T1 T2 T3 T4
To check for the expected results you would need to evaluate some internal intermediate values rather than the output interface.
Types of Equivalence Classes
• Continuous classes, or ranges of values, run from one point to another, with no clear separations of values. An example is a temperature range.
• Discrete classes have clear separation of values. Discrete classes are sets, or enumerations.
• Boolean classes are either true or false. Boolean classes only have two values, either true or false, on or off, yes or no. An example is whether a checkbox is checked or unchecked.

Why ECP?
ECP drastically cuts down the number of test cases required to test a system reasonably.It is an attempt to get a good 'hit rate', to find the most errors with the smallest number of test cases.

Designing Test Cases Using ECP,
Take each input condition described in the specification and derive at least two equivalence classes for it. One class represents the set of cases which satisfy the condition (the valid class) and one represents cases which do not (the invalid class ) Following are some general guidelines for identifying equivalence classes:
a) If the requirements state that a numeric value is input to the system and must be within a range of values, identify one valid class inputs which are within the valid range and two invalid equivalence classes inputs which are too low and inputs which are too high. For example, if a month can have a days of 1 to 31, identify the following classes: 1. one valid class: (DAY is greater than or equal to 1 and is less than or equal to 31).2. the invalid class (DAY is less than 0) 3. the invalid class (DAY is greater than 31)

b) If the requirements state that the number of days input by the system at some point must lie within a certain range, specify one valid class where the number of inputs is within the valid range, one invalid class where there are too few inputs and one invalid class where there are, too many inputs. For example, specifications state that a maximum of 2 no can be registered against anyone day. The equivalence classes are : the valid equivalence class: (number of Characters is greater than or equal to 1 and less than or equal to 2 , the invalid class (no. of characters > 2) the invalid class (no. of Characters < style="font-weight: bold;">
Conclusion : BVA,ECP and Error Guessing are the important methods in preparing and implementing the Testcases.

Source : http://www.onestoptesting.com/