Premium Resources

We know the secret of your success

M256/K Software development with Java Undergraduate Level Course Examination 2013

$39.00

PAPER TITLE: SOFTWARE DEVELOPMENT WITH JAVA

DATE: Friday, 11 October 2013

 

PART 1

Question 1            Which two of the following statements about software development are true? (Select two options)

  1. Testing of the system should not take place until after the implementation phase.
  2. Developing dynamic models is concerned with modelling appropriate interactions among objects in order to achieve the tasks required of the system.
  3. The initial structural model is the final result of the evolution of the implementation model.
  4. The Waterfall method is an example of a predictive software development method.
  5. Maintenance of a system is concerned only with fixing emerging problems and fine-tuning the system to improve its performance.

 

ANSWERS(Purchase full paper to get all the solution)

1. Developing dynamic models is concerned with modelling appropriate interactions among objects in order to achieve the tasks required of the system.

5. Maintenance of a system is concerned only with fixing emerging problems and fine-tuning the system to improve its performance.

 

 

The following diagram illustrates aspects of a football league administration system.

Figure 1

 

Question 2            Based on the information in Figure 1 which two of the following statements are true? (Select two options)

  1. The diagram shows a collaboration between team9 and match2.
  2. The diagram shows that Red Riders is an attribute of team9.
  3. The diagram shows that the state of match2 is date, homeGoals and awayGoals.
  4. The diagram shows that name is an attribute of team5.
  5. The diagram shows the state of part of the system at a particular point in time.

 

 

Question 3            Which two of the following statements relating to the requirements specification process are true? (Select two options)

  1. The requirements document should include details of the budget.
  2. The following is an example of a behavioural requirement:

‘A book for which there is a waiting list may only be borrowed by the library member at the head of the waiting list.’

  1. The following is an example of a behavioural requirement:

‘The memory requirements of the software must not exceed 15GB.’

  1. The requirements document does not usually contain any information about testing the system.
  2. The main goal of requirements analysis is to make the requirements document as general as possible in order to reduce constraints on the developer.

 

 

Question 4            Which two of the following statements about conceptual modelling are true? (Select two options)

  1. A relationship that is not a generalisation and that involves three or more classes can be modelled by a single class that has associations with each of the classes involved in the relationship.
  2. A conceptual model is a precise specification of the software classes that will be required for the system.
  3. A significant category of abstract entities in the system domain should always be represented by an abstract class in the conceptual model.
  4. In M256, each invariant in the conceptual model gives rise to a corresponding invariant in the initial structural model.
  5. An invariant is an attribute of a conceptual class which has the same value for all objects of that class.

 

 

The following extract from a requirements document and an incomplete class diagram are for use in Questions 5 and 6.

Question 5            Based on the information above, which two of the following statements are true? (Select two options)

  1. The multiplicity of the isStudentMemberOf association at the

Department end should be 0..1.

  1. The multiplicity of the isStudentMemberOf association at the

Department end should be 0..200.

  1. The multiplicity of the isStudentMemberOf association at the

Student end should be 0..200.

  1. The multiplicity of the isStaffMemberOf association at the Department end should be 1.
  2. The multiplicity of the isStaffMemberOf association at the

Department end should be 5..30.

  1. The multiplicity of the isStaffMemberOf association at the

Lecturer end should be 0..30.

 

Question 6            Based on the information provided in Figure 2, which two of the following statements are true? (Select two options)

  1. A lecturer can have no more than two mentors.
  2. A lecturer can have any number of mentors including no mentor.
  3. mentors is a derived association.
  4. The following is an invariant that is required in addition to the class diagram, as part of the conceptual model:

If aLecturer and bLecturer are Lecturer objects that are linked to the same Department object then aLecturer and bLecturer must be linked to each other.

  1. It is possible for a lecturer both to have no mentor and to not be a mentor.

 

 

Question 7            Which two of the following statements are true? (Select two options)

  1. If a method does not return anything then its specification does not require a post-condition.
  2. A defensive copy of an object must be immutable.
  3. There may be potential for a privacy leak when an instance variable references a mutable object.
  4. If an object is encapsulated then the integrity of that object is guaranteed.
  5. In a Java method's Javadoc we can include details of the runtime exceptions that the method throws as a way of identifying the preconditions of the method.

 

 

Question 8            Which two of the following statements about object-oriented software development are true? (Select two options)

  1. A benefit of design with reuse is that maintenance of the operational system is made easier.
  2. One challenge of design with reuse is the frequent lack of appropriate readily available pre-existing components that match your requirements exactly.
  3. In designing a component within a system for reuse in other systems it is important to ensure that its cohesion is minimised.
  4. A method’s post-condition states what the method must achieve regardless of whether the pre-condition is satisfied or not.
  5. Incremental software development is usually incompatible with component-based software development.

 

Question 9            The message answers, message answer 1 and message answer 2, are missing from the sequence diagram in Figure 3. Which one of the following statements correctly describes the missing message answers? (Select one option)

  1. message answer 1: {instructor2, instructor5}

message answer 2: {(session4, instructor2), (session6, instructor5)}

  1. message answer 1: {member73, (session4, instructor2),(session6, instructor5)} message answer 2: : {member73, (session4, instructor2),(session6, instructor5)}
  2. message answer 1: {(session4, instructor2), (session6, instructor5)}

message answer 2: {(session4, instructor2), (session6, instructor5)}

  1. message answer 1: {(session4, session6), (instructor2, instructor5)}

message answer 2: {(session4, session6), (instructor2, instructor5)}

 

 

Question 10          Which two of the following statements could be a correct identification of the walk through steps indicated by the notes X, Y, and Z in the sequence diagram in Figure 3? (Select two options)

  1. X is step 1; Y is step 2; Z is step 4.
  2. X is step 1; Y is step 3; Z is step 4.
  3. X is step 1; Y is step 2; Z is step 3.
  4. X is step 2; Y is step 3; Z is step 5.
  5. X is step 2; Y is step 3; Z is step 4.

 

Question 11          On the basis of information provided in Figure 3, which two of the following statements are true? (Select two options)

  1. The association takesPartIn requires to be navigated from Session to Member.
  2. The association hasInstructors requires to be navigated from

LeisureCentreCoord to Instructor.

  1. A method whose specification begins as follows should be specified for the protocol of LeisureCentreCoord:

Map getSessionsAndLeaders ().

  1. A method whose specification begins as follows should be specified for the protocol of LeisureCentreCoord:

Map getSessionsAndLeaders (Member aMember).

  1. A method whose specification begins as follows should be specified for the protocol of Session:

Instructor getLeader().

  1. A method whose specification begins as follows should be specified for the protocol of Member:

Instructor getLeader().

 

 

Question 12          Which two of the following statements about designing software are true? (Select two options)

  1. If the coordinating class does too much work then the cohesion of other core system classes may be reduced.
  2. An invalid scenario is a scenario in which a post-condition is not met.
  3. The coordinating object is the information expert for all of the tasks required of the core system.
  4. If there is no direct association between two classes then there is no coupling between them.
  5. A design based on forking typically introduces more coupling than does a design based on cascading.

 

 

Question 13          Which two of the following statements about detailed design and implementation are true? (Select two options)

  1. Any class that is used more than once in the system that is being developed is termed a utility class.
  2. Enumerated types in Java are used to implement sorted sets of numbers.
  3. The purpose of refactoring is to make changes to the behaviour of a system without changing its structure.
  4. A link reference may be implemented using a single object that is not a collection of other objects.
  5. If an instance variable references an immutable object, it may be possible to change the value of the instance variable.

 

 

Question 14          Which two of the following statements about implementation and testing are true? (Select two options)

  1. Dynamic models such as walk-throughs and sequence diagrams can be used to guide the developer in coding methods.
  2. Verification addresses the question “Has the system been built right?” and validation addresses the question “Has the right system been built?”.
  3. In test-driven development all test cases are specified as soon as the initial structural model has been created.
  4. The fixture for a particular test specifies both data to be used during the test and the expected result of the test.
  5. Acceptance testing is a form of verification testing.

 

