0% found this document useful (0 votes)
2 views

Function_testing

The document discusses various software testing techniques, focusing on functional testing, boundary value analysis (BVA), equivalence class testing, decision table-based testing, and cause-effect graphing. It explains how these techniques help in designing test cases to identify faults in software by examining input values, expected outputs, and logical relationships. Each technique has specific applicability and methods for generating effective test cases to ensure software reliability.

Uploaded by

sunnymulodia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Function_testing

The document discusses various software testing techniques, focusing on functional testing, boundary value analysis (BVA), equivalence class testing, decision table-based testing, and cause-effect graphing. It explains how these techniques help in designing test cases to identify faults in software by examining input values, expected outputs, and logical relationships. Each technique has specific applicability and methods for generating effective test cases to ensure software reliability.

Uploaded by

sunnymulodia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

SOFTWARE TESTING

Functional Testing
Contents
• Functional Testing
• Boundary Value Analysis(BVA)
• Equivalence Class Testing
• Decision Table Based Testing
• Cause –Effect Graphing Technique
Function Testing
• Functional testing techniques attempt to design those test cases which have a higher probability of making a
software fail. These techniques also attempt to test every possible functionality of the software. Test cases are
designed on the basis of functionality and the internal structure of the program is completely ignored.
• Observed output(s) is (are) compared with expected output(s) for selected input(s) with preconditions, if any.
The software is treated as a black box and therefore, it is also known as black box testing.

Software under
Test

Output Domain
Input Domain
Boundary Value Analysis(BVA)
• we concentrate on input values and design test cases with input values that are on or close to
boundary values. Experience has shown that such test cases have a higher probability of detecting a
fault in the software.
• Suppose there is a program ‘Square’ which takes ‘x’ as an input and prints the square of ‘x’as
output. The range of ‘x’ is from 1 to 100. One possibility is to give all values from 1 to 100 one by
one to the program and see the observed behavior. We have to execute this program 100 times to
check every input value.
• In boundary value analysis, we select values on or close to boundaries and all input values may
have one of the following:
(i) Minimum value
(ii) Just above minimum value
(iii) Maximum value
(iv) Just below maximum value 1 2 50 99 100
(v) Nominal (Average) value
Boundary Value Analysis(BVA)
• The number of inputs selected by this technique is 4n + 1 where ‘n’ is the number of
inputs. One nominal value is selected which may represent all values which are neither
close to boundary nor on the boundary.

Test Case Input X Expected output


1 1 1
2 2 4
3 50 2500
4 99 9801
5 100 10000
Boundary Value Analysis(BVA) Example
• Consider a program ‘Addition’ with two input values x and y and it gives the addition of x
and y as an output. The range of both input values are given as:
100<= x =>300
200 <=y =>400
Boundary Value Analysis(BVA) Example
Boundary Value Analysis(BVA) Example
Boundary Value Analysis(BVA)
• Robustness Testing :- This is the extension of boundary value analysis. Here, we also select
invalid values and see the responses of the program. Invalid values are also important to check the
behavior of the program. Hence, two additional states are added i.e. just below minimum value
(minimum value –) and just above maximum value (maximum value +). We want to go beyond the
legitimate domain of input values. This extended form of boundary value analysis is known as
robustness testing.
• The total test cases in robustness testing are 6n + 1, where ‘n’ is the number of input values : -
(i) Minimum value
(ii) Just above minimum value
(iii) Just below minimum value
(iv) Just above maximum value
(v) Just below maximum value
(vi) Maximum value
(vii) Nominal (Average) value
Boundary Value Analysis(BVA)(Robustness
Testing)
Boundary Value Analysis(BVA)
• Worst-Case Testing :- This is a special form of boundary value analysis where we don’t
consider the ‘single fault’ assumption theory of reliability. Now, failures are also due to
occurrence of more than one fault simultaneously. The implication of this concept in
boundary value analysis is that all input values may have one of the following:-
(i) Minimum value
(ii) Just above minimum value
(iii) Just below maximum value
(iv) Maximum value
(v) Nominal (Average) value
• The restriction of one input value at any of the above mentioned values and other input
values must be at nominal is not valid in worst-case testing. This will increase the number
of test cases from 4n + 1 test cases to 5n test cases, where ‘n’ is the number of input
values.
Boundary Value Analysis(BVA) Worst-Case Testing

