Case Study part 1: from UML to Java IM103 week 11 Part 1 p506 Learning objectives By the end of this lecture you should be able to: specify system requirements.

Slides:



Advertisements
Similar presentations
Lecture 10 Flow of Control: Loops (Part 2) COMP1681 / SE15 Introduction to Programming.
Advertisements

At the Airport made by Zorya I.V..
Airport Procedures 101. #1 Arrive to the airport Many people take a taxi or get a friend to drop them off to avoid having to pay to park at the airport.
Login to eShip Global eShip Global is an online shipping service providing access to contracted shipping carriers for outbound letters and packages. For.
L e a r n I n g... T h e I C A T W a y. Img. 1 Webtrak can be accessed by a link on the ICAT Logistics Inc homepage OR by going to
Page 1 of 36 The Public Offering functionality in Posting allows users to submit requests for public offerings of Petroleum and Natural Gas(PNG) and Oil.
Parallel and Distributed Simulation
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington UML for design: Class Diagrams.
Abstraction Lecture-4. ADT example: London Underground Map.
Time & Labor & Absence Management Requesting Time Off Employee Self-Service (ESS) Absence Entry.
QI Usage Requests: Part 2 Managing, Approving & Ordering.
In the top right hand corner you will type in your package code in the box that says “Place Order.” Then you will click “Go.”
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Systems Analysis and Design in a Changing World, Fourth Edition
© The McGraw-Hill Companies, 2006 Chapter 9 Software quality.
© 2006 Pearson Addison-Wesley. All rights reserved7A-1 Chapter 7 Stacks.
MORE ON CLASS MODELS Lecture Outline Aggregation and composition Roles Navigability Qualified association Derived association Constraints Association.
COMP 5138 Relational Database Management Systems Semester 2, 2007 Lecture 8A Transaction Concept.
© The McGraw-Hill Companies, 2006 Chapter 7 Implementing classes.
Chapter 7: The Object-Oriented Approach to Requirements
Temporary Removal Request Demo 1.Role of Unit Maker 1.Preparation of Temporary Removal RequestPreparation of Temporary Removal Request 2.Submission of.
The Registration Experience Student Registration via Self-Service.
This tutorial is a “suggested workflow” to help with sending documents to Referring Providers via Starpanel. The Provider Communication Wizard is an application.
Object Oriented Software Development
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
1 © 2005 course technology University Of Palestine Chapter 6 Storyboarding the User’s Experience.
Houston Flight Standards District Office Manager Holly W. Geiger
Use Case modelling 1. Objectives  Document user requirements with a model  Describe the purpose of an actor and a use case  Construct a use case model.
Nachos Phase 1 Code -Hints and Comments
Understand Application Lifecycle Management
ESS Employee Self Service System. Objective The objective of introducing ESS – Employee Self Service  To Empower Employees  To Expedite Leave Application.
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
© 2005 course technology1 1 1 University Of Palestine UML for The IT Business Analyst A practical guide to Object Oriented Requirement Gathering Hoard.
ITEC 352 Lecture 18 Functions in Assembly. Functions + Assembly Review Questions? Project due on Friday Exam –Average 76 Methods for functions in assembly.
Sub-Contracting Request Demo 1.Role of Unit Maker 1.Preparation of Sub-Contracting RequestPreparation of Sub-Contracting Request 2.Submission of Sub-Contracting.
Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)
1 Intro to Java Week 12 (Slides courtesy of Charatan & Kans, chapter 8)
RECITE A PRAYER…(15 SECONDS). ATM TOPIC 1. INTRODUCTION TO AIR TRAFFIC MANAGEMENT,TYPE OF CONTROL AREAS & FLIGHT PLAN 2. AERODROME CONTROL 3. AREA CONTROL.
Data structures Abstract data types Java classes for Data structures and ADTs.
Program Development Cycle Modern software developers base many of their techniques on traditional approaches to mathematical problem solving. One such.
Chapter 9 Applying UML and Patterns -Craig Larman
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Chapter 7 The Practices: dX. 2 Outline Iterative Development Iterative Development Planning Planning Organizing the Iterations into Management Phases.
Grade Book Database Presentation Jeanne Winstead CINS 137.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 6: Functional Modeling.
Lab 5 CPIT 250 System Analysis and Design.
Systems Analysis and Design in a Changing World, Fourth Edition
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
Classes, Interfaces and Packages
CNG 140 C Programming (Lecture set 12) Spring Chapter 13 Dynamic Data Structures.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Students will go to In the top right hand corner the student will type in their package code in the box that says “Place.
Programming Fundamentals1 Chapter 7 INTRODUCTION TO CLASSES.
UML DESIGN By: J Kamala Ramya Y Devika
Campus Mail Services HOW TO USE THE CMS PACKAGE TRACKING SYSTEM UI Business Mail Only (no student mail is tracked on this system) TRACK A PACKAGE FLAG.
Comp 1100 Entity-Relationship (ER) Model
External Scope CECS 277 Mimi Opkins.
Chapter 5 System modeling
Unified Modeling Language
OO Domain Modeling With UML Class Diagrams and CRC Cards
Marking a Piece of Equipment for Transfer/Scrap/Withdrawal
Object Oriented Programming in java
Basic Concepts of Algorithm
Presentation transcript:

