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

1st SEMESTER 2020/21 RESIT Exam

Undergraduate  Year 3

CPT203

Software Engineering 1

Section A  Answer all questions (30 marks):

Question A.1

Fill in the blanks with the SINGLE MOST APPROPRIATE TERM among the following. (Note: terms may apply to none, one, or more than one blanks.) (10 marks)

Terms:

interface design

system testing

generalization

system customer

state diagrams

system models

Agile methods

system developer

system design

context models

plan-driven

software requirements specification

software design document

physical viewpoint

activity-driven

waterfall model

activity diagrams

logical viewpoint

scenario-driven development

architectural design

test-driven development

1.   _____________ processes are processes where all of the process activities are planned in advance and progress is measured against this plan.

2.    In  principle,  the  ____________should  only  be  used  when  the  requirements  are  well understood and unlikely to change radically during system development.

3.   ________________ is where you identify the overall structure of the system, the principal components (sometimes called sub-systems or modules), their relationships, and how they are distributed.

4.    Acceptance testing is the final stage in the testing process before the system is accepted for operational use. The system is tested with data supplied by the ______________rather than with simulated test data

5.   ______________ are intended to deliver working software quickly to customers, who can then propose new and changed requirements to be included in later iterations of the system

6.   ________________describes how the system is structured, how to assign responsibilities to various components

7.    The ____________________is an official statement of what the system developers should implement.

8.   ____________ show how the system reacts to internal and external events


9.    ____________are used to illustrate the operational context of a system, they show what lies

outside the system boundaries

10. ______________ is an approach to program development in which you interleave testing and code development

Question A.2

Refer to the below class diagram for a simplified order system, redraw the class diagram to include the listed operations. Your new class diagram must show highly cohesive classes. (10 marks)

Operation

Description

addItem()

Add the item to the order

getItems()

Return all items added to the order

pay()

Make payment to the order

getOrderTotal()

Return the total of all the items added to the order

cancelOrder()

Cancel the order and delete all the items added to that order

addComment()

Add a new comment to an order

getAllPayments()

Return all payment made to an order

cancelPayment()

Cancel a particular payment to an order

printOrder()

Print the content of the order

deleteComment()

Delete a comment

 

Question A.3

The Java classes below are tightly coupled, rewrite the code using Java interface to produce a loosely coupled code. (5 marks)

 

Question A.4

Given that the class MathUtils is providing a divide method as shown in the method signature below. Write a Junit unit test to check that the method will throw an ArithmeticException if   division by zero is attempted. (5 marks)

public double divide(double dividend, double divisor)

Section B  Answer all questions (70 marks):

Question B.1

The Food Delivery System allows the online user to order food for home delivery. A shopper starts by search to find items to purchase, adds items one at a time to a shopping cart, and possibly searches again for more items. When the shopper selects all desire items, the shopper place order by providing a delivery address. To complete the place order process, the shopper pay by credit card. During the payment process, the shopper has an option to enter a discount code if (s)he has one. The system has an option for shoppers to register as a member of the system. They can then save their name and address information so that they do not have to enter this information every time that they place an order.

Produce a use case diagram for the Place Order use case of the food delivery system. (8 marks)

Question B.2

Given the below scenario for a use case, produce a class diagram for the use case (16 marks)

Basic Flow:

1.   The customer arrives at a POS checkout counter to pay for the goods (s)he wants to purchase.

2.   The cashier starts a new sale.

3.   The cashier enters the item identifier.

4.   The system records the sale line item and presents item description, price, and the running total.

5.   The cashier repeats steps 3-4 to until all goods are counts.

6.   The system calculates the taxes and presents the total.

7.   The cashier tells the Customer the total and asks for payment.

8.   After the customer pays, the cashier updates the sales record with payment. Customer may choose to pay with multiple payment methods, for example, (s)he can pay half of the transaction with cash and another half of the transaction with credit card.

9.   The system presents the receipt.

10. The customer leaves with receipt and goods (if any).

Question B.3

Produce a UML state machine diagram for a rice cooker with the following behaviors. (12 marks)

    The rice cooker is in an Idle state when it is not in use. In this state, the cooker awaits the

users instruction.

   A user add rice and water to the cooker and press the start button to cook the rice. When

the user presses the start button, the cooker turn on the heater to 120 degree Celsius and an automated timer begins.

    During the cooking process, a user can press the cancel button any time to cancel the

cooking. If the user presses the cancel button, the heater will turn off, and the timer will reset, the cooker return to an Idle state.

    When the timer elapses, the cooking stops. The cooker will set the heater to 40 degrees

Celsius to keep the rice warm.

   User press a stop button to turn off the warming temperature, and the cooker return to Idle

state.

Note: When transiting from cooking to warming, avoid switching the heater off and on to prolong the heater’s life span.

Question B.4

Develop a sequence diagram to show the interactions involved when a student enrolls for a       course in a university. Courses have limited enrolment, so the enrolment process must include  checking for available places. The student is allowed to enrolls only if there is a place available for the course. Otherwise, enrolment is not allowed. The system must respond to the student     about the enrolment status. To start the process, the student accesses an electronic course          catalog to find out about available courses. (16 marks)

Question B.5

An order processing system in a company works as follow: (18 marks)

•    When a new order is received, the Order Processor starts the order processing.

•    First, the Order Processor receives the order. If the order is invalid, the process will terminate immediately.

•    If the order is valid, the process continues with the second step to fill in the order.

•    Next, two separate sequences of processes will run in parallel at two departments.

•    Logistic department

•    The logistic department pack order.

•    If the order is a high priority, use overnight delivery.

•    If the order is a regular priority, use regular delivery.

•    Finance department

•    The finance department sends an invoice to the customer.

•    The customer received the invoice and make payment.

•    The finance department updates payment records accordingly.

•    The finance department will close the order after the payment is received, updated, and after the logistics department delivered the order.

•    The process terminates after the order is closed.

Draw an Activity Diagram with Swimlanes to model the above process.