This is a more comprehensive technique and boundary value


test cases are proper sub-sets of worst case test cases. This
requires more effort and is recommended in situations where
failure of the program is extremely critical and costly
Boundary Value Analysis(BVA)
• Robust Worst-Case Testing:- In robustness testing, we add two more states i.e. just below minimum value
(minimum value–) and just above maximum value (maximum value+). We also give invalid inputs and
observe the behavior of the program. A program should be able to handle invalid input values, otherwise it
may fail and give unexpected output values. There are seven states (minimum -, minimum, minimum +,
nominal, maximum –, maximum, maximum +) and a total of 7n test cases will be generated.
Boundary Value Analysis(BVA) Robust Worst-Case
Testing
Boundary Value Analysis
• Applicability :- Boundary value analysis is a simple technique and may prove to be
effective when used correctly. Here, input values should be independent which restricts its
applicability in many programs. This technique does not make sense for Boolean
variables where input values are TRUE and FALSE only, and no choice is available for
nominal values, just above boundary values, just below boundary values, etc. This
technique can significantly reduce the number of test cases and is suited to programs in
which input values are within ranges or within sets. This is equally applicable at the unit,
integration, system and acceptance test levels. All we want is input values where
boundaries can be identified from the requirements.
Equivalence Class Testing
• We may divide input domain into various categories with some relationship and expect
that every test case from a category exhibits the same behaviour. If categories are well
selected, we may assume that if one representative test case works correctly, others may
also give the same results. This assumption allows us to select exactly one test case from
each category and if there are four categories, four test cases may be selected. Each
category is called an equivalence class and this type of testing is known as equivalence
class testing.
• Creation of Equivalence Classes:- The entire input domain can be divided into at least
two equivalence classes: one containing all valid inputs and the other containing all
invalid inputs. Each equivalence class can further be sub-divided into equivalence classes
on which the program is required to behave differently.
Equivalence Class Testing(Example)
Square of No. range [1,100]
(i) I1 = { 1 x 100 }(Valid input range from 1 to 100)
(ii) I2 = { x < 1 } (Any invalid input where x is less than 1)
(iii) I3 = { x > 100 } (Any invalid input where x is greater than 100)

Test Case Input X Expected Output

I1 0 Invalid input

I2 50 2500

I3 101 Invalid input


Equivalence Class Testing
• Applicability :- It is applicable at unit, integration, system and acceptance test
levels.
• The basic requirement is that inputs or outputs must be partitioned based on the
requirements and every partition will give a test case.
• If one test case does not find a bug, the other test cases of the same equivalence
class may also not find any bug. We do not consider dependencies among different
variables while designing equivalence classes.
• The design of equivalence classes is subjective and two testing persons may
design two different sets of partitions of input and output domains. This is
understandable and correct as long as the partitions are reviewed and all agree that
they acceptably cover the program under test.
DECISION TABLE BASED TESTING
• Decision tables are used in many engineering disciplines to represent complex logical
relationships. An output may be dependent on many input conditions and decision tables give a
pictorial view of various combinations of input conditions.
• It’s a tabular representation of input conditions and resulting actions. Additionally, it shows the
causes and effects. Therefore, this technique is also called a cause-effect table.
• There are four portions of the decision table.
Decision table
• Four Portions
1. Condition Stubs Stubs Entries
2. Condition Entries C1
Condition C2
3. Action Stubs
C3
4. Action Entries
A1
Action A2
A3
DECISION TABLE BASED TESTING(Example)

• Let's create a decision table for a login screen.

Rule 1 Rule 2 Rule 3 Rule4

Conditions User Name F T F T

Password F F T T

Action Error message Error message Error message Login


How to make Decision Table for Upload Screen
Conditions Case 1 Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 Case 8

