CMPS 363 Final, Fall 2005
American University of Beirut · Software Engineering · 12 pages
Showing the first 10 of 12 pages. Download the PDF to see all of it.
Show the text of this final exam
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 1/12
CMPS 363 Final Exam
February 02, 2006
Student Name: ________________________________ Student ID:______________
Signature: ____________________________________ Section: __1__
•
There are twelve pages, including this one. The test is out of 100 marks, and the value
of each question is provided. Please use this information to manage your time effectively.
•
Your handwriting should be neat and readable or I will not mark the answer!
•
Question 1: ______/20
Question 2: ______/10
Question 3: ______/20
Question 4: ______/05
Question 5: ______/10
Question 6: ______/20
Question 7: ______/15
Total: ____________/100
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 2/12
Question 1: General Questions [20 marks]
A) What are design patterns? How are they different from frameworks? Give an example [4
marks]
B) I am building a Word Processor and need to support unlimited undo of actions. What design
pattern might I use to assist me in designing a good solution? [3 marks]
C) I am building a graphical user interface framework and need to subclass the window abstrac-
tion and the window implementation. What design pattern could I use? provide UML [3 marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 3/12
D) I am limited to only one database connection. What design pattern helps me limit the number
of objects I can create? Provide UML [3 marks]
E) I want to have several objects that “watch” another object and take action when the object
changes. What design pattern will help? provide UML [3 marks]
F) It is said that patterns define a vocabulary among designers. Discuss in the context of your indi-
vidual projects. [4 marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 4/12
Question 2 Design Patterns [10 marks]
A) Subsystems in our application does not need to know, how the object has to be created, it
should also allow you to hide the concrete implementation and dynamic object configuration. Dis-
cuss using examples. Provide UML. [5 marks]
B) Global variables are problematic in OOD. What are the potential problems? And what design
patterns can be helpful to resolve these problems. Give an example + code. Provide UML [5
marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 5/12
Question 3 Design Decisions [20 marks]
A) It is said that designs are often loaded with overprivileged class inheritance, where much of
the functionalities exist. Show an example, and provide UML [4 marks]
B) Use composition (via an example) to resolve the above problem. Provide UML [4 marks]
C) Design for interface not for implementation. Discuss, and give a OO (PHP) example. Provide
UML. [4 marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 6/12
D) It is said that object creation and destruction has a great effect on running/modification of the
code. Discuss. [4 marks]
E) Tight coupling implies that when a change occur somewhere in a system, it often necessitates
many changes elsewhere in that system. You can give an OO PHP example that is related to data-
bases. [4 marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 7/12
Question 4 Architectural Styles [8 marks]
Discuss the above design style and state its advantages and disadvantages.
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 8/12
Question 5 Object creation [7 marks]
Aside from inheritance, and its partner, polymorphism, we can find other situations where objects are
involved in some kind of interaction. Definitely, one concept that rapidly comes to my mind is that of aggre-
gation. Generally speaking, aggregation occurs when one object uses the functionality of another object to
satisfy its own purposes. Having two objects A and B, if our object B simply “passes away” when object A
dies, then we say that object B composes to A.
Explain these two concepts with examples, and show potential design effect on testing.
Question 6 MVC Framework [20 marks]
In contrast to software engineering, which relies on relatively well established development
approaches, there is a lack of a proven methodology that guides Web engineers in building reliable
and effective Web-based systems. Currently, Web engineering lacks process models, architec-
tures, suitable techniques and methods, quality assurance, and a systematic approach to the devel-
opment process. As a result, Web engineering is still struggling to establish itself as a reliable
engineering discipline. The cost of poor reliability and effectiveness has serious consequences for
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 9/12
the acceptability of the systems. One of the main reasons for the low acceptance of Web-based
applications is the large gap between design models and the implementation model of the Web.
It is therefore not surprising that Web engineering education still focuses on technologies, rather
than on critical skills that facilitate engineers to solve real-world problems effectively.
A) Discuss the theoretical aspect behind MVC, and show how the MVC paradigm can help to
bridge the gap between design and implementation. [10 marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 10/12
B) When a request requires common actions A’ = {a1, a2,..., an} from view vi to view vj where A’
∈ A the set of all possible actions in a Web engineering system S, and {vi, vj} is a subset of V = {v1,
v2,..., vn} ∈ S, certain disadvantages can be expected when coding S. Discuss how the MVC frame-
work can help to reduce these disadvantages. [10 marks]
Question 7 Software Testing (Dataflow flavors) [15 marks]
A) Does the sequence of definitions <n1, n2, n4>, <n1, n2, n3, n4>, and <n1, n2, n3, n2, n3, n4>
in the following graph form an ordered context coverage with respect to x, y and z. Explain. [5
marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 11/12
B) A proposed a family of test adequacy criteria called the required k-tuples, where k is a natural
number > 1. The required k-tuples require that a path set P = {p1, p2, ,,, pn} covers chains of alter-
nating definitions and uses, or definition-reference interactions called k-dr interactions (k > 1). An
example of a k-dr interactions is depicted in the Figure below. In n1, there is a definition of a vari-
able x1, that us used to define variable x2 in n2 such that x1 ∈ n1 reaches n2 via path p1. Therefore,
the information assigned to variable x1 ∈ n1 is propagated to variable x2 ∈ n2. This information
is further propagated to another variable, say, x3 ∈ n3 such that x2 ∈ n2 reaches n3 via path p2.
This information propagation process continues until it reaches nk. Thus, the set of paths {p1, p2,
,,, pk-1} form a k-dr interactions. The required k-tuples requires some subpath propagating each
k-dr interaction such that (1) if the last use is a predicate the propagation should consider both
outcome (true and false), and (2) if the first definition or the last use is in a loop, the propagation
should consider either a minimal or some larger number of loop iterations. The required k-tuple
coverage criterion, or k-dr interaction chain coverage criterion, then requires that all feasible k-
dr-interaction chains should be tested. Calculate the 1-dr interaction and its satisfying paths for
the following CFG. [5 marks]
February 2, 2006 CMPS 363 Final Exam
Marcel R. karam 12/12
C) How applicable is this family of applicable criteria to Visual Dataflow Languages. Explain. [5
marks].