Object-Oriented Software Engineering Using UML, Patterns, and Java (3rd Edition) Solution Manual
Object-Oriented Software Engineering Using UML, Patterns, and Java (3rd Edition) Solution Manual
Low Cost
:Option
:Option
:Option
:Question
:Criterion
:Criterion
+
+
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
In the class diagram representing these concepts (Figure 12-2), the main associations between both models are
between Change Request and Issue, and between Resolution and Change. Note that both associations are many to
many.
Figure 12-3 Example class diagram for exercise 123 (some classes omitted for clarity)
Bug Report
Issue
Proposal
Resolution
Argument
Feature Request
Change Request
Bug Fix Enhancement
Change
* *
* *
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
13. Conguration Management: Solutions
13-1 RCS adopts a reverse delta approach for storing multiple versions of a le. For example, assume a le has three
revisions, 1.1, 1.2, and 1.3, RCS stores the le as of version 1.3, then, the differences between 1.2 and 1.3, and
the differences between 1.1 and 1.2. When a new version is created, say 1.4, the difference between 1.3 and 1.4
is computed and stored, and the 1.3 version is deleted and replaced by 1.4.
Explain why RCS does not simply store the initial version (in this case 1.1) and the differences between each
successive version.
The trade-off between reverse deltas and forward deltas is a response time trade-off. In the case of reverse deltas (as
RCS does), the time to retrieve the latest version is the shortest, while time to retrieve the oldest versions is the
longest. In the case of forward deltas, the time to retrieve the initial (oldest) version is the shortest. In most projects,
retrieving the latest version is the most common case. Note that storing reverse deltas increases the time for creating a
new version.
132 CVS uses a simple text-based rule to identify overlaps during a merge: There is an overlap if the same line was
changed in both versions that are being merged. If no such line exists, then CVS decides there is no conict and
the versions are merged automatically. For example, assume a le contains a class with three methods, a(),
b(), and c(). Two developers work independently on the le. If they both modify the same lines of code, say the
rst line of method a(), then CVS decides there is a conict. Explain why this approach will fail to detect
certain types of conict. Provide an example in your answer.
This approach fails when developers introduce conicts when modifying different lines of a le. For example, if two
developers introduce a new eld with the same name in the same class in different locations in the le. Note that
developers can also introduce semantic conicts by modifying two different les (e.g., by making different
assumptions about the same class).
133 Conguration management systems such as RCS, CVS, and Perforce use le names and their paths to identify
conguration items. Explain why this feature prevents the conguration management of CM aggregates, even in
the presence of labels.
Note to the instructor: this is a difcult question for students who have not used conguration management systems,
in particular branch management.
The main issue with using path names for identifying conguration items is that path names are attributes of
conguration items and thus, can also change. Assume for example that directories represent subsystems (e.g.,
storage, notication, user interface, train tracking). In the case of a change of the subsystem decomposition, the
directory structure may change (e.g., the storage directory may be split into a database directory and a JDBC
directory). For tools which use path names as identiers, this translates into conguration items being deleted and
added under a different path name. Since different versions of the same conguration items have different identiers,
operations such as merging branches are consequently not possible.
134 Explain how conguration management can be benecial to developers, even in the absence of a change
control or auditing process. List two scenarios illustrating your explanation.
Scenario 1: Assume developers work on new features sequentially and create new versions of the systems as a feature
becomes stable. Assume the current version is n and that versions m through n contain partial implementation of the
latest feature F. The implementation of F unfortunately, introduces many issues and developers decide to rethink their
approach. They nd a better way to implement F, however, it requires them to undo all changes related to F. When
using a version control tool and the sequential conguration management policy described before, this can be simply
done by checking out version m-1 and discarding versions m through n.
Scenario 2: Branches can be used to manage the development of concurrent features. If the implementation of all
features succeed, the branches need to be merged. If the development of one feature fails as in scenario 1, the
corresponding branch can be ignored while the rest of the development proceeds.
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
135 In Chapter 12, Rationale Management, we described how rationale information can be represented using an
issue model. Draw a UML class diagram for a problem tracking system that uses an issue model for the
description and discussion of changes and their relationship with versions. Focus only on the domain objects of
the system.
Clarication: domain objects here means entity objects.
This exercise has many different possible solutions since it is a design exercise. Figure 13-1 depicts a possible
solution. The key element is that the release of a new version triggers the discovery of new problems, which are then
discussed (cause identied, solution proposed and evaluated, and decision made). The decision then results in a new
version aimed at correcting the new problem.
136 In Chapter 11, Testing, we described how the quality control team nd faults in promotions created by
subsystem teams. Draw a UML activity diagram including the change process activities and testing activities of
a multiteam project.
Figure 13-10 in the book is a sample solution to this problem. The key elements the instructor should look in student
solutions are:
Testing is performed by the quality control team.
The quality control team sends change requests or problem reports to the subsystem teams.
Changes are performed by the subsystem teams.
Subsystem teams send promotions to the quality control team.
The subsystem teams decide when to create promotions.
The quality control team decides when to create a release.
Figure 13-1 Example solution for exercise 10.5.
Alternative
Decision
Criterion
Issue
assesses
solvableBy
resolvedBy
based-on
* * *
implementedBy
RationaleSubsystem
CMSubsystem
Controlled item
*
Version CM Aggregate
*
Configuration item
raised by
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
14. Project Management: Solutions
14-1 In Figure 14-1, we modeled the phases of a project with a state chart. Use the state pattern by making each of
these phases a different class. Use the project management activities introduced in this chapter to make them
public operations on these classes. Assume a team-based project organization.
Figure 14-1 depicts a sample solution to this exercise. The Pr oj ect Phase class denes operation for each project
management activity class. Each concrete state class (one per phase) denes operations for those operations that it
can handle. All other operations are implemented so that they trigger a change of state. The context is stored in the
Project class.
142 What are the relative advantages of at stafng versus gradual stafng?
The advantage of gradual stafng is that saves resources in the early part of the project. The advantage of at stafng
is that all the ramp up effort (e.g., training, team formation, denition of procedures, etc.) is moved up front.
143 What is the difference between status meetings and decision meetings? Should they always be kept separate in a
meeting?
The objective of a status meeting is for team members to report status to the team leaders, in an honest, veriable, and
unbiased manner. This enables the team leader to track progress and plan corrective decisions if necessary, such as
adding resources or creating new communication paths.
The objective of a decision meeting is either, for a team leader to communicate a decision to the team and ensure it is
implemented through action items, or for a team to discuss a set of issues and achieve a consensus.
It is better to keep status and decision separate, such that team members do not feel punished for reporting problems.
A team leader needs the team members to report problems as soon as possible and can encourage this if the team
leader gives the opportunity for the team to resolve the problem rst by themselves. If the problem worsen, then the
team leader may decide to intervene or to call a decision meeting in which the team cooperatively designs a solution.
In any case, there should be a time interval between the reporting of a problem and its corresponding intervention.
144 Why should the role of architect and team leader be assigned to distinct persons?
Figure 14-1 Sample solution for Exercise 14-1.
Project Pr oj ect Phase
f or mul at eI dea( )
doCost Benef i t Anal ysi s( )
doFeasi bi l i t ySt udy
doRevi ew
doPr obl emSt at ement
. . .
Conception
formulateIdea()
doCostBenefitAnalysis()
doFeasibilityStudy
doReview
doProblemStatement
...
Definition
formulateIdea()
doCostBenefitAnalysis()
doFeasibilityStudy
doReview
doProblemStatement
...
Termination
formulateIdea()
doCostBenefitAnalysis()
doFeasibilityStudy
doReview
doProblemStatement
...
. . .
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
The role of architect requires good technical abilities. The role of team leader requires good management abilities.
Both kinds of abilities are rarely present in the same person. Both roles are time consuming can rarely be
accomplished well by the same person at once.
145 Draw a UML model of the team organization of the OWL project for each the three main phases (i.e., initiation,
steady state, termination).
An example solution to this exercise is depicted in Figure 14-1. During project initiation, the management team is
responsible for the planning and other management activities, while the requirements team denes the system with
the users and the client and the architecture team design a preliminary architecture. During steady state, a team for
each subsystem is created, along with a documentation team and a quality control team. During project termination,
the subsystem teams are replaced with a single installation team which is responsible for deploying the system and
xing any last minute problems discovered by the quality control team.
146 Draw a task model of the system design of the MyTrip system presented in Chapter 6, System Design:
Decomposing the System.
A task plan can be represented as an activity diagram. The MyTrip system was used as an example to illustrate each
system design activity. Hence, the activity diagram of Figure 6-28 can be used as a starting point for the solution to
this exercise. We remove the Implement Subsystem activity (it is not part of system design) and add a Rene
subsystems activity to plan for a second iteration (see Figure 14-2). A conservative manager may even want to
serialize all tasks instead of conducting the activities of system design in parallel.
Figure 14-2 Example solution for exercise 11.4 (UML class diagram).
Management
:Team
Architecture
:Team
Architecture
:Team
Management
:Team
UserInterface
:Team
FacilitiesMgt
:Team
Control
:Team
DatabaseMgt
:Team
Visualization
:Team
QualityControl
:Team
Documentation
:Team
Management
:Team
Documentation
:Team
QualityControl
:Team
Installation
:Team
Project initiation
Steady state
Project termination
Requirements
:Team
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
147 Estimate the time to complete each task of the task model produced in Exercise 146 and determine the critical
path.
Note to the instructor: the estimates provided by the students need not (and will not) be realistic. The goal of the
exercise is to check the understanding of the concepts of critical path and task dependency. The example solution in
Figure 14-3 depicts the task model as a PERT chart and indicates the critical path in bold.
Figure 14-3 Example solution for exercise 11.5 (UML activity diagram).
Figure 14-4 Example solution for exercise 11.6 (PERT chart).
Describe boundary
conditions
Define Define
subsystems
Map subsystems
to hardware/
Manage
Select a
Define access
design goals
persistent data
control policies
global
software platform
control flow
Refine
subsystems
Define design
goals
1
Jan 9
1d
Jan 10
Map subsystems to
hw/sw platform
3
Jan 16
1d
Jan 16
Manage persistent
data
4
Jan 16
2d
Jan 17
Define access
control policies
4
Jan 16
2d
Jan 17
Select global
control flow
4
Jan 16
1d
Jan 16
Describe boundary
conditions
4
Jan 16
5d
Jan 20
Define subsystems
2
Jan 10
4d
Jan 13
Refine subsystems
2
Jan 23
5d
Jan 27
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
148 Identify, prioritize, and plan for the top ve risks related to the system design of MyTrip presented in Chapter 6,
System Design: Decomposing the System.
Note to the instructor: Again, the risks provided by the students need not be realistic. They do need, however, to be
risks. The goal of the exercise is to make the students think about what could go wrong and to check their
understanding of the risk concept. Table 14-1 is an example solution of risks and corresponding mitigation strategies.
The risks are ordered by priority (most important rst).
149 Identify, prioritize, and plan for the top ve risks related to the user interface subsystem of CTC presented in
Chapter 12, Rationale Management.
Same exercise as before with a different application domain. Table 14-1 depicts an example solution.
Table 14-1 MyTrip risks
Risk Mitigation strategy
MyTrip presents a safety hazards for drivers. Design a user interface that only allows passengers to
consult trips.
Describe the risks of using MyTrip while driving on the
rst page of the user manual.
MyTrip is not secure. Plan for security tests by the quality control team.
As part of maintenance, plan for a security team to
continuously test and address security vulnerabilities.
MyTrip is not reliable. Underestimate reliability of components, in particular,
the hardware components over which the project has no
control: phone network, home computer, etc.
Plan for the release of patches and upgrades to address
serious bugs.
A competitor develops conicting standards for storing and
planning trips
Design for modiability.
The number of users and trips were underestimated. MyTrip
does not scale beyond requirements
Design for more users and trips than required.
Table 14-1 CTC user interface risks
Risk Mitigation strategy
The user interface does not meet the availability criteria. Plan for extensive eld tests before deployment.
Plan for an emergency maintenance team to address any
serious problems.
Plan to roll back to the older system if the availability
criteria is not met.
The user interface consumes too many system resources. Plan for early performance testing.
Select hardware that can accommodate more load than
initially required.
The user interface does not meet the usability criteria Plan for usability tests with a representative set of users.
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
1410Linux, developed using the bazaar model, is more reliable and more responsive than many operating systems
running on Intel PCs. Discuss in some detail why the bazaar model should, however, not be used for the Space
Shuttle control software.
One of the key of the bazaar model is that many users are actually developers willing to diagnose problems and
propose solutions. The system, once released, goes through a large scale and parallel test which will nd most of the
important problems. The Space Shuttle does not have many users. Moreover, the price of discovering a bug in the
eld is much more serious.
1411Organize the project participants into teams of four people. Each team has the following resources available: 2
eggs, 1 role of TESA lm, 1 role of toilet paper, a cup with water, a bucket with two liters of sand, 20 foam balls
(each about 1 cm diameter), 1 table whose surface is about 1 meter above the ground. Each team has 25
minutes time to build and test an artifact that allows an egg to be released 75 cm above the table such that the
egg falls on the table without cracking. Each team has another 5 minutes to demonstrate the artifact to project
management.
This is a team building exercise that forces groups of individuals who do not know each other to work together,
identify each individuals strengths, and recognize that some problems are better solved in a collaborative
environment. Such exercises are done at the beginning of a project to form teams.
1412Organize the project participants into teams of four people. Each team has the following resources available: 2
buckets of DUPLO pieces, 2 tables separated by a distance of 1.50 meters. Each team has 25 minutes time to
build and test a bridge solely out of the available DUPLO pieces that hangs free for at least one minute
between the two table surfaces. Each team has another 5 minutes to demonstrate the artifact to project
management.
This is another team building exercise like Exercise 1411.
1413Specify all management models for the icebreaker project described in Exercise 14-11.
After the completion of Exercise 1411, the instructor should select a team that displayed a minimum of structure
during the problem solving (as opposed to a single participant coming up with the solution) and ask participants
reverse engineer a schedule, roles, teams, and a task model. This should illustrate both the usefulness of such models
to reason about the team dynamic and their limitations.
1414Write an SPMP for the icebreaker project described in Exercise 14-11.
This exercise has the same purpose as Exercise 1413.
The user interface represents a paradigm shift (i.e., the users
might be confused by the new interface)
Ensure that users have sufcient training before they
dispatch trains with the new system.
The user interface does not scale to a larger number of trains
and dispatchers
Design for a larger number of trains and dispatchers than
initially required.
Table 14-1 CTC user interface risks
Risk Mitigation strategy
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
15. Software Life Cycle: Solutions
15-1 Model as classes the activities of Figure 15-2 and the work products of Figure 15-4 and draw a UML class
diagrams depicting the relationships between activities and work product.
Figure 15-5 in the book is a possible solution.
152 Assume that the waterfall model shown in Figure 15-8 has been derived from the IEEE standard model in
Figure 15-7 during the activity Life Cycle Modeling. What processes and activities have been omitted in the
waterfall model?
The goal of this exercise is to have students think about processes which are needed all the time, e.g., conguration
management. The following processes were omitted from the waterfall model:
Project management processes: Project Monitoring & Control, Software Quality Management,
Integral processes: Conguration Management, Documentation Development, Training,
Post development processes: Maintenance, Retirement.
The project management and integral processes that were omitted run for the complete duration of the project, and
thus, do not t in the sequential model of the waterfall. The Maintenance and Retirement processes could simply
added at the bottom of the water fall. They were probably omitted because those activities are not considered part of
development.
153 Redraw Boehms spiral model in Figure 15-10 as a UML activity diagram. Compare the readability of the
original gure with the activity diagram.
Figure 15-1 depicts an example solution for this exercise. Without the spiral metaphor, it is difcult to understand that
the life cycle is incremental and iterative.
154 Draw a UML activity diagram describing the dependency between activities for a life cycle in which
requirements, design, implementation, test, and maintenance occur concurrently. (This is called an
evolutionary life cycle.)
Figure 15-2 depicts an example solution for this exercise.
Figure 15-1 Activity diagram for exercise 12.5 (only first three cycles shown)
Design
Validation
Requirements
Validation
Concept of
Operation
Requirements
Plan
Requirements
Specification
Development
Plan
System
Design
Risk
Analysis
Risk
Analysis
Integration
Plan
Integration
Risk
Analysis
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
155 Describe how testing activities can be initiated well before implementation activities. Explain why this is
desirable.
Testing activities can be initiated as soon as requirements activities are completed. System tests are generated from
the requirements. Integration tests are generated from the system design. Unit tests are generated from the object
design. Initiating testing activities early has two main advantages:
Some types of faults can be found merely by developing test cases, before executing them (e.g., interface issues).
The test cases will not be biased by the implementation, and thus focus on the requirements of the system.
156 In project management, a relationship between two tasks is usually interpreted as a precedence relationship;
that is, one task must complete before the next one is initiated. In a software life cycle, a relationship between
two activities is a dependency; that is, one activity uses a work product from another activity. Discuss this
difference. Provide an example in the context of the V-model.
A precedence relationship indicates that a task must end before the succeeding task can start. A dependency
relationship, however, does not always imply that the dependent activities must proceed in sequence. In the V-model,
for example, the component integration and test activity depends on both the preliminary design activity (for the
subsystem decomposition) and the unit test activity (for the unit tested system). The component integration and test
activity can start with the planning of the integration tests as soon as the preliminary design is complete, which can
occur even before the unit test activity is initiated.
157 Assume you are part of the IEEE committee that will revise the IEEE 1074 standard. You have been assigned
the task of modeling communication as an explicit integral process. Make a case for the activities that would
belong to this process.
Since communication would be an integral process, all activities in this process group would be process independent
and phrased in similar terms as the conguration management or documentation activities. Examples would include:
Plan communication infrastructure
Deploy communication infrastructure
Plan reviews
Dene change request procedures
Plan issue tracking
etc.
Figure 15-2 Activity diagram for exercise 12.6
Problem
Definition
Requirements
Design
Implementation
Test
Maintenance
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
16. Methodologies: Putting It All Together
16-1 What is the difference between a software life cycle and a methodology?
A software life cycle is a model of the activities and work products necessary to develop a system. A methodology is
a collection of methods and tools for developing a system and species when methods or tools should be used and
what to do if unexpected events occur. Methodologies and life cycles are complementary: a software life cycle can be
realized using a variety of software engineering methodologies. Although specic methodologies may imply a
specic life cycle, in general, a methodology can be applied in a different life cycles.
Examples of life cycles: Boehms spiral model, the Unied Process, the Waterfall model.
Examples of methodologies: Royces unied framework, Extreme Programming.
162 You are improving a legacy system. You need to customize a software life cycle for your project. Which activities
would you need? In which order?
Any answer to this question should include a life cycle with an inventory analysis activity (to assess what work
products exist), one or more reverse engineering activities (to recreate missing work products), and change activities
to change or improve the aspect of the legacy system under consideration.
163 Royce uses a management metric that counts the number of participants who leave the project or join the
project. You are managing a multi-team project and notice that the staff turnover in one team is high.
Hypothesize what causes could lead to such a symptom. For each cause, propose a remedy.
High-staff turnover is a negative indicator. It points to a fundamental problem that can only worsen if not addressed.
Some of the cause and remedies are depicted in Table 16-1
164 The heuristics we outlined in Section 16.5.4 indicate that the need for models is higher in distributed
organizations. Open-source projects are highly distributed projects that follow an entity-based life cycle and
typically do not have requirements or system design documents. Provide examples of how modeling knowledge
is made explicit and transferred among participants in such cases.
Open source projects typically feature models that can be easily rened or extended incrementally. Examples include
information stored in change tracking logs, conguration management logs, frequently asked questions, and how-tos.
165 Royces methodology considers six project factors (scale, stakeholder cohesion, process exibility, process
maturity, architectural risk, and domain experience) when tailoring a process for a specic project
(Section 16.4.1). Use these factors to describe which types of projects could use XP as an appropriate
methodology. Justify your choice for each factor.
Table 16-1
Cause Remedy
Unclear or unrealistic goals Provide better tools to meet the goals or redene goals.
Unrealistic schedule Revisit schedule or increase resources.
Conict with team leader Replace team leader.
Skills needed for the team are better rewarded in other
organizations.
Revise reward structure or determine if required skills are
needed.
Object-Oriented Software Engineering: Using UML, Patterns, and Java: Solutions to Exercises
2004 Prentice Hall November 14, 2003
Table 16-2 discusses the types of projects for each factor.
166 While working with Staphylococcus bacteria in 1928, Sir Alexander Fleming accidently dropped some bread
crumbs on one of the dishes. After a week the bacteria on this dish did not grow as expected. Fleming noticed a
bacteria-free circle around a mold that was contaminating the staphylococcus culture. Instead of throwing the
dish away because the planned experiment had failed, he isolated the mold, grew it in a uid medium, and
discovered a substance that prevented growth of the bacteria even when it was diluted 800 times. Discuss the
discovery of penicillin using the terminology and issues introduced in this chapter.
This is an example of redening project goals. The initial experiment of Fleming failed, as he contaminated the petri
dish. However, Fleming recognized that he discovered a substance that was much more signicant than the original
experiment.
167 Based on the assumption that the earth was round, Columbuss goal was to nd a shorter way to India by going
west instead of east. He encountered America instead of India. Discuss the discovery of America by Columbus
using the terminology and issues introduced in this chapter.
Columbus and his contemporaries thought he succeeded in discovering a new route to India. From his perspective, he
succeeded. Later, after maritime routes around Africa were discovered and when Magellans crew circumvented the
globe, it became clear that Columbus had found a new continent. In the terminology introduced in Chapter 1, this is
also an example of how a theory is devised, validated, and falsied, as knowledge is accumulated and tested against
the theory.
168 Select a project you have been involved with. Categorizing into methodological issues as dened in this chapter,
describe the methodological trade-offs that occurred in the project.
The discussion should include a description of the project environment followed by a discussion of each
methodological issue, including the options that were considered and those that were selected.
Table 16-2
Factor XP value
Scale Low to medium. The maximum number of participants that XP can
accommodate is limited to the number of participants who can meet at the
same time during the daily stand-up meeting.
Stakeholder cohesion High. As many requirements change during the project, it is critical that the
client and developers be able to agree informally on important decisions.
Process exibility High. XP has been designed for projects that feature a client who is willing
to be collocated with the project and to rene requirements and estimates at
the beginning each iteration.
Process maturity Medium. XP projects need a critical mass of experienced participants to be
effective. This knowledge is then transmitted to the novice participants
during pair programming and peer reviews. An insufcient number of
experienced developers knowledgeable in XP will result in difculty to
manage the expectations of the client.
Architectural risk High. XP can accommodate architectural changes until late in the project, as
the architecture is incrementally rened with the rest of the code.
Domain experience Low. A collocated client enables developers to learn domain knowledge
rapidly.