Cosc4107 human computer interaction - briefly discuss the


PART 1: Short Answers

1. Briefly discuss the relationship between integration testing, unit testing and system test.

2. Code Analysis: int Calculate (int x, int y) {
int total=0; if (x>30) {
total=(x*40+y*50)*.95;
}
else
total=x+y;

for (int i=0;i}
return total;
}

a. Draw the control flow graph for this code.

b. What are the test cases to achieve statement coverage for this code?

c. What additional test cases (if any) are required for branch coverage?

d. Is it possible to test all paths through this module?

3. A car insurance company "Simplicity" provides insurance cover for motor vehicles. When a customer applies for a quote on insurance, the agent requests the following information:
1. Vehicle year of registration and make (e.g. Toyota, 2001)
2. Age of the driver
The system outputs a quote for insurance.

Use EP to do testing analysis and find the necessary test cases (15 marks)

PART 2: Long answers

1. Testing a Stack class (25 marks)

Here is Java code for a simple Stack class provided:

class Stack
{
int number; // number of items in the stack
int limit; // limit on number of items in the stack int increment; // incremental number to be added int array[ ]; // stack contents

Stack(int limit)
{
this.limit = limit; // set instance variable to argument value increment = limit; // use increment for limit
array = new int[limit]; // create array
number = 0; // stack contains no items initially
}

void ensure() // make sure push is possible
{
if( number >= limit )
{
int newArray[] = new int[limit+increment]; // create new array for( int i = 0; i < limit; i++ )
{
newArray[i] = array[i]; // copy elements in stack
}
array = newArray; // replace array with new one limit += increment; // augment the limit
}
}

void push(int x)
{
ensure();
array[number++] = x; // put element at position number and increment
}

int pop()
{
return array[--number]; // decrement number and take element
}

boolean empty()
{
return number == 0; // see if number is 0
}

public static void main(String arg[])
{
int limit = new Integer(arg[0]).intValue(); Stack s = new stack(limit);
for( int i = 0; i < limit; i++ )
{
s.push(i);
}
while( !s.empty() )
{
System.out.println(s.pop());
}
}
}

How would you test this class?
Hint: I am looking for as complete and detailed an answer as you can give in the time available. I am looking for both a discussion of overall strategies (how will you approach the task) as well as a small number of specific test cases.

3. OO programming might provide an easy way for testing. Please explain it with examples (15 marks).

PART 3: Multiple Choice

1. Black-box Testing attempts to find errors in which of the following categories
a. Incorrect or missing functions
b. Interface errors
c. Performance errors
d. All of the above

2. Condition coverage that executes possible combinations of condition outcomes of each decision is called as .
a. Black box Testing
b. White box Testing
c. Integration Testing
d. Acceptance Testing

3. Testing all possible paths through a module is:
a. The strongest whitebox coverage criteria
b. The strongest blackbox coverage criteria
c. Not possible to achieve if the module has loops
d. Both a and c are correct

4. Which is NOT true - The black box tester:
a. should be able to understand a functional specification or requirements document
b. should be able to understand the source code
c. is highly motivated to find faults
d. is creative to find the system's weaknesses

5. Unreachable code would best be found using: code inspections
code review
a coverage tool
a static analysis tool

6. Statement Coverage will not check for the following:
a) Missing Statements
b) Unused Branches
c) Dead Cod
d) Unused Statement

7. Verification is:
a) Checking that we are building the right system
b) Checking that we are building the system right
c) Making sure that it is what the user really wants
d) Performed by an independent test team

8. Which testing phase tests individual software modules combined together as a group?
a) Module testing
b) Integration testing
c) White Box testing
d) Software testing

9. A shopping website gives discount based on prices of total purchased items. Suppose customer purchases are below 2000 rs. then no discount,for purchases till 20000, it gives 10% discount and above 20000 it gives 15% discount. Which of the following sets of values lie in 3 different equivalence classes?

a) 1800,2000,8000
b) 2001,10000,20002
c) 1800, 2003,58,000
d) 100,1800,20001

10. A theme park charges entry fee based on age group. For children below 3 it charges nothing, for 3-10 it charges 500/-, for 10-18 it charges 800/-,then for 18-60 it charges 1000 and above 60 it charges 500 again. Using boundary value analysis, what will be the values to test if person pays 500 rs entry fee?

a) 0,2,3
b) 2,3,10,11,59,60,100,101
c) 2,3,10,11,59,60,100,101
d) 59,60,100,101

Solution Preview :

Prepared by a verified Expert
Software Engineering: Cosc4107 human computer interaction - briefly discuss the
Reference No:- TGS02739115

Now Priced at $50 (50% Discount)

Recommended (93%)

Rated (4.5/5)