Case Study part 1: from UML to Java IM103 week 11 Part 1 p506 Learning objectives By the end of this lecture you should be able to: specify system requirements by developing a use case model; annotate a composition association on a UML diagram; develop test cases from behaviour specifications found in the use case model.

System overview The application that we will develop will keep track of planes using a particular airport. So as not to over complicate things, we will make a few assumptions there will only be four runways at the airport; there will be no concept of gates for arrival and departure, passengers will be met at a runway on arrival and sent to a runway on departure; planes entering airport airspace and requesting to land are either given permission to land on a free runway, or are told to join a queue of circling planes until a runway becomes available; no planes are housed at the airport; planes boarding and subsequently requesting take-off must therefore have previously landed at the airport; once a plane departs from the airport it is removed from the system; the detail of arrival and departure times will not be addressed.

A common way to document requirements in UML is to develop a use case model. A use case model consists of use case diagrams and behaviour specifications. A use case diagram is a simple way of recording the roles of different users within a system and the services that they require the system to deliver. Once a list of use cases has been identified, behaviour specifications are used to record their required functionality Requirements analysis and specification

use case diagram for the airport application Register flight with airport Record flights request to land arrival Record flight landing Record flight take off Airport Information Officer Air traffic controller Allow passengers to board List arrivals List departures

Initial analysis of the airport application. Runway number allocated book() vacate() isAllocated() Plane flightNumber cityOfOrigin status upgradeStatus() 0..1 permitted to land on

Runway number: int allocated: boolean book() vacate() isAllocated(): boolean Plane flightNumber: String cityOfOrigin: String status: int theRunway:Runway upgradeStatus() 0..1 permitted to land on Initial design of the Plane and Runway classes.

Airport -list: PlaneList -runway: Runway[] +RUNWAY_TOTAL:int = 4 +Airport() +registerFlight(String, String) +arriveAtAirport(String): int +landAtAirport(String) +readyForBoarding(String, String) +takeOff(String): Plane +getArrivals():PlaneEnumeration +getDepartures:PlaneEnumeration -nextFreeRunway(): Runway nextFreeRunWay() : Runway PlaneList -planes: Hashtable -circlingQ: Vector +PlaneList() +register (String, String) +circle (String) +descend(String, Runway) +land(String, int) +boarding(String, String) +leave (String) +listArrivals(): PlaneEnumeration +listDepartures(): PlaneEnumeration +isInList(String):boolean +getPlane(String): Plane +getRunwayNumber() -nextToLand():Plane Runway -number: int -allocated: boolean +Runway(int) +getNumber():int +isAllocated():boolean +book() +vacate() Plane -flightNumber: String -cityOfOrigin: String -status: int -theRunway: Runway +Plane(String, String) +getFlightNumber():String +getCity():String +getStatus():int +getRunway():Runway +getRunwayNumber(): int +isAllocatedARunway():boolean +allocateRunway(Runway) +vacateRunway() +upgradeStatus() +changeCity(String) 0..1 permitted to land on * 4 updates Detailed design for the airport application

