# Thread: BVA - Interactive Exercises

1. ## BVA - Interactive Exercises

Boundary Value Analysis (BVA)

It seems there is sufficient interest in this BVA topic to offer up running exercises. I propose we use this topic for additional examples and solutions.

2. ## BVA - Interactive Exercises

<font color="blue">Exercise I</font> and <font color="brown"> Solution:</font>

<font color="blue">I write a function that takes a byte as input and converts it to an ASCII character, then spits the actual character out to the caller. Aside from being inefficient, what are the boundaries here? Consider the spec only and assume the function as black-box to you and the function is exhaustively tested. Your role is to write a caller. What are some values the caller would pass to the function per BVA concepts? </font>

Solution from TestingMentor (Bj):
<font color="brown">(for those not familiar with ASCII see http://en.wikipedia.org/wiki/ASCII)

Your function takes a byte and converts it to an ASCII character and returns the character to the calling function, and you want to test the boundaries of such a function.

Now we know the ASCII character code point range is from 00000000 to 01111110. But, I would classify printable ASCII characters and ASCII control characters in 2 different equivalent class subsets. And, of course, all professional testers understand that boundary conditions aren't just at the extreme physical ranges of a linear variable, but also are sometimes identified by the edge values of equivalence class subsets.

Now, if you are one of those 'special' people who believe that equivalent class partitions are figments of someone's imagination, then you might hit the min and max ranges of ASCII characters, the max size of a byte, and maybe guess at a few byte values inbetween.

But, for those who really understand how to think critically about a problem within a realistic context, and would perform a more systematic analysis of the boundary conditions I would offer the following solution.

We would of course test 00000000 and 00000001 which are the minimum and minimum + 1 of the extreme ASCII code point range values (there is no way to test a minimum - 1 byte).

Then the sub-boundary conditions identified by our equivalent class subsets would include:
<ul type="square"> [*]00100000 - minimum of the printable character range[*]01111101 - maximum of the printable character range
[*]00011111 - (min printable character range - 1) [*]00100001 - (min printable character range + 1) [*]01111100 - (max printable character range - 1) [*]01111110 - (max printable character range + 1, and also the max range of the extreme ASCII character range) [*]10000000 - (maximum + 1 beyond the extreme range of ASCII characters) [/list]
Of course, since this function takes a byte, then we would also want to test 11111111 which is the maximum size of a byte. (And of course I am assuming this to be a modern programming language that will throw an error if the argument passed to the parameter is not a byte (8 bits).

Since you didn't specify any unique behavior for segregating numerals, upper case, or lower case or punctuation printable characters there are really no additonal interesting sub-boundaries. If there was special behavior for those groups of ASCII characters then we would obviously need to identify the byte values for those ranges.</font>

3. ## Re: BVA - Would you like to play?

<font color="blue">Exercise I.I - taking Exercise I and extending it into the rare zone</font>

<font color="blue">I write a function that takes a byte as input and converts it to an ASCII character, then spits the actual character out to the caller. Aside from being inefficient, what are the boundaries here? Consider the spec only and assume the function as black-box to you and the function is exhaustively tested. Your role is to write a caller. What are some values the caller would pass to the function per BVA concepts? </font>

Using the above spec, you:
1. Are aware that the compiler has had previous issues with, and - fixes to improper memory allocations.

What would you add to the above solution?

&lt;for a future exercise II we will use a different example altogether&gt;

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.