Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Exam: Software Modelling and Design_ (SWEN30006_2022_SM1)

Started: Jun 8 at 12:53

Quiz Instructions

Instructions

• This exam is worth 60% of your final mark.

• All answers are to be given in English.

• The marks for each question are indicated at the beginning of each question.

• The 150 minutes for the exam includes time for reading, uploading diagrams, and some allowance for internet issues, as well as time answering questions.

• The marks are an indication of how much time should be spent on answering the question: 1 mark = 1 minute with time left over for the other activities

• Make sure you have paper, pencil, and eraser available, as well as a facility for photographing or scanning diagrams.

• Where a diagram is expected as part of an answer, we expect it to be legibly hand drawn, photographed or scanned, and uploaded into your answer. Hand-drawing on a tablet or similar is acceptable. 0 marks will be awarded for a diagram created using a diagramming or modelling tool.

• Make sure the images you upload are less than 1 MB in size (make sure you have practiced a process for this before the exam).

• It is your responsibility to make sure that diagrams used in your answers have been uploaded successfully and are easily readable.

This is an open book assessment. While you are undertaking this assessment you are permitted to:

• make use of the textbook, and lecture, workshop and other materials provided on the LMS

• make use of the example programs that have been part of this subject, including any code that you have written, provided that you include suitable attribution

While you are undertaking this assessment you must not

• make use of any messaging or communications technology

• capture any part of this exam for purposes other than completing it

• act in any manner that could be regarded as providing assistance to another student who is undertaking this assessment, or will in the future be undertaking this assessment.

The work you submit must be your own, based on your own knowledge and skills, without assistance from any other person.

Due to different students having different windows for completing this exam, on the day of the exam you must not discuss the content of the exam or your answers with any other person.

Academic Integrity Declaration

By commencing and/or submitting this assessment I agree that I have read and understood the University's Dolicy on academiG integrity. (httDs://academiGintegrity.unimelb.edu.au/#online~exarns)

I also agree that:

1. Unless paragraph 2 applies, the work I submit will be original and solely my own work (cheating);

2. I will not seek or receive any assistance from any other person (collusion) except where the work is for a designated collaborative task, in which case the individual contributions will be indicated; and,

3. I will not use any sources without proper acknowledgment or referencing (plagiarism).

4. Where the work I submit is a computer program or code, I will ensure that:

a. any code I have copied is clearly noted by identifying the source of that code at the start of the program or in a header file or, that comments inline identify the start and end of the copied code; and

b. any modifications to code sourced from elsewhere will be commented upon to show the nature of the modification.

Diagram Upload Instructions

Write your student number at the top right hand side of your diagram before taking a photo or scan.

Name your image file in the following form*: <student ID>_Q<number>.<ext>

For example: 123456_Q1.jpg