Question 15          Which two of the following statements about the M256 approach to implementing software in Java are true? (Recall that in M256 the first code iteration is the first stage in implementing a core system.) (Select two options)

  1. Implementing the methods required for a particular use case is always based on a single scenario.
  2. Attributes and links should be implemented in the first code iteration.
  3. An implementation model may be used as a blueprint for coding the core system.
  4. In the first code iteration getter methods should not be implemented.
  5. Constructors are not normally written in the first code iteration.

 

 

Question 16          Which two of the following statements about user interfaces and their design are true? (Select two options)

  1. All graphical user interfaces use direct manipulation.
  2. If a widget is easy to see, it follows that it has good visibility.
  3. With direct manipulation, complex outcomes can typically be achieved by a number of simple incremental and reversible steps.
  4. Think-aloud is an example of a usability testing technique.
  5. Affordance refers to the extent to which a widget’s purpose is apparent.

 

Question 17          Which two of the following statements about user interfaces and their design are true? (Select two options)

  1. A storyboard is a diagrammatic representation of a user interface.
  2. Efficiency, in the context of a user interface, is a measure of how well the interface enables the user to get the right thing done.
  3. Functionality refers to the extent to which a system can be used to achieve goals effectively and efficiently.
  4. Learnt affordance takes into account the effect of a user’s background and experience on their use of a widget.
  5. A user-centred design is focused on optimising the satisfaction of all users of an interface.

 

 

Question 18          Which two of the following statements about building a graphical user interface (GUI) are true? (Select two options)

  1. The core system must have a reference to some objects in the GUI.
  2. In M256, in the communication between the core system and the GUI, the core system usually acts both as a server and as a client.
  3. When implementing a Java GUI, one visual component may be nested inside another.
  4. The first stage in building a GUI is normally to build a textual version of the interface.
  5. In M256, in the communication between the core system and the GUI, the core system usually acts solely as a server.

 

 

Question 19          Which two of the following statements are true? (Select two options)

  1. A UML package diagram can be used to illustrate a perspective of the logical architecture of a system but need not correspond to the eventual structure of the implemented system.
  2. In a classic three-tiered architecture, the middle tier is normally the co-ordinating object.
  3. Concurrency control is the regulation of access to shared data.
  4. The concept of cascading can help you decide where to locate responsibilities for managing concurrent access.
  5. The Rational Unified Process (RUP) is a waterfall model of development.

 

 

Question 20          Which two of the following statements are true? (Select two options)

  1. The term agile software development refers to the development of software that needs to quickly adapt to changing user requirements when the software is in operation.
  2. The Publish-Subscribe pattern can be used to keep interfaces up to date in a multi-user system.
  3. The Singleton design pattern describes a solution to the following problem:

Different objects need to react to changes in another object to which they are otherwise unrelated.

  1. A structural design pattern is one which is concerned with how the objects in a system are initiated.
  2. In M256 the coordinating object is an instance of a Façade class.

 


 

 

PART 2

Question 21 (20 marks)           The following is an extract from a requirements document for a part of a college administration system, which keeps track of students and their studies within a single 20-week college semester.

System domain

Students at the college must be registered for at least one of the many different modules that the college presents. A student can not have more than four registrations for modules in any one semester; all these registrations must be for different modules. Each module may have up to sixty registered students and has a unique name. Each module holds teaching sessions (seminars and lectures) . All modules hold at least twenty teaching sessions. Each teaching session has a student seating capacity which is a limit on the number of students that can attend it.

The college employs lecturers to teach modules and to present lectures and to lead seminars. Each lecturer is appointed to teach at most five modules in a semester. There is no restriction to the number of lecturers teaching a module. Lecturers can only present lectures and lead seminars held by the modules that they are employed to teach.

Lecturers lead at most one seminar in each of the 20 weeks of the semester but can present any number of lectures. Lectures are presented by a single lecturer but seminars can be led by more than one lecturer. All lectures last one hour but seminars can have different durations.