Composition in UML When an object from one class contains a fixed number of objects from another class, this special kind of association is called a composition Airport Runway 4 The UML notation for composition is the same as that for aggregation, except that the diamond is filled rather than hollow

Implementation It makes sense to bundle these classes together into a single package ( airportSys). This means that all our classes will begin with the following package statement: package airportSys; It is a good idea to hide implementation level exceptions so define a general AirportException class. Outline of this and all other classes can be found in Charatan and Kans Chapter 20 section 20.5.

Testing the airport application A useful technique to devise test cases during integration testing is to review the behaviour specifications of use cases, derived during requirements analysis. Often, there are several routes through a single use case. Different routes through a single use case are known as different scenarios. During integration you should take the place of the user and make sure that you test each scenario for each use case - this is often known as scenario testing

"Record flights request to land" use case: An air traffic controller records an incoming flight entering airport airspace, and requesting to land at the airport, by submitting its flight number. As long as the plane has previously registered with the airport, the air traffic controller is given an unoccupied runway number on which the plane will have permission to land. If all runways are occupied however, this permission is denied and the air traffic controller is informed to instruct the plane to circle the airport. If the plane has not previously registered with the airport an error is signalled.

Identifying scenarios Scenario 1 An air traffic controller records an incoming entering airport airspace, and requesting to land at the airport, by submitting its flight number, and is given an unoccupied runway number on which the plane will have permission to land. Scenario 2 An air traffic controller records an incoming entering airport airspace, and requesting to land at the airport, by submitting its flight number. The air traffic controller is informed to instruct the plane to circle the airport as all runways are occupied. Scenario 3 An air traffic controller records an incoming entering airport airspace, and requesting to land at the airport, by submitting its flight number. An error is signalled as the plane has not previously registered with the airport

Current state of system DEPARTURES FLIGHTTO RUNWAY BA123 London 1 TK999 Tokyo 2 ARRIVALS FLIGHTFROM STATUS RUNWAY LF016Moscow Landed 3 SP001 Madrid Not yet arrived US642 Florida Not yet arrived

Testing Scenario 1 The first scenario should be the simple case of an arriving plane being told to land on a particular runway. So far, runways 1, 2 and 3 are occupied but runway 4 is unoccupied. If either flight SP001 or US642 arrives at the airport now, it should be told to land at the airport. Enter flight number: SP001 Land on runway 4 As expected this plane is asked to come in and land on runway 4.

All runways are now occupied so we are in a position to test the second scenario of the "Record flights request to land" use case. In this scenario, the arriving flight should be told to circle the airport. Testing Scenario 2 Enter flight number: US642 No runway available, circle the airport The registered flight US642 arrives at the airport and is correctly told to circle the airport.

In this scenario, a flight arrives at the airport without first registering; this should raise an error. Testing Scenario 3 Enter flight number: CK001 AirportException: this flight has not yet registered at PlaneList.getPlane(Compiled Code) at PlaneList.circle(PlaneList.java:32) at Airport.arriveAtAirport(Compiled Code) at RunAirport.option2(Compiled Code) at RunAirport.main(RunAirport.java:30) Here, flight CK001 has not previously registered with the airport; so an error is correctly flagged followed by a stack trace of the exception.

The stack trace A stack trace lists the original method that generated the exception object (along with its associated class), then methods that received that exception object are listed. This trace can then help pinpoint errors quickly during the testing phase. The stack trace is obtained (and printed to the console) by calling a printStackTrace method as follows: catch (AirportException e) { e.printStackTrace(); }