HW 1
HW 1
Software Engineering 2
HW 1
Due Date: 10/3/2007
Testing is a costly process. It takes about 40% of the total project cost.
User expectations: Many users have low expectations of their s/w and they
are not surprised when it fails. The users are willing to accept system
failures when the benefits outweigh the disadvantages.
Data faults: Should the upper bound of the arrays be equal to size of array
minus one?
Is there any possibility of buffer overflow?
E.g.,
int i, A[10];
For (i=0 ; i<15; i++) A[i]= i;
Control faults: For each conditional statement is the condition correct?
Is each loop certain to terminate?
In case statement, are all possible cases accounted for?
If a break is required after each case, has it been included?
E.g.,
int i;
while (i<10) {
Dosomething();
i--;
}
Input/Output faults: Are all output variables assigned a value before they are
output?
Can unexpected inputs cause corruption?
E.g.,
Float y, x= 10;
Cout<< " x = " << x << "y = " << y << endl;
E.g.,
Void search (int key, int A[], int n) {….}
Main(){
Int B[100], key;
…
Search (100, B, key);
…}
Storage management faults: If a linked list is modified, have all links been correctly
reassigned?
If a dynamic structure is used, has space been allocated correctly?
Is space explicitly deallocated after it is no longer required?
E.g.,
Node x;
x= new node(10);
x->link= new node(20);
x= x->link ; // the pointer to the head node is LOST