Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The aim of this problem is to develop a test suite based on the N + approach. The following state machine models an E -

The aim of this problem is to develop a test suite based on the N+ approach.
The following state machine models an E-booking system used in airports
for passenger self-check-in.
Ebook.zip contains an implementation of the E-booking system's state machine
system (the EbookingControl class) with a basic simulator.
Question 2.1(10%)
Draw up a round-trip path tree based on the state model of the
E-booking system.
Question 2.2(15%)
Provide compliance test suites and sneak paths for the
E-booking system. Each test case must have :
- An identifier
- A description of the test preparation (e.g. the objects required for the
the test case)
- A test sequence in terms of start state, event, guard condition / expected action
condition/expected action and expected system response (new state). Here's the ebooking class: package ebook.controller;
public class EbookingControl {
enum Status {IDLE, LOOKINGUPRESERVATION, DISPLAYINGFLIGHT, WAITFORRESPONSE,
WAITFORBAGGAGENUMBERS,WAITFORDOCUMENTSWITHRAWAL, SOUNDINGALARM}
private Status current;
private IEbookingReaction reactions;
public EbookingControl(IEbookingReaction react){
setReactions(react);
// set initial state
setCurrent(Status.IDLE);
}
public Status getCurrent(){
return current;
}
public void setCurrent(Status current){
this.current = current;
}
public IEbookingReaction getReactions(){
return reactions;
}
public void setReactions(IEbookingReaction reactions){
this.reactions = reactions;
}
public void reservationNumber() throws EbookingEventNotDefineException {
if (current == Status.IDLE){
reactions.lookupReservation();
setCurrent(Status.LOOKINGUPRESERVATION);
} else {
throw new EbookingEventNotDefineException("reservationNumber");
}
}
public void found() throws EbookingEventNotDefineException {
if (current == Status.LOOKINGUPRESERVATION){
reactions.displayFlight();
setCurrent(Status.DISPLAYINGFLIGHT);
} else {
throw new EbookingEventNotDefineException("found");
}
}
public void notFound() throws EbookingEventNotDefineException {
if (current == Status.LOOKINGUPRESERVATION){
reactions.errorMessage();
reactions.askForReservationNumber();
setCurrent(Status.IDLE);
} else {
throw new EbookingEventNotDefineException("notFound");
}
}
public void confirm() throws EbookingEventNotDefineException {
if (current == Status.DISPLAYINGFLIGHT){
reactions.askForBaggages();
setCurrent(Status.WAITFORRESPONSE);
} else {
throw new EbookingEventNotDefineException("confirm");
}
}
public void change() throws EbookingEventNotDefineException {
if (current == Status.DISPLAYINGFLIGHT){
reactions.displayReservationDetails();
reactions.askCustomerWishToChange();
} else {
throw new EbookingEventNotDefineException("change");
}
}
public void cancel() throws EbookingEventNotDefineException {
if (current == Status.DISPLAYINGFLIGHT ||
current == Status.WAITFORBAGGAGENUMBERS ||
current == Status.WAITFORDOCUMENTSWITHRAWAL ||
current == Status.WAITFORRESPONSE ){
reactions.askForReservationNumber();
setCurrent(Status.IDLE);
} else {
throw new EbookingEventNotDefineException("cancel");
}
}
public void no() throws EbookingEventNotDefineException {
if (current == Status.WAITFORRESPONSE){
reactions.printBoardingPass();
reactions.ejectBoardingPass();
setCurrent(Status.WAITFORDOCUMENTSWITHRAWAL);
} else {
throw new EbookingEventNotDefineException("no");
}
}
public void yes() throws EbookingEventNotDefineException {
if (current == Status.WAITFORRESPONSE){
reactions.askForNumberOfPieces();
setCurrent(Status.WAITFORBAGGAGENUMBERS);
} else {
throw new EbookingEventNotDefineException("yes");
}
}
public void numberOfPieces() throws EbookingEventNotDefineException {
if (current == Status.WAITFORBAGGAGENUMBERS){
reactions.printBoardingPass();
reactions.ejectBoardingPass();
reactions.printBaggageSlips();
reactions.ejectBaggageSlips();
reactions.displayProceedsToAgentMessage();
setCurrent(Status.WAITFORDOCUMENTSWITHRAWAL);
} else {
throw new EbookingEventNotDefineException("numberOfPieces");
}
}
public void withdrawDocuments() throws EbookingEventNotDefineException {
if (current == Status.WAITFORDOCUMENTSWITHRAWAL){
reactions.askForReservationNumber();
setCurrent(Status.IDLE);
} else if (current == Status.SOUNDINGALARM){
reactions.stopAlarm();
reactions.askForReservationNumber();
setCurrent(Status.IDLE);
} else { throw new EbookingEventNotDefineException("withdrawDocuments"); }
} public void timeout() throws EbookingEventNotDefineException {
if (current == Status.WAITFORDOCUMENTSWITHRAWAL){
reactions.startAlarm();
setCurrent(Status.SOUNDINGALARM);
} else {
throw new EbookingEventNotDefineException (event:"timeout"); }}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions