This website includes Education Information like a programming language, job interview question, general knowledge.mathematics

Education log

PageNavi Results No.

Ads

Monday, December 2, 2019

black box testing



                             black box testing




what is black box testing:


Black box testing is defined as a testing technique in which functionality of the Application Under Test (AUT) is tested without looking at the internal code structure, implementation details and knowledge of the internal paths of the software. This type of testing is based entirely on software requirements and specifications. Then Previous Tutorial white box testing 




black box testing





BLACK-BOX TESTING:


In black box testing, test cases are designed from an examination of the input/output values only and no knowledge of design or code is required.  The following are the two main approaches available to design black box test cases:
also known as Behavioral Testing, is a software a testing method in which the internal structure/design/implementation of the item being tested is not known to the tester. These tests can be functional or non-functional, though usually functional.
AI Boundary value analysis In the following subsections, we will elaborate on these two test case design techniques.

1.Equivalence Class Partitioning:


In the equivalence class partitioning approach, the domain of input values to the program under test is partitioned into a set of equivalence classes. The partitioning is done such that for every input data belonging to the , same equivalence class, the program behaves similarly.
The main idea behind defining equivalence classes of input data is that testing the code with anyone value belonging to an equivalence class is as good as testing the code with any other value belonging to the same equivalence class.

Equivalence classes for a unit under test can be designed by examining the input data and output data. The following are two general guidelines for designing the equivalence classes.
If the input data values to a system can be specified by a range of values, then one valid and two invalid equivalence classes need to be defined. For example, if the equivalence class is the set of integers in the range 1 to 10 (i.e., [1,100, then the invalid equivalence If the input data assumes values

from a set of discrete members of some domain, then one equivalence class for the valid input values and another equivalence class for the invalid input values should be defined. For example, if the valid equivalence classes are In the following, we illustrate equivalence class partitioning-based test case generation through four examples.

Example For a software that computes the square root of an input integer that can

assume values in the range of 0 and 5000. Determine the equivalence classes and the black box test suite.

Answer: There are three equivalence classes The set of negative integers, the set of integers in the range of 0 and 5000, and the set of integers larger than 5000. Therefore, the test cases must include representatives for each of the three equivalence classes. A possible test

Example Design the equivalence class test cases for a program that reads two integers. pairs (m 1, ci) and (m2, c2) defining two straight lines of the form y=mx+c. The program computes the intersection point of the two straight lines and displays the point of intersection.
Answer: The equivalence classes are the following:
*    Parallel lines (m1 = m2, ci L c2)
·    Intersecting lines (mi m2)
·    Coincident lines (m1 = m2, ci = c2)
Now, selecting one representative value from each equivalence class, we get the required equivalence class test suite {(2,2)(2,5),(5,5)(7,7), (10,10)(10,10)}.

Example Design equivalence class partitioning test suite for a function that reads a character string of size less than five characters and displays whether it is a palindrome.

Answer: The equivalence classes are the leaf level classes shown in Figure 10.4. The equivalence classes are palindromes, non-palindromes, and invalid inputs. Now, selecting one representative value from each equivalence class, we have the required test





Boundary Value Analysis:

A type of programming error that is frequently committed by programmers is missing out on the special a consideration that should be given to the values at the boundaries of different equivalence classes of inputs. The reason behind programmers committing such errors might purely be due to psychological factors. Programmers often fail to properly address the special processing required by the input values that lie at the boundary of the different equivalence classes. For example, programmers may improperly use



To design boundary value test cases, it is required to examine the equivalence classes to check if any of the equivalence classes contain a range' of values. For those equivalence classes that are not a range of values (i.e., consist of a discrete collection of values) no boundary value test cases can be defined. For an equivalence class that is a range of values, the boundary.
values need to be included in the test suite. For example, if an equivalence class contains the integers in the range 1 to 10, then the boundary value test suite is {0,1,10,11}.
Example 10.9 For a function that computes the square root of the integer values in the range
of 0 and 5000, determine the boundary value test suite.
Answer: There are three equivalence classes The set of negative integers, the set of integers
in the range of 0 and 5000, and the set of integers larger than 5000. The boundary value-based




Summary of the Black-box Test Suite Design Approach

We now summarise the important steps in the black-box test suite design approach:
·    Examine the input and output values of the program.
·  Identify the equivalence classes.
·    Design equivalence class test cases  by picking one representative value from each equivalence class.
·    Design the boundary value test cases as follows. Examine if any equivalence class is a range of values. Include the values at the boundaries of such equivalence classes in the test suite.
The strategy for black-box testing is intuitive and simple. For black-box testing, the most important step is the identification of the equivalence classes. Often, the identification of the equivalence classes not straightforward:; However, with little practice one would be able to identify all equivalence classes in the input data domairg Without practice, one may overlook many equivalence classes in the input data set. Once the equivalence classes are identified, the equivalence class and boundary value test cases can be selected almost mechanically.


No comments:

Post a Comment