Hello,
I am newbie in testing field.
I have been told to test boundary condition. What exactly does that mean?
Please let know.
Tiger
Hello,
I am newbie in testing field.
I have been told to test boundary condition. What exactly does that mean?
Please let know.
Tiger
Let's say you read an int and it has to be between 0 and 10, you check the boundaries like this
Or you can check the index of an array in a similar manner :-)Code:if (num < 0 || num > 10) { error(); }
*Cela*
Thanks Cela
I wanted to know, what does mean by memory boundary condition checking?
Is it like, how much heap or stack grows and shrinks? But I am not allocating any memory over heap at all.
Please explain
>>I wanted to know, what does mean by memory boundary condition checking?
If you have an array
You check the index to make sure you don't access memory outside of your boundaries, for example, a[i] would go out of bounds if i is 10 or greater, or less than 0, so you might check it like thisCode:int a[10];
Code:if (i >= 0 && i < 10) { a[i]; /* Safe */ }
*Cela*
Here are my comments
1. Say I am using this array 100 times in code. Do I need to check the boundary condition every time code accesses the array?
2. This is basically an embedded system that running on some on target, do you still feel that we have to test boundary conditions in firmware code itself? Don’t you think it will affect the performance? In short, what I want to know is, does adding new code alone check boundary conditions?
3. We have a system (PC) that talks to this target board over RS232. And PC issue commands. Is there any way to test the boundary condition by issuing valid and invalid( crossing boundaries) commands?
Please let me know
Tiger
Whenever you use an array, you ALWAYS check your boundries. Never go below zero, and never above SIZE-1.Originally posted by Roaring_Tiger
Here are my comments
1. Say I am using this array 100 times in code. Do I need to check the boundary condition every time code accesses the array?
The easiest way to do this is:
array[ some_var % SIZE ]
Now, this may not give you the right answer in the event your 'some_var' is out of bounds, but it will keep your program from crashing by forcing the value into the bounds of the array.
Quzah.
Hope is the first step on the road to disappointment.