Unload your diagrams usinq this link (httDs://unimrlbcloud-

my.sharepoint.eom/:f:/9/Dersonal/philip dart unimelb edu au/EpNoC P43adJiUAsiUul63wBlyHL1qfQ QQaP9niJ;

Check that the dialogue shows your name in the final upload step.

Write 'UPLOADED' in the answer box for the question, together with any other text you want to include with your answer.

*lf you have more than one image, you can have them in the same file or you can upload multiple files using names like: 123456_Q1a.jpg and 123456_Q1b.jpg

Question 1

This question refers to the passage below which describes a Stock Management System (SMS) used by a company called Stock R Us. The sentence numbering is provided to make it easier for you to track the various elements of the description. Draw a use case diagram, covering this Stock Management System.

1. Stock R Us managers use SMS to purchase and pay for stock from a supplier. Sometimes a manager organises a purchase outside of SMS, however, SMS is still used to pay the supplier for that purchase.

2. The supplier will ship the stock order to Stock R Us. A stock clerk at Stock R Us will receive the shipment and record its arrival in SMS.

3. Stock R Us employs inspectors who control the quality of stock through SMS (primarily record keeping); sometimes quality control involves returning poor quality stock to the supplier, an activity which requires a manager's authorisation.

4. Stock R Us currently has contractors developing an upgraded version of the quality control capability of the system, with improved features for detecting and dealing with defective shipments, based on past records.

Please follow Diagram Upload Instructions (see start or end of exam) to submit your diagram.

Edit View Insert Format Tools Table

p 0 words </> / ::

Question 2

The passage below describes a smash repairs domain. The sentence numbering is provided to make it easier for you to track the various elements of the description. Draw a domain class diagram modelling the elements of the description.

1. Every car in the domain is assigned a unique car id; this identifier is used together with their model, date of release, and owner name.

2. Cars are classified as Standard or Prestige. All cars are also tagged with a value from a fixed list representing how damaged they are.

3. An unstructured description of the car's condition is kept for a standard car; this description can be updated at any time by a repair staff member.

4. For prestige cars, a sequence of problem reports is kept; each problem report has an unstructured description and is tagged with the date/time* and the repair staff member who wrote the problem report.

5. Every apprentice (junior repair staff member) has an assigned supervisor who is a mechanic (senior repair staff member).

6. All repair staff have a staff id. For each mechanic, we will know the date they qualified.

* No car will have more than one problem report with the same date/time.

Please follow Diagram Upload Instructions (see start or end of exam) to submit your diagram.

Edit View Insert Format Tools Table

12pt v Paragraph y B I V v v T2 v Ev 0 v :

画(J) 0 words </> / ::

Consider the description below of the Iccy System.

1. You are about to develop an application to support Insurance Call Centres (called Iccy).

2. The intention is that the application will meet a global need, and so will need to support a wide range of languages.

3. The system will be used by call centre staff handling calls in relation to insurance products regarding:

o inquiries about products held by the caller, o inquiries about products not held by the caller,

o purchases, and

。claims.

4. Some of the companies being targeted for sales have very large client bases; fast response times to Iccy queries by call centre staff will be critical in keeping client wait times low.

5. As the market for Iccy is expected to be quite lucrative, you have been given substantial resources for the development, however you have a tight deadline.

Part A

[10 Marks]

From the system description above, identify two architecturally significant requirements, one which is a functional requirement and one which is a non-functional requirement.

Using the system description above as an example, describe architectural analysis, why it is important, and why the requirements you have identified are architecturally significant.

PartB

[8 Marks]

Using one of the architecturally significant requirements you identified in Part A, illustrate the contents of a Technical Memo with the following sections:

1. Factors

2. Solution

3. Motivation

4. Unresolved Issues

5. Alternative solutions

Note: You are not expected to write a whole Technical Memo, but you are to use the identified requirement to show the kind of content that each section would have.

Edit View Insert Format Tools Table

函(J) 0 words </> / ::

You are assisting a team developing software for a Mars mission. The passage below describes a water purification system in support of this mission. Draw a state machine diagram for the system to help the team understand the requirements for the system, based on this description.

1. The system is designed to safely maintain the water quality in a Mars dwelling.

2. The system monitors regular updates on the current chlorine level in the water: current(chlorine).

3. If the chlorine level is detected to drop below min_chlorine, an chemical pump will start slowly adding chlorine until the level reaches min_chlorine + lower_margin.

4. If the chlorine level is detected to rise above max_chlorine, the chemical pump will start slowly adding neutraliser until the level reaches max chlorine  upper^margin.

5. When the chemical pump is running, it may detect a fault, in which case it will reset; once the reset is complete, the pump will immediately continue running as before the fault

6. At any stage, an emergency is detected, the water quality system will perform an emergency shutdown, and will remain in the shutdown state until the safe_restart signal is received. It will then go back to normal monitoring of water quality.

Please follow Diagram Upload Instructions (see start or end of exam) to submit your diagram.

Edit View Insert Format Tools Table

12pt v Paragraph B I V T2 El 0 v :

p 0 words </> / ::

Design Pattern Multiple Choice Questions (Questions 5-14)

Each of the following questions describes a design problem. For each question, select the pattern which best deals with the problem.

Question 5

A regulatory body is setting up to evaluate the safety of the software-based drivers of autonomous vehicles. They want to test the drivers in a common simulated environment; how do they deal with the fact that each driver is developed with a different interface?

O Controller

O Strategy

O Observer

O Adaptor

O Fapade

Question 6

MakeUp Inc. is developing a web/mobile system for online sales. A key system module is "MakeUp_RequestHandler" which handles all requests either from a mobile or a web browser. The request handling is very complex. It is not only handling sale requests but also includes other capabilities such as online enquiries, determining a loyalty program and validating coupons. How can we reduce the complexity?

O Strategy

O Decorator

O Protected Variation

O Adaptor

O Controller

Question 7

A website highlights fiction series for teenage readers. Some of the series or books in the series have been turned into movies. We want to allow users of the site to make limited queries relating to these movies, for example, to find out which actors had played a specific character in a specific book. How can we do this when we have access to a movie database with a general-purpose interface supporting create, retrieve, update and delete.

O Strategy

O Factory

O Fapade

O Adaptor

O Controller

Question 8

A company specialising in sports reporting provides periodic updates on various sports on their website. How can they add flexibility to their design to support making the information available to a variety of information consumers who might only be interested in specific sports or teams, and want the information as soon as it is available?

O Observer

O Facade

O Controller

O Composite

O Adaptor

Question 9

An engineer has developed a small hand-held device with hardware buttons to be used by people monitoring traffic flow. The button presses will be turned into software method calls, but which object should handle the calls?

O Composite

O Singleton

O Facade

O Controller

O Strategy

Question 10

A software team leader Leslie discovers that Jessie, a new team member, has created a specific class in the design that is used in the following way: on rare occasions when Jessie is unsure as to where to put a method, Jessie puts it in this class. How does Leslie explain the problem with this to Jessie?

O Facade

O Low Cohesion

O Pure Fabrication

O High Coupling

O Controller

Question 11

A computer game company is updating their game engine to support a more sophisticated damage model, so that events such as explosions or fires can damage many related targets at once, for example, a building, the people in the building, and the objects carried by the people in the building. How can they achieve this without making the design too complex?

O Facade

O Observer

O Strategy

O Adaptor

O Composite

Question 12

Modular Homes Pty Ltd assembles houses from pre-build standardised rooms. They are introducing an additional feature to their range which need to be added to their ordering system. With this feature, their customers can select properties (e.g., colour scheme and quality of fit-out) which will apply to the whole house (every room), some rooms, or even a unit in the house (e.g., a cupboard). What is good basis for designing this feature?

O Decorator

O Controller

O Composite

O Information Expert

O Singleton

Question 13

How can a simulation framework make the simulated time-of-day available throughout the framework?

O Observer

O Facade

O Strategy

O Singleton

O Factory

Question 14

A corporation has a private network which supports limited video connections between its sites and wants to make use of these in an application. Since it can take time for a connection to be established, it is desirable to be able to allocate an existing free connection if one is available rather than creating a new one every time. How can an object representing a connection be provided, at the specific place in the application where a video connection is required?

O Adaptor

O Composite

O Controller

O Factory

O Singleton

The java code below is for the next question.

java.util.ArrayList; java.util.Arrays; java.util.List;





j bile

class Cafe {

puDLic interface ICoffee { float sized ; int price();

public class Coffee implements ICoffee {

public float size() { return 250; } // 250 ml = 1 cup of coffee public int priceO { return 300; } // $3 for a coffee - cheap!

public: abstract :Lass Extra inplenents ICoffee { public ICoffee

Extra CICoffee

coffee; coffee)

{ this.coffee coffee; }

extends coffee)

public class Cream

Cream CICoffee

public float size() { return coffee.size() + 50; } // 50 ml of cream

public int priced { return coffee.priceO + 60; } // ?0.60 fc < ©己门-cheap1

Extra {

{ super(coffee}; }

public class Large extends Extra {

Large (ICoffee coffee) 4 : :)er(coffee): }

public float sizeO { return 1.5f** offee.sizet]; } // " nuci' ageir

public int pricel) { return Math.round(l.2f*coffee.price()); } // 20%

higher to nearest whole cent

public class CoffeeMaker {

public ICoffee makecoffee(List<String> coffeespec) { ICoffee coffee;

if (coffeeSpec.isEmpty()) { coffee = new Coffeet);

} else (

String extra coffeeSpec.removef indec e) switch (extra) {

case "I " coffee 二」Cream(makeCoffee(coffeeSpec)); case nLergej : coffee = new Large(uiakeCoffee(coffeeSpec)); default: coffee = null;

break; break;

return coffee;

® public static voia mainCStrinqlJ args} {

List<String> coffeeSpec = new ArrayListoCArrays.osListCCr-ai

ICoffee coffee

System.out.printin('iz

ar

new CafeO .ne-j CoffeeMakerO .makeCoffee(coffeeSpec);

+ coffee.sizeO + ' : Prii:^ - " + coffee.priceO);

Question 15

The Cafe code above is an implementation of two design patterns.

1. [6 marks] Identify each of these patterns and state how the elements in the code implement each of the patterns.

2. [4 marks] Show the output which running main() would produce.

3. [5 marks] Detail the code changes required to make this change: Add a new Extra called Choc which adds 30 mis of chocolate for $0.80.

Edit View Insert Format Tools Table

向① 0 words </> / ::

The following code provides a way to transform a list of images of people in a specified organisation into a list of person ids. The code is based on the adaptor pattern.

This code is used in the next two questions. In answering the questions, you should assume that this code works correctly, and that any missing elements simply are not shown here.

class Image {/♦...*/}

class Personld { /* …★/}

interface IFaceRecAdaptor {

void setOrgldfint orgld);

List<PersonId> getIdents(List<Image> images);

class FaceRecLibAdaptor implements IFaceRecAdaptor { private Integer orgld = null;

private final FaceRecLib adaptee = new FaceRecLibO: public void setOrgldfint orgld) { this.orgld = orgld;

}

public List<PersonId> getIdents(List<Image> images) { return adaptee.findldents(orgld, images);

}

class FaceRecServiceAdaptor implements IFaceRecAdaptor { private Integer orgld = null;

maL racehecbervice public void setOrgId(int orgld) { this.orgld = orgld;

} public List<PersonId> getIdents(Li adaptee. startSessionO; adaptee.sendOrg(orgld);

List<PersonId> ids = new Array for(Image image: images) { Personld id = adaptee.look ids.add(id);

<

private List<Image> ina private IFaceRecAdaptor

List<Image> loadlmagest List<PersonId> run(bool (networkActive) { faceRe: new FaceRecS } else

Question 16

Draw a design class diagram (DCD) for the design represented in the code above.

Show relationships visually in the DCD where appropriate.

In the DCD, where a class implements an interface, the methods of the interface do not need to be repeated in the implementing class.

Please follow Diagram Upload Instructions (see start or end of exam) to submit your diagram.

Question 17

A team mate of yours who is unfamiliar with the adaptor pattern is taking over maintenance and extension of the above code. You'd like to explain to them how this code uses the adaptor pattern to solve the problem of dealing with a library and a service with different interfaces. Draw a sequence diagram which illustrates how the code above operates to aid in your explanation. Make sure that diagram illustrates the role of polymorphism in the solution. Provide text where useful either on the diagram or in the answer box to aid your explanation to your team mate.

Please follow Diagram Upload Instructions (see start or end of exam) to submit your diagram.

Diagram Upload Instructions

Write your student number at the top right hand side of your diagram before taking a photo or scan. Name your image file in the following form*: <student ID>_Q<number>.<ext>

For example: 123456_Q1.jpg

Uuload your diagrams using this link (httDs://unimelbcloud・

my.shareDQint.eom/:f:/9/DersQnal/0hiliD dart unimelb edu au/EoNoC P43adJiUAsiUDl63wBlyHL1afQ QQaP9niJ;

Check that the dialogue shows your name in the final upload step.

Write 'UPLOADED' in the answer box for the question, together with any other text you want to include with your answer.

*lf you have more than one image, you can have them in the same file or you can upload multiple files

using names like: 123456_Q1a.jpg and 123456_Q1b.jpg