Boundary value analysis (BVA) Problem 1: Valid input for a program is a number b
ID: 3829289 • Letter: B
Question
Boundary value analysis (BVA)
Problem 1: Valid input for a program is a number between 1 and 10, inclusive. The output is the sum of the numbers from 0 to that number.
What test cases are needed to adequately cover this problem?
Problem 2: Valid input for a program is a positive, even number or a negative, odd number.
What are the boundaries?
Problem 3 : Valid input for a program is a positive, even number or a negative, odd number. The output is either an error message or the numbers absolute value.
How many possible test cases are there?
What test cases are needed to test this problem?
Explanation / Answer
Problem 1:
The valid input is only 1,2,3,4,5,6,7,8,9,10.
If anything not mentioned above is invalid. For example 0 and 11,12,13…….
Therefore the boundary values are 0,1,10,11
1,10 are valid
0,11 are invalid
Problem 2:
The valid input is (positive and even number) or (negative and odd number)
That is 2,4,6,..10,….. or -1,-3,-5,..-9………
The invalid input is (positive and odd number) or (negative and even number)
That is 1,3,5,7,…13,15…… or -2,-4,-6,-8……….
That Boundary values are
2 valid
-2 invalid
-1 valid
1 invalid
Note that 0 is neither positive not negative, we have to consider this as special case
Problem 3:
The valid input is (positive and even number) or (negative and odd number)
That is 2,4,6,..10,….. or -1,-3,-5,..-9………
The output is absolute values, those are abs(2)=2, abs(-1)=1,…..
The invalid input is (positive and odd number) or (negative and even number)
That is 1,3,5,7,…13,15…… or -2,-4,-6,-8……….
The output is displaying error message
The boundary values and outputs
2 – 2
-1 – 1
-2 – Error
1 - Error
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.