Application
The expected input and output values to the software component should be extracted from the component specification. The values are then grouped into sets with identifiable boundaries. Each set, or partition, contains values that are expected to be processed by the component in the same way. Partitioning of test data ranges is explained in the equivalence partitioning test case design technique. It is important to consider both valid and invalid partitions when designing test cases.
The demonstration can be done using a function written in c language
int safe_add( int a, int b ) { int c = a + b ; if ( a >= 0 && b >= 0 && c < 0 ) { fprintf ( stderr, "Overflow!\n"); } if ( a < 0 && b < 0 && c >= 0 ) { fprintf ( stderr, "Underflow!\n"); } return c; }On the basis of the code, the input vectors of are partitioned. The blocks we need to cover are the overflow statement and the underflow statement and neither of these 2. That gives rise to 3 equivalent classes, from the code review itself.
we note that there is a fixed size of Integer (computer science) hence:- 
We note that the input parameter a and b both are integers, hence total order exists on them. When we compute the equalities:-


we get back the values which are on the boundary, inclusive, that is these pairs of are valid combinations, and no underflow or overflow would happen for them.
On the other hand:-
gives pairs of which are invalid combinations, Overflow would occur for them. In the same way:-
gives pairs of which are invalid combinations, Underflow would occur for them.
Boundary values (drawn only for the overflow case) are being shown as the orange line in the right hand side figure.
For another example, if the input values were months of the year, expressed as integers, the input parameter 'month' might have the following partitions:
The boundary between two partitions is the place where the behavior of the application changes and is not a real number itself. The boundary value is the minimum (or maximum) value that is at the boundary. The number 0 is the maximum number in the first partition, the number 1 is the minimum value in the second partition, both are boundary values. Test cases should be created to generate inputs or outputs that will fall on and to either side of each boundary, which results in two cases per boundary. The test cases on each side of a boundary should be in the smallest increment possible for the component under test, for an integer this is 1, but if the input was a decimal with 2 places then it would be .01. In the example above there are boundary values at 0,1 and 12,13 and each should be tested.
Boundary value analysis does not require invalid partitions. Take an example where a heater is turned on if the temperature is 10 degrees or colder. There are two partitions (temperature<=10, temperature>10) and two boundary values to be tested (temperature=10, temperature=11).
Where a boundary value falls within the invalid partition the test case is designed to ensure the software component handles the value in a controlled manner. Boundary value analysis can be used throughout the testing cycle and is equally applicable at all testing phases.
Read more about this topic: Boundary-value Analysis
Famous quotes containing the word application:
“May my application so close
To so endless a repetition
Not make me tired and morose
And resentful of mans condition.”
—Robert Frost (18741963)
“It is known that Whistler when asked how long it took him to paint one of his nocturnes answered: All of my life. With the same rigor he could have said that all of the centuries that preceded the moment when he painted were necessary. From that correct application of the law of causality it follows that the slightest event presupposes the inconceivable universe and, conversely, that the universe needs even the slightest of events.”
—Jorge Luis Borges (18991986)
“My business is stanching blood and feeding fainting men; my post the open field between the bullet and the hospital. I sometimes discuss the application of a compress or a wisp of hay under a broken limb, but not the bearing and merits of a political movement. I make gruelnot speeches; I write letters home for wounded soldiers, not political addresses.”
—Clara Barton (18211912)