For each teaching session a record is kept of the students who attend it. A student cannot attend a seminar held by a module he or she is not registered for. The number of students attending a teaching session must not exceed the seating capacity of the teaching session.

Use cases

List Student's Modules. The administrator identifies a student. For each module registration for this student the system displays the name of the module and the date of registration for the module.

List Module's Students. The administrator identifies a module. For each student registered for the module the system displays the student's name and personal identifier.

Register Student on Module. The administrator identifies a student and a module. The student must not already be registered for the module. If the student is already registered for four modules the system informs the administrator and takes no further action; otherwise the system records that the student is registered on the module, and records the date of the registration.

List Lecturer’s Teaching Sessions for Date. The administrator identifies a lecturer and provides a date. The system displays the name of the lecturer and the time of each of the lecturer’s teaching sessions on the given date. The theme of each lecture and the duration of each seminar are also displayed.

Note that in this question you are dealing with a conceptual model. You will lose marks for including in your answers anything that is not relevant for a conceptual model.

Figure 4 is an incomplete class diagram for a conceptual model with four classes unnamed and all the associations omitted.

 

 

  1. Explain why it is appropriate to use a Registration class to model the event of a student registering for a module.

(1 mark)

  1. Copy the incomplete class diagram in Figure 4 into your answer book. Identify the four missing classes and put appropriate names for them into the four blank rectangles in your diagram.

(2 marks)

  1. i. Now complete the class diagram for a conceptual model that you began in (b).

(9 marks)

  1. Write the class descriptions required for a conceptual model for the system. This should involve the classes in Figure 4 above, along with the classes identified in your solution to part (b), and no other classes. You should omit all comments.

(5 marks)

  1. State an invariant that should be included in your conceptual model to express the constraint that a seminar cannot be attended by students who are not registered for the module holding the seminar.

(2 marks)

  1. State in real-world terms a constraint that is stated in the requirements document and requires to be modelled by adding an invariant different to that in (d) to your conceptual model. The constraint should not be related to the uniqueness of attribute values. There may be several such constraints; only one is required.

(1 mark)

 

 

 

Question 22 (20 marks)         The following unfinished class diagram is a part of a structural model being developed for a small airline administration system.

AirlineCoord is the coordinating class.

The following extract from the textual part of the structural model being developed excludes some details that are not relevant for this question.

The following is a description of one of the use cases for this system.

Book Flight

The user identifies a passenger and a flight and provides the date the booking is made. The flight must not have been booked already by the passenger. If the flight is already fully booked then the user is informed of this but otherwise the system records the booking on the given date of the passenger on the flight.

The object diagram in Figure 6 shows the relevant objects and links for a particular scenario of the use case, before the use case is initiated. In particular it shows all the Booking objects linked to passenger2, but none of the other Booking objects linked to the Flight objects.

  1. Draw an object diagram showing the relevant objects and links after the use case has completed, with the identified Passenger and Flight objects being passenger2 and flight4 and the date provided being 21/10/2013.

(2 marks)

  1. It has been decided that the coordinating method for the Book Flight use case should return true if the flight is not fully booked and false otherwise. In addition, it can be deduced from the use case description that the method requires a pre-condition. Write out part of a formal specification for the coordinating method, as follows. You should use book for the name of the method and you should give the method header (i.e. the return type, method name and any argument(s) and their type(s)) and the pre-condition. You are not required to give the post-condition.

(3 marks)

  1. Consider the following incomplete walk-through for the scenario above for booking a flight where the identified Passenger object is passenger2, the identified Flight object is flight4 and the date provided is 21/10/2013.

    i. Identify any new navigations that are required for steps 1 to 3. For each navigation that you identify, write down the name of the association and the direction in which it needs to be navigated.

    ii. Now complete the above walk-through. Write down the remaining steps as your answer in the answer booklet.
  1. Complete the sequence diagram in Figure 7 for the above scenario, based on the walk-through above. Note that airline is the coordinating object. Your design should give the new Booking object overall responsibility for creating any links that are required.

Annotate the diagram with numbers to indicate where each walk-through step is achieved.

Give the complete sequence diagram in your answer book.

e. Suppose the scenario in part (c) is changed by making flight7 the identified Flight object so that the walkthrough now starts as follows:

 

 

Question 23 (20 marks)          Consider the class diagram in Figure 8 and class descriptions extracted from an implementation model for a system concerned with the administration of drug trials. Then answer the parts (a) and (b) which follow. You are advised to read the questions first and then refer to the extract from the implementation model in order to answer them. Note that this question contains four parts in all. The last two parts, (c) and (d), are based on dynamic models which are given later.

The Figure 8 class diagram and following class descriptions are part of an implementation model for the Drug Trial System. Drugs trials involve a number of experimental treatments. Each treatment involves a specific drug, given to a patient. Drugs are categorised into three types as either New, Existing or Placebo.

The system employs the class Name as specified on page 14 and 15 of the M256 Handbook. It also employs a user-defined type, DrugType.

  1. The instance variable type in class Drug should be restricted to taking values representing the categories NEW, EXISTING and PLACEBO only. Specify a suitable type, DrugType, for this instance variable.

(2 marks)

  1. Table 1 sets out a test case specification for a test of the method hasDrugs(aDrugType) in the class Patient.

Read the following notes and then write a JUnit test method test1HasDrugs corresponding to the test case specified in Table 1.

Notes:

  • Your answer should consist of the complete body of the test method, not including the header.
  • You should assume that (except for the method being tested and the coordinating method hasDrugs(Patient aPatient,

DrugType aDrugType) ) all methods specified in the given extract from the implementation model have already been implemented and tested.

  • You can use any valid values for attributes that are not specified in Table 1.

You are not required to provide Javadoc or any other comments.

(10 marks)

 

 

One use case in the Drug Trial System is the following:

List Patient’s Drugs for Drug Type

The administrator identifies the patient and the drug type. The system lists the name of each drug of that category that the patient is being treated with along with the start date of the treatment.

The following are dynamic models for a design for the above use case. Use the object diagram in Figure 9, the walk-through, and sequence diagram in Figure 10, for the scenario below to answer parts (c) and (d) which follow.

  1. Suggest a suitable order for implementing the methods required for the design of the use case

List Patient's Drugs for Drug Type

You should not include methods that would be implemented in the first code iteration and should only include methods that are specified in the class descriptions. Do not include additional methods that might be needed for testing. For each method give its class and its name and any arguments.

(3 marks)

 

  1. Write the code for the method hasDrugs(aDrugType)of the class Patient, based on the above dynamic models. You are not required to provide the method header or Javadoc comments.

(5 marks)

 

 

 

Question 24 (20 marks)

(a) This part of the question is about improving an initial prototype graphical user interface (GUI) design for a desktop computer application to control a ‘Where am I?’ display for the outside of an office door. Read the descriptions below and then answer the questions that follow.

The ‘Where am I?’ display

Figure 11 shows the display outside the office door. The arrow on the display swings to indicate the occupant’s whereabouts. The Unavailable label is fixed but all of the other location labels are programmable. The position of the arrow is driven by a set of sensors whose details you do not need to consider. If a visitor presses the Further details button a message pre-set by the room’s occupant is displayed, for example giving a mobile number for the visitor to text.

 

The user interface

The initial prototype user interface of the desktop application to control the door display is comprised of two screens, as shown below.

The main screen

The main screen (Where am I?) is intended to allow a user to do the following:

  • enter a set of location labels for the door display
  • associate each location with one of ten sensors which the user indicates by entering numbers (1 to 10) into text fields.
  • provide a message to be displayed when the Further details button on the door display is pressed (this is always the same message irrespective of the location).

From the main screen the user can navigate via a button (Set availability) to the Availability screen.

The Availability screen

This screen is intended to allow the user to enter set times of the week when the door display will indicate ‘Unavailable’. This is done using a table. For the purposes of this question all you need to know about tables is that they can be used for entering and displaying information in cells, which are intersections of columns and rows. In this case the columns represent days of the working week and the rows represent times of the working day in hourly intervals.

When the user selects a cell (or group of cells) this is indicated by the cell(s) being highlighted. The user then clicks on the Set unavailable button and these cells become shaded, indicating unavailability.

Clicking on the Back button returns the user to the main screen.

Some user interface design heuristics (introduced in Unit 12) are listed below

  • Minimise the users’ memory load
  • Be consistent
  • Allow for undoability and commitment
  • Use simple grouping and ordering
  • Prevent errors
    1. Use the design heuristic Prevent errors to identify a fault with the design of the main screen and a consequent improvement. Give your answer in the form of a design rationale.

(2 marks)

  1. Choose a design heuristic from the list given above, different from that in (i), for which you can identify a fault with the design of the Availability screen and a consequent improvement. Give your answer in the form of a design rationale.

(2 marks)

  1. Explain the meanings of the terms affordance, visibility and feedback in the context of user interface design.

(3 marks)


 

  1. This part of the question is about a Java GUI for a faculty library loan system. Read the description below then answer the questions that follow.
    The Borrow Book screen allows the user to initiate the Borrow Book use case. Here is a description of this use case.

Suppose that a user interface designer working on the Borrow Book use case has decided that the user will select from a scrollable list of the (unique) names of all the members of the faculty library. When the user makes this selection a second scrollable list will display the titles of all the available books i.e. all the books the member does not have on loan and for which copies are available to be borrowed. When the Borrow Book screen is first displayed the first name in the list of member names is selected by default and the second list displays the titles of books available to be borrowed by that member.

The librarian selects a member and a book to be borrowed and clicks the Borrow book button. If the selected member already has the maximum number of books on loan, no new loan is recorded and an appropriate message is displayed in the outcome text area. Otherwise the system records the loan of the selected book to the selected member and the details are confirmed by a message in the outcome text area with the following information: the book title, the member’s membership number and name, and the issue and return dates.

This is illustrated by the design sketch in Figure 13.

When this design is implemented the GUI will communicate with the core system implemented in the package librarycore, which includes a coordinating class LibCoord and several other core classes including Loan and Book.

Below are extracts from the Javadoc for some methods of the core system classes, some, but not all of which are required for building the Borrow Book screen.

 

Below are some notes on the GUI that you will need to answer parts (i) and (ii).

  • The coordinating object is referenced by the instance variable library of type

LibCoord.

  • the first scrollable list (labelled Select the member) is referenced by a variable memberList of type M256JList;
  • the first list is populated with Member objects;
  • the second scrollable list (labelled Select a book to borrow) is referenced by a variable bookstoBorrowList of type M256JList;
  • The outcome text area is referenced by a variable outcomeArea of type

JTextArea.

  1. Write code for the body of a method displayAvailableBooks() for the GUI class which handles the selection of an item from the scrollable list of member names. The method should display in the second scrollable list the titles of all the available books. These are all the books in the library except the books the member has on loan, and books with no available copies. The first item in the second scrollable list should be selected by default. You can assume that there will always be at least one book in this list.

You should note the following:

    • when the second list is populated with a collection of Book objects, the title corresponding to each Book object will automatically be displayed in this list.

(6 marks)

  1. Write code for the body of a handler method borrowBook() for the Borrow book button. The method calls on the core system to record the borrowing of a copy of the selected book by the selected member.

If the selected member has already borrowed the maximum number of books no new loan is recorded and a message in the outcome text area states

"The member must return a book before borrowing another one".

Otherwise the loan is recorded and a message is displayed in the outcome text area showing the book title, the member’s membership number and name and the issue and return dates; also the 'Select a book to borrow' list is updated so that it no longer shows the title of the book just borrowed.

(7 marks)

 

END OF PAPER

 

 

Purchase full paper by adding to cart

 

 

Last updated: Sep 02, 2021 12:24 PM

Can't find a resource? Get in touch

AcademicianHelp

Your one-stop website for academic resources, tutoring, writing, editing, study abroad application, cv writing & proofreading needs.

Get Quote
TOP