Friday, February 26, 2010
Boundary Value Analysis Demystified
It is very often that I see people with the understanding of how Boundary value analysis is done, but without being clear of why we do it for! So I thought of elaborating the same here, so that our fellow friends might have a clear picture of why we have such a method of testing included in our checklists.
Dim strInput, intMaxChars
intMaxChars = 10
strInput = InputBox ("Input your Full Name")
If Len(strInput) > intMaxChars Then
MsgBox "Error: Length exceeded"
Else
MsgBox "Length OK"
End If
Let us think of this code being used as input for further processing in our application. This bit of code seems to be simple and ok as such, because it takes care of the limits well. If you enter a string that is more than 10 characters long, it would throw an error. But think about the lower limit on the number of characters. If it is left blank also, it shows the success message and proceeds further. Now, if it our application pushes this value into a database, then this could be resulting in an error since the value if the field is left blank, would be pushing null into the database, thereby causing our application to fail. In a more complex situation, it could add the set into database, but one can never retrieve the value based on a null string. What does this lead us into? It leads into wastage of resources like memory. If one keeps on adding data with null in this field for a number of times, the database might get full at a certain period of time, as well as data fetching could come across several difficulties, since this could lead to duplicate records in the database as well. See the impact of a small mistake! This seems to be a very small piece of code, as compared to larger sections of code which might be pushing and pulling data across the database. But since this is the section that the input data is got from, this plays a very important role in the life of our application.
I guess that by now, you might have been able to understand the criticality of performing a boundary value analysis in any simple form as well. If there are any queries that you are getting in your mind, please feel free to ask it through the comments section.
The Software or a program has its tendency to break when there are multiple conditional statements. This may be the result of various reasons. One of the main and the biggest reasons is inefficient programming by developers. They put such complex checks in their conditions that might fail the application when slightly complex inputs are provided. Now, the other reasons for failures could be the inefficiency of the compiler or the operating system to handle such complex conditions in a faster manner. Likewise, there might be several reasons that cause conditional statements vulnerable in the life of a software.
Now think of the Boundary Value Analysis. We utilize this testing method, when there are defined boundaries that are accepted by our application functionality. For example: consider a text field that accepts 32 characters as input. We know that the boundary values according to ISTQB would be -1, 0, 1, 31, 32 and 33 characters. If we think about the code that runs in the back-end, it would be a set of conditional statements. Some might put a block on the number of characters that you can type into the field; some might throw an error if you submit more characters than expected and so on. Consider the following VBScript code that I have given below.
Dim strInput, intMaxChars
intMaxChars = 10
strInput = InputBox ("Input your Full Name")
If Len(strInput) > intMaxChars Then
MsgBox "Error: Length exceeded"
Else
MsgBox "Length OK"
End If
Let us think of this code being used as input for further processing in our application. This bit of code seems to be simple and ok as such, because it takes care of the limits well. If you enter a string that is more than 10 characters long, it would throw an error. But think about the lower limit on the number of characters. If it is left blank also, it shows the success message and proceeds further. Now, if it our application pushes this value into a database, then this could be resulting in an error since the value if the field is left blank, would be pushing null into the database, thereby causing our application to fail. In a more complex situation, it could add the set into database, but one can never retrieve the value based on a null string. What does this lead us into? It leads into wastage of resources like memory. If one keeps on adding data with null in this field for a number of times, the database might get full at a certain period of time, as well as data fetching could come across several difficulties, since this could lead to duplicate records in the database as well. See the impact of a small mistake! This seems to be a very small piece of code, as compared to larger sections of code which might be pushing and pulling data across the database. But since this is the section that the input data is got from, this plays a very important role in the life of our application.
I guess that by now, you might have been able to understand the criticality of performing a boundary value analysis in any simple form as well. If there are any queries that you are getting in your mind, please feel free to ask it through the comments section.
Labels: Boundary Value Analysis Demystified, Testing Terminologies
Subscribe to Posts [Atom]

Post a Comment