CpSc 372
Exam 2-Key
Name______________________________________________
Answer any FOUR of the five questions. Place a large X on
the question you are omitting. If you answer all five, the one on which you
score the best will NOT be counted. All questions are counted the same: 25
points each. Answer all parts of each question.
You may have the class notes, handouts, copies of submitted
homework. You have from 12:30 pm until 1:45pm for the exam.
- Design
and architecture
- Designing
distributed systems involves multiple machines and perhaps multiple
machine types. How does the middleware bus design pattern address the
issue of different machine types?
The middleware pattern uses objects at each end of the data flow to
modify the data to fit the format expected by the destination machine.
- Identify
one design pattern you used in your traffic intersection design. Describe
the forces that led to using that pattern and describe the forces that
were still present after the pattern was used.
Many different answers possible here.
- Describe
the forces that lead to the use of the callback design pattern.
The forces of efficiency and flexibility lead to the callback pattern.
When one thread can do work while waiting for another thread to send it data callback
objects can be used to wait for the data and then transfer the data to its
parent object. In an application framework standard interfaces for callback
objects are specified so that the user of the framework can define a callback
object that will wait to be called by the main thread.
- Threads
are the main units of work in a software system.
- There
are several schemes used to avoid deadlock including at least one design
pattern. What is the basic idea that all of them share? In other words,
how do you design to avoid deadlock?
Avoid unprotected shared data
- Under
what circumstances is it possible to have two threads in the Running
state at the same physical time?
Have two or more physically distinct processors
- One
element in the integration test fault model is the interaction of threads
in the elements being integrated. Describe the basic idea for test cases that
could be used to detect potential interactions?
Test cases of methods in one object that invoke methods in the interface
of the other object will detect certain types of interactions.

- Below
is a state diagram for a simple traffic intersection.
- Describe
the trigger, guard, and action that would be associated with the
transition from Green to Red in the TrafficSignal
model.
Guard: check that light is Green
Trigger: timer or detector sends an event
Action: set light to Red
- The
state diagram describes the dynamic behavior of a design element while
the class diagram describes the static structure of a design element.
What are the possible correspondences between a state diagram and the
class representation for a single design element in a class diagram?
A method in a class diagram may be the guard, trigger, or action on a
transition. An attribute may be data that is checked by the guard or set by the
action of the transition.
- Describe
completely two test cases that could be defined given the information in
the diagram.
(in DominantStreetGreen,
GlobalTrigger, in DominantStreetRed)
(in DominantStreetRed,
GlobalTrigger, in DominantStreetGreen)

- We
have used the PSK to prototype the traffic intersection. The PSK provided
several tools such as a compiler and a model checker.
- The
compiler finds mismatches between the definitions of components by
examining the syntactic structure of the components. What does testing
find?
Testing finds differences between expected (specified) and actual
computations.
- The
model checker verifies the truth of propositions such as “It is always
true that a light being green in one direction implies that the light in
the crossing direction is red.” How is this different from the
information gained from testing? How does the model checker achieve that
information?
Testing only verifies a single instance of a proposition at a time. The
model checker covers the entire state space examining all possible cases.
- The
component model of the PSK defines how to wire together component
instances. What conditions must be met for the wiring together of two
component instances to be correct? What “travels” over the connection
between two component instances?
Method invocations travel across the connection. This may include data
in the form of parameters. What one component will provide must match what the
other component will provide.
- We
have discussed several process models.
- What
is the purpose of the Scrum in agile development?
The Scrum is a daily meeting of all team members where progress is
checked and a plan is made for the next day.
- Describe
the difference in rhythm (our rhythm has been once a week) between an
agile process model and an iterative, incremental process model. How does
this difference affect the work assignments given to people working on
the project?
The agile rhythm is faster. Therefore the work assignments are smaller.
- In a
software product line organization there are two main processes: core
asset development and product building. What do these two groups
exchange? What is the difference in the goals for the two groups?
The core asset team provides assets to the product builders and gets
feedback in return. The difference is the time horizon and scope of the two
groups. The core asset developers must think about all assets over the life
time of the product line while the product builder only focuses on one set of
requirements in the immediate future.