Format .jpg .jpg .jpg .jpg Not .jpg Not .jpg Not .jpg Not .jpg

1.You can upload only '.jpg' format image Size Less than Less than >= 32kb >= 32kb Less than Less than >= 32kb >= 32kb
32kb 32kb 32kb 32kb
2.file size less than 32kb
3.resolution 137*177.
resolution 137*177 Not 137*177 Not 137*177 Not 137*177 Not
137*177 137*177 137*177 137*177

Output Photo Error Error Error Error Error Error Error


uploaded message message message message message message message
resolution size size and for format format and for format for format,
mismatch mismatch resolution mismatch resolution and size size, and
mismatch mismatch mismatch resolution
mismatch
CAUSE-EFFECT GRAPHING TECHNIQUE
• This technique is a popular technique for small programs and considers the combinations of various inputs which were not
available in earlier discussed techniques like boundary value analysis and equivalence class testing.
• Such techniques do not allow combinations of inputs and consider all inputs as independent inputs.
• Two new terms are used here and these are causes and effects, which are nothing but inputs and outputs respectively.
• Cause Effect Graph is a black box testing technique that graphically illustrates the relationship between a given outcome and all
the factors that influence the outcome.
CAUSE-EFFECT GRAPHING TECHNIQUE

Identification of all Design the cause- Apply constraints, if


Causes and effects effect graph any

Write test cases using Design limited entry


every column of the decision table from
decision table graph
CAUSE-EFFECT GRAPHING TECHNIQUE
• Identification of Causes and Effects :- The SRS document is used for the identification of causes
and effects. Causes which are inputs to the program and effects which are outputs of the program can easily
be identified after reading the SRS document. A list is prepared for all causes and effects.
• Design of Cause-Effect Graph :- The relationship amongst causes and effects are established using cause-
effect graph. The basic notations of the graph are :-
CAUSE-EFFECT GRAPHING TECHNIQUE
• Use of Constraints in Cause-Effect Graph :-
There may be a number of causes (inputs) in any
program. We may like to explore the relationships amongst the causes and this process
may lead to some impossible combinations of causes. They help us to represent real life
situations in the cause-effect graph.
CAUSE-EFFECT GRAPHING TECHNIQUE
• Design of Limited Entry Decision Table :- The cause-effect graph represents the
relationships amongst the causes and effects. This graph may also help us to understand
the various conditions/combinations amongst the causes and effects. These
conditions/combinations are converted into the limited entry decision table. Each column
of the table represents a test case.
• Writing of Test Cases :- Each column of the decision table represents a rule and gives us
a test case. We may reduce the number of columns with the proper selection of various
conditions and expected actions.
• Applicability: -Cause-effect graphing is a systematic method for generating test cases. It
considers dependency of inputs using some constraints. This technique is effective only
for small programs because, as the size of the program increases, the number of causes
and effects also increases and thus complexity of the cause effect graph increases. For
large-sized programs, a tool may help us to design the cause-effect graph with the
minimum possible complexity. It has very limited applications in unit testing and hardly
any application in integration testing and system testing.
CAUSE-EFFECT GRAPHING TECHNIQUE(Example)

• A tourist of age greater than 21 years and having a clean driving record is supplied a
rental car. A premium amount is also charged if the tourist is on business, otherwise it is
not charged. If the tourist is less than 21 year old, and does not have a clean driving
record, the system will display the following message: “Car cannot be supplied” Draw the
cause-effect graph and generate test cases.
• The cause are : - C1: Age is over 21 C2: Driving record is clean C3: Tourist is on
business
• The effects are :- e1: Supply a rental car without premium charge
e2: Supply a rental car with premium charge e3: Car can not be supplied
CAUSE-EFFECT GRAPHING TECHNIQUE(Example)
• The cause-effect graph is shown in Figure
CAUSE-EFFECT GRAPHING TECHNIQUE(Example)

• Decision table of rental car problems


CAUSE-EFFECT GRAPHING TECHNIQUE(Example)

• Test case of the given decision table

You might also like