Final Exam SE-2 (Design)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10
At a glance
Powered by AI
The document appears to contain content for a software engineering exam, including assignments and questions.

The document contains content for a software engineering exam, including assignments on use case modeling, system design, software testing, and questions to be answered.

The tasks assigned in Assignment No. 1 include (a) modeling a UML-based class diagram and (b) modeling a UML-based sequence diagram based on the class diagram.

Prof. Dr.

Sascha Alda

Final Exam

Software Engineering Part 2 - Design


April, 7th 2017

Your Name:

Student ID:

Signature

Result (please do not fill in these cells!!):

Assignment Nr. 1 Nr. 2 Nr. 3 Nr. 4 S


Maximum
20 20 20 20 80
Points
Achieved
Points

You are not allowed to use any materials (e.g. books or a script). But you can use a
translator.

You need at least 40 points to pass the final exam. The final exam takes 90 minutes.

Grade
Name:

Student ID

Assignment No. 1 (Analysing a Use Case, Sequence Diagram):

A company asks you to analyse the following UML-based Use Case Model of a Booking
System, which can be used through a Web-based user interface:

Booking System

Enter a New Invoice


<<include>>

Store And Load an


Invoice <<external system>>

Accounting SAP FI / CO
Clerk

Some further details are given that you should consider for the analysis:

• Within the use case “Store And Load an Invoice”, an entity of type Invoice is creat-
ed during the partial process of storing that entity to the external system.

• The external system only accepts the asynchronous call store(d : Invoice) for
storing Invoices. After the completion of the storage, an asynchronous call back mes-
sage status(m : Message) is returned indicating the status of that operation.

• The accounting clerk is associated with a new Invoice object during the use case
“Store And Load an Invoice”. An accounting clerk may enter many Invoice objects,
while an Invoice object can only be entered by exactly one accounting clerk.

Your tasks:

a.)
Please analyse the given use case model by modelling an UML-based class diagram.
Your classes should also provide appropriate stereotypes. Please do also add relation-
ships between the classes and cardinalities, if any. (10 Points).

b.)
Please model a UML-based sequence diagram that models one scenario for entering
and storing one new Invoice object. This sequence diagram should be based on the
class diagram from assignment 1a.). Please use synchronous interactions only unless
otherwise indicated or necessary. (10 Points)

2
Name:

Student ID

3
Name:

Student ID

Assignment No. 2 (System Design, Architecture Views):


a.)
Consider again the problem statement given in assignment no. 1. Please provide a con-
text view of that system by using a UML-based package diagram. Please indicate the
most relevant dependency relationships as well as data flows. (7 Points)

b.)
Consider again the problem statement given in assignment no. 1 and the class diagram
that you have produced in assignment 1a.). Please provide a module view of the result-
ing software architecture by using a UML-based package diagram. This module view
should be based on the layer architecture pattern. Please do also indicate the most im-
portant dependency relationships between the UML packages. Give concrete names to
the UML packages that could later on used as names for concrete Java packages. The
names should start with org.vgu.se. Please also insert the relevant classes into the
UML packages.

c.)
Describe two typical activities when developing a software architecture. For description,
use 2 through 3 complete sentences.

4
Name:

Student ID

Assignment No. 3 (Object Design, Design Patterns):


a.)
You are also asked to perform a review on a class diagram, which was modeled by
an external consultant. In this model, the access from class CADApp to the existing
and not compatible legacy system ECM is modeled:

// Proposed implementation in Java7: Object is received as a


// Singleton from a static method of the class interface
// (Method getInstance not given in the class diagram):
CADApp CADInterface cad = CADInterface.getInstance();

// Saving of the Doc object (Parameters omitted)


boolean re = cad.saveDoc( new Doc() );

ECM
<<interface>>
CADInterface
+ saveDoc( d : Doc ) : bool + storeFragment( x : eXML ) :
Status

ECMAdapter
- alt : ECM

+ saveDoc( d : Doc ) : bool


Methods for converting input
- convertIN ( d : Doc ) : ECM and output, which is obvious
- convertOUT( b : bool ) : Status according to the Decorator pattern

Please also respect the comments of the consultant.

Which of the aspects of the class diagram do you observe as critical? Please elabo-
rate shortly each observation in one sentence. Please also mark your observations in
the model (e.g. by underlining the observation). (6 Points)

5
Name:

Student ID

b.)
Please convert this UML-based method signature into a Java-based method signature:

# printInvoice( OUT list : List<Invoice>,


IN double numberOfCopies ) : Result

c.)
The Web-based user interface should contain two different views for the accounting
clerk. First, a view for displaying a history of transactions that were performed during the
last month. Second, a view for displaying open invoices that were not payed by custom-
ers. A class called “ViewManager” should be responsible to notify these views upon the
arrival of events (e.g., a new transaction, or a new open invoice). It should be possible to
register and to unregister views into the “ViewManager” class in a flexible way during
runtime. Since views should not be overstrained with too many events, views should load
the necessary data from these events on demand after having received a notification.
The “ViewManager” class should be decomposed into two classes: one for managing
the views, one for providing an interface for loading new transactions and new open in-
voices. To load transactions and invoices, only one method should be used:

load() : List<DataItem>

Each view should also have an ID, which can be set from an external class.

Which design pattern would you use to solve this problem statement? Please indicate
only the name first:

Please do also model a UML-based class diagram as a solution based on the identified
design pattern. Your class diagram should include all methods including their signatures
and their access modifiers as well as the attributes including their access modifiers.

6
Name:

Student ID

dddd

7
Name:

Student ID

Assignment No. 4 (Software Testing, JUnit):


a.)
Given is the following JUnit test for testing a List implementation (imports omitted):

public class TesterList {


private List<Invoice> con = new ArrayList<Invoice>();
private Invoice in3 = null;

@Before
public void setUp() throws Exception {
in3 = new Invoice(3);
}

@Test
public void testFirst() {
con.add( new Invoice(1) );
assertEquals( 1, con.size() );

// Please add further assertions after having added or


// deleted a single Invoice object.
// In total, four objects should be added and four
// objects should be deleted.
// Thus, provide eight assertions in this assignment.
//
// [put your code in the box of assignment 4a]
}

@Test
public void testSecond() {
Invoice in1 = new Invoice(1);
Invoice in2 = new Invoice(2);
Invoice in3 = in1;
this.in3 = in2;

// Please add assertions to test the object identity


// for the object in variable 'in1' with all other
// objects that are visible in this method (including
// 'in1' itself).
//
// [put your code in the box of assignment 4b]
}
}

8
Name:

Student ID

Please provide the source codes for the comments that are given in that JUnit test case.
You don’t have to repeat the names of the test methods, just provide the assertions:

Assignment 4a):

9
Name:

Student ID

Assignment 4b):

Assignment 4c):
Explain the difference between a Black Box and a White Box test. Also, give a short an-
swer to the following question: what is the drawback of having a separate test class
when performing a White Box test?

10

You might also like