CpSc 472/672
Exam 2
Name______________________________________________
This is an open notes exam. It is an individual effort.
There are 6 questions on the exam. Answer 5 of the
questions. Be certain to answer all parts of the questions that you select. Put
a large X on the question you are omitting. Do not answer all 6 and expect me
to pick the 5 best. If you answer 6, I will pick the WORST 5. Make a decision
on which you will answer.
You have until 10:15am to complete the exam.
- The
software architecture is the basic structure of a software system.
- Describe
how an architect decides to
define a specific module in the architecture.
- The
architecture is intended to satisfy the system’s requirements. How are
the requirements represented in the architecture?
- Assume
the architect chooses to use an event-based architecture style. Compared
to a style in which one module directly invokes another by making a
function call, what system qualities does the event-based architecture
enhance that the direct invocation architecture degrades?
- Process
definitions have different levels of detail. A basic process definition is
divided into phases, each phase is divided into activities, and each
activity is divided into a set of steps. Each of these divisions can be
written as a process in its own right.
- Every
phase has an exit criterion. Describe the purpose of the exit criterion
and give an example.
- At a
high level the software development process is: analysis, design,
implementation, and testing. Explain why this is a natural sequence for
solving a problem.
- The
requirements process has two main activities: elicitation and analysis.
Explain why it is useful to divide “writing the requirements” into these
two activities.
- The
OCL is used to express constraints about actions in the system.
Pre-conditions and post-conditions describe expected states of the system
before an operation and immediately after. OCL is also used to describe
invariants.
- Describe
the difference between a defensive design approach and a design by
contract approach.
- What
is the difference between a pre or post-condition and an invariant?
- Given
the OCL expressions below, explain what each OCL constraint means.
context Person inv:
self.age>0
context
Job::increaseSalary(percentage: Integer)
pre:
0 < percentage and percentage <= 100
post:
salary = salary@pre*(1+percentage/100)
- UML
allows us to model concepts and the relationships among those concepts. We
apply three criteria to models comprised of UML diagrams correctness,
completeness, and consistency.
- Explain
why a model should meet each of the three criteria and give an example of
how each criterion can be violated in a model.
- Consider
the situation in which a building architect wishes to describe the
contents of a typical classroom. Draw the UML diagram that represents the
contents and the relationships among the various pieces.
- Draw
the state transition diagram that shows the operation of a room light
where there are two switches that control the light. Each time either
switch is thrown the light changes state. If I walk in one door and flip
the switch and the light is off, it will come on. Then if I walk out the
other door and flip the switch the light goes off. If I walk in a door
and the light is on and flip the switch, the light goes off and when I
flip the other switch the light comes on.
- A
“component model” describes the underlying characteristics of families of
components. We briefly discussed the J2EE, CORBA and .NET models.
- Describe
some attributes that vary from one component model to another. Explain
why each attribute is sufficiently significant to be a difference between
models. Illustrate each attribute using the J2EE model.
- A
module is considered good if there is low coupling and high cohesion. Why
are these characteristics desirable?
- What
is the role of a Broker in the interaction between two components?
- The
most recent assignment was to design a “to do list” program.
- Describe
how the requirement to “print all the tasks” could be designed.
- Describe
one design pattern used in your design. Why is it helpful to use design
patterns?
- Design
an extension to your design that allows the user to copy a task that is
in the list and paste it into the list at a different point.