0% found this document useful (0 votes)
12 views2 pages

Week 11 (Ans Only)

Week 11 (ans only) (3)

Uploaded by

bhmriaz.cse520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Week 11 (Ans Only)

Week 11 (ans only) (3)

Uploaded by

bhmriaz.cse520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sample solutions

Task 1.
The following test cases are created:
int[] sample1 = {1, 2, 3, 4, 5, 6};
int[] sample2 = new int[] {}; // initialise an empty array with size 0
int[] sample3 = {-1, 0};
int[] sample4 = {-1, 0 ,1};
int[] sampel5 = {1};
A test suite meeting the statement adequacy includes: sample1, sample3 (or sample4)
A test suite meeting the loop boundary adequacy includes: sample2, sample3 (or sample4), sample5
A test suite meeting the branch coverage criterion includes: sample1, sample3 (or sample4)

Task 2.
Acceptable answers can vary. A good answer should describe parameter char-
acteristics, not concrete values. Note, for example, that in our sample solution, times
of the outbound departure are classified by their relation to the inbound arrival, rather
than being selected from a set of concrete times. The distinction between parameter
values and parameter characteristics may be slight when parameters are orthogonal or
nearly so, but becomes important when the specification describes relations among
parameters.

Parameter: Arriving flight

Arriving flight code


malformed [error]
not in database [error]
valid
Originating airport code
malformed [error]
not in database [error]
foreign city (relative to transfer airport)
domestic city (relative to transfer airport)

Scheduled departure time


syntactically malformed [error]
out of legal range [error]
legal

Destination airport (transfer airport)


malformed [error]
not in database [error]
valid city
Note: we are using the destination aiport of the first flight as a base for calling
other airports “domestic” or “foreign,” so we don’t classify the destination airport
itself except as to being domestic or foreign.

Scheduled arrival time (t0)


syntactically malformed [error]
out of legal range [error]
legal
Parameter: Departing flight

Departing flight code


malformed [error]
not in database [error]
valid

Originating airport code


malformed [error]
not in database [error]
differs from transfer airport [error]
same as transfer airport

Scheduled departure time


syntactically malformed [error]
out of legal range [error]
before arriving flight time (t0)
between t0 and t0 + DCT [if ICT-greater]
between DCT and t0 + ICT [if ICT-greater]
more than t0 + max(ICT,DCT)
equal to t0 + DCT
equal to t0 + ICT
Destination airport code
malformed [error]
not in database [error]
foreign city (relative to transfer airport)
domestic city (relative to transfer airport)
Here “foreign” means the two cities (transfer airport and destination airport) have
unequal zones, and “domestic” means they have the same zone.
Scheduled arrival time

syntactically malformed [error]


out of legal range [error]
legal

Parameter: Airport connect time record

This parameter refers to the domestic and international connect time record corresponding
to the transfer airport.
Domestic connect time (DCT)
not found [error]
invalid [error]
valid

International connect time (ICT)


not found [error]
invalid [error]
-1 (not permitted)
less than domestic [single]
same as domestic
greater than domestic [property ICT-greater]

You might also like