Laboratory Work 4 SystemTesting
Laboratory Work 4 SystemTesting
System Testing
Airport Connection Check
• API function to check validity of a connection
between two flights.
• If the arrival airport of Flight A
differs from the departure airport
of Flight B, connection is invalid.
• If departure time of Flight B is too
close to the arrival time of Flight A,
connection is invalid.
• If an airport doesn’t exist, the
connection is invalid…
2
Airport Connection Check
validConnection(Flight flightA, Flight flightB)
returns ValidityCode
A Flight is a data structure consisting of:
● A unique identifying flight code
(string, three characters followed by four numbers).
● The originating airport code (three character string).
● The scheduled departure time from the originating airport
(in universal time).
● The destination airport code (three character string).
● The scheduled arrival time at the destination airport (in universal time).
3
Airport Connection Check
There is also a flight database, where each record contains:
● Three-letter airport code (three character string).
● Airport country (string).
○ If in the Schengen Area, this is indicated instead of the home country.
● Minimum domestic connection time
○ (integer, minimum num. minutes that must be allowed for flight connections to be valid).
● Minimum international connection time
○ (more time is required due to need to clear customs and meet regulations)
4
Creating System-Level Tests
Identify an Independently
Testable Function
Identify a function that can be tested in (relative) isolation.
5
Your Task
validConnection(Flight flightA, Flight flightB)
returns ValidityCode
6
Hints
• Two explicit parameters (Flight A and B) and one
implicit (airport database).
• Flight has multiple fields (potential choices)
• Database records have multiple fields (potential choices).
• Remember that representative values can interact. This
must be accounted for.
• IF constraints indicate when combinations of values should
be used for different choices.
7
Hints
• Consider how arrival time (flight A), departure time
(flight B), and minimum connection time interact.
• Consider that domestic and international connection
times can differ in length.
• Consider how the database contents can influence
behavior.
• Consider how input can be invalid or malformed
• (don’t just list “invalid input” but give clear examples).
8
Example to Start
FlightA FlightB
Choice: Originating Airport Code Choice: Originating Airport Code