Instant download Object Oriented Software Engineering Using UML Patterns and Java 3rd Edition by Bernd Bruegge, Allen H Dutoit ISBN 0133002098 9780133002096 ebook 2025 edition
Instant download Object Oriented Software Engineering Using UML Patterns and Java 3rd Edition by Bernd Bruegge, Allen H Dutoit ISBN 0133002098 9780133002096 ebook 2025 edition
com
https://ebookball.com/product/object-oriented-software-
engineering-using-uml-patterns-and-java-3rd-edition-by-
bernd-bruegge-allen-h-dutoit-
isbn-0133002098-9780133002096-16122/
OR CLICK HERE
DOWLOAD EBOOK
ebookball.com
ebookball.com
ebookball.com
ebookball.com
Object-Oriented Software Engineering
Using UML, Patterns, and Java™
Third Edition
Prentice Hall
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Vice President and Editorial Director, ECS: Marketing Coordinator: Kathryn Ferranti
Marcia J. Horton Senior Managing Editor: Scott Disanno
Editor in Chief: Michael Hirsch Senior Operations Supervisor: Alan Fischer
Executive Editor: Tracy Dunkelberger Operations Specialist: Lisa McDowell
Assistant Editor: Melinda Haggerty Art Director: Kenny Beck
Editorial Assistant: Allison Michael Cover Designer: Bruce Kenselaar
Director of Marketing: Margaret Waples Media Editor: Dan Sandin
Marketing Manager: Erin Davis
Copyright © 2010, 2004, 2000 Pearson Education, Inc., publishing as Prentice Hall. All rights
reserved. Manufactured in the United States of America. This publication is protected by
Copyright, and permission should be obtained from the publisher prior to any prohibited
reproduction, storage in a retrieval system, or transmission in any form or by any means,
electronic, mechanical, photocopying, recording, or likewise. To obtain permission(s) to use
material from this work, please submit a written request to Pearson Education, Inc.,
Permissions Department, One Lake Street, Upper Saddle River, NJ, 07458.
Many of the designations by manufacturers and seller to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
Quote of Chapter 1 from Object-Oriented Analysis and Design with Applications by Booch,
© 1994 Benjamin Cummings Publishing Company Inc. Reprinted by permission of Pearson
Education, Inc.
Quotes of Chapters 2 & 12 from Zen and the Art of Motorcycle Maintenance by Robert Pirsig,
© 1974 by Robert Pirsig. Reprinted by permission of HarperCollins Publishers Inc. William
Morrow. For British Commonwealth excluding Canada, Zen and the Art of Motorcycle
Maintenance by Robert M. Pirsig published by Bodley Head. Used by persmission of The
Random House Group Limited.
Quote of Chapter 6 from The Emperor’s Old Clothes by C. A. R. Hoare, © 1981 Association
for Computing Machinery, Inc. Reprinted by permission.
Quote of Chapter 13 from Chapterhouse: Dune by Frank Herbert, © 1985 by Frank Herbert.
Used by permission of Berkeley Publishing Group, a division of Penguin Group (USA) Inc.
All other chapter quotes are in the public domain or fall within the realm of fair use.
Book photos: Bernd Bruegge, Rich Korf, and Blake Ward
10 9 8 7 6 5 4 3 2 1
Prentice Hall
is an imprint of
ISBN 10: 0-13-606125-7
www.pearsonhighered.com ISBN 13: 978-0-13-606125-0
To Goeg, Toby, and Clara.
—B.B.
To my family:
Vicky, Eleni, Anna-Maria, Michelle, and Chris
with love.
—A.H.D.
This page intentionally left blank
Foreword
O ver ten years ago, I read about a software engineering course taught by Bernd Bruegge at
Carnegie-Mellon University. In software engineering courses at many other universities, small
groups of 3 or 4 students were assigned several toy problems during a semester with deadlines of
less than a month. On such small projects, one strong programmer can carry the whole team by
brute force. It isn’t necessary to learn communication skills, use modeling tools, or deal with the
ambiguities of actual problems. Students come away unprepared for the complexities of real-
world development. In Bruegge’s course, the entire class worked on a single, semester-long
project to produce a query-oriented navigation system for the city of Pittsburgh. They had to
build on the interactive mapping system produced by the previous semester’s class. The clients
were managers for the county planning department and port authority. The geographic and bus
schedule data had misspellings, inaccuracies, and incompatible formats. The students produced
an accepted system of over 27,000 lines of code. What a difference from the toy projects taught
at many other places! Students came away from the course with an appreciation of the need for
strategy, organization, and tools to deal with the complexity and messiness of the real world.
They learned software engineering the only way one learns any craft—by practicing it on
realistic cases.
This book is a reflection of that pragmatic philosophy of software development as an
engineering discipline. The authors adopt a point of view—an object-oriented approach using
UML—that makes the many facets of software engineering approachable to students. They
cover both the modeling techniques and the human communications skills needed to achieve
success. They also include several chapters on managing change, a topic that appears in every
real project but which is often neglected in texts. Readers of this book will gain a solid
appreciation of the rich scope and complexity of software engineering.
v
vi Foreword
I particularly enjoyed the many illuminating anecdotes selected from a wide range of
fields. These provide lively examples of problems large and small that illustrate the subtleties
and traps that engineers must confront. Any book that makes relevant examples of Polynesian
navigation, the tangled history of the text of Tolkien’s Lord of the Rings, and grandmother’s
recipe for trimming hams is not only useful but also fun to read.
Jim Rumbaugh
Preface
T he K2 towers at 8,611 meters in the Karakorum range of the western Himalayas. It is the
second highest peak of the world and is considered the most difficult 8000er to climb. An
expedition to the K2 typically lasts several months in the summer, when the weather is most
favorable. Even in summer, snowstorms are frequent. An expedition requires thousands of
pounds of equipment, including climbing gear, severe weather protection gear, tents, food,
communication equipment, and pay and shoes for hundreds of porters. Planning such an
expedition takes a significant amount of time in the life of a climber and requires dozens of
participants in supporting roles. Once on site, many unexpected events, such as avalanches,
porter strikes, or equipment failures, will force the climbers to adapt, find new solutions, or
retreat. The success rate for expeditions to the K2 is currently less than 40%.
The United States National Airspace System (NAS) monitors and controls air traffic in the
United States. The NAS includes more than 18,300 airports, 21 air route traffic control centers,
and over 460 control towers. These add up to more than 34,000 pieces of equipment, including
radar systems, communication switches, radios, computer systems, and displays. The current
infrastructure is aging rapidly. The computers supporting the 21 air route traffic control centers,
for example, are IBM 3083 mainframes that date back to the early 1980s. In 1996, the United
States government initiated a program to modernize the NAS infrastructure, including
improvements such as satellite navigation, digital controller/pilot communications, and a higher
degree of automation in controlling the air routes, deciding the order in which aircraft land, and
controlling ground traffic as aircraft move from and to the runways. Such a complex
infrastructure, however, can only be modernized incrementally. Consequently, while new
components offering new functionality are introduced, older components still need to be
supported. For example, during the transition period, a controller will have to be able to use both
analog and digital voice channels to communicate with pilots. Finally, the modernization of the
vii
viii Preface
NAS coincides with a dramatic increase in global air traffic, predicted to double within the next
10–15 years. The previous modernizing effort of the NAS, called the Advanced Automation
System (AAS), was suspended in 1994 because of software-related problems, after missing its
initial deadline by several years and exceeding its budget by several billions of dollars.
Both of the above examples discuss complex systems in which external conditions can
trigger unexpected changes. Complexity puts the problem beyond the control of any single
individual. Change forces participants to move away from well-known solutions and to invent
new ones. In both examples, several participants need to cooperate and develop new techniques
to address these challenges. Failure to do so results in failure to reach the goal.
This book is about conquering complex and changing software systems.
The theme
The application domain (mountain expedition planning, air traffic control, financial
systems, word processing) usually includes many concepts that software developers are not
familiar with. The solution domain (user interface toolkits, wireless communication, middleware,
database management systems, transaction processing systems, wearable computers) is often
immature and provides developers with many competing implementation technologies.
Consequently, the system and the development project are complex, involving many different
components, tools, methods, and people.
As developers learn more about the application domain from their users, they update the
requirements of the system. As developers learn more about emerging technologies or about the
limitations of current technologies, they adapt the system design and implementation. As quality
control finds defects in the system and users request new features, developers modify the system
and its associated work products. The result is continuous change.
Complexity and change represent challenges that make it impossible for any single
person to control the system and its evolution. If controlled improperly, complexity and change
defeat the solution before its release, even if the goal is in sight. Too many mistakes in the
interpretation of the application domain make the solution useless for the users, forcing a
retreat from the route or the market. Immature or incompatible implementation technologies
result in poor reliability and delays. Failure to handle change introduces new defects in the
system and degrades performance beyond usability.
This book reflects more than 10 years of building systems and of teaching software
engineering project courses. We have observed that students are taught programming and
software engineering techniques in isolation, often using small problems as examples. As a
result, they are able to solve well-defined problems efficiently, but are overwhelmed by the
complexity of their first real development experience, when many different techniques and tools
need to be used and different people need to collaborate. Reacting to this state of affairs, the
typical undergraduate curriculum now often includes a software engineering project course,
organized as a single development project.
Preface ix
We wrote this book with a project course in mind. The book can be used, however, in other
situations as well, such as short and intensive workshops or short-term R&D projects. We use
examples from real systems and examine the interaction among state-of-the art techniques, such
as UML (Unified Modeling Language), Java-based technologies, design patterns, design
rationale, configuration management, and quality control. Moreover, we discuss project
management related issues that are related to these techniques and their impact on complexity
and change.
The principles
to missing information. We must learn to communicate with all project participants, including,
most importantly, the client and the end users.
These five principles are the basis for this book. They encourage and enable the reader to
address complex and changing problems with practical and state-of-the-art solutions.
The book
This book is based on object-oriented techniques applied to software engineering. It is
neither a general software engineering book that surveys all available methods nor a
programming book about algorithms and data structures. Instead, we focus on a limited set of
techniques and explain their application in a reasonably complex environment, such as a multi-
team development project that includes 20 to 60 participants. Consequently, the book also
reflects our biases, our strengths, and our weaknesses. We hope, nevertheless, that all readers
will find something they can use. The book is structured into 16 chapters organized into three
parts, which can be taught as a semester-long course.
Part I, Getting Started, includes three chapters. In this part, we focus on the basic skills
necessary for a developer to function in a software engineering context.
In Part II, Dealing with Complexity, we focus on methods and technologies that enable
developers to specify, design, and implement complex systems.
In Part III, Managing Change, we focus on methods and technologies that support the
control, assessment, and implementation of changes throughout the development of a system.
• In Chapter 12, Rationale Management, we describe the capture of design decisions and
their justifications. The models developed during requirements elicitation, analysis, and
system design help us deal with complexity by providing different perspectives on what
the system should be doing and how it should do it. To be able to deal with change, we
need also to know why the system is the way it is. Capturing design decisions,
considered alternatives, and their argumentation enables us to access the rationale of
the system.
• In Chapter 13, Configuration Management, we describe techniques for modeling the
project history. Configuration management complements rationale in helping us deal
with change. Version management records the evolution of the system. Release
management ensures consistency and quality across the components of a release.
Change management ensures that modifications to the system are consistent with
project goals.
• In Chapter 14, Project Management, we describe techniques for initiating a software
development project, tracking its progress, and dealing with risks and unplanned
xii Preface
events. We focus on organizations, roles, and management activities that allow a large
number of participants to collaborate and deliver a high-quality system within planned
constraints.
• In Chapter 15, Software Life Cycle, we describe software life cycles, such as Boehm’s
Spiral Model and the Unified Software Development Process, that provide an abstract
model of development activities. In this chapter, we also describe the Capability
Maturity Model, which is used for assessing the maturity of organizations.
• In Chapter 16, Methodologies: Putting It All Together, we describe methodologies and
heuristics for applying the material covered in the other chapters to concrete situations.
No matter how thorough the requirements elicitation or detailed the planning, projects
of any realistic size encounter unexpected events and changes. Dealing with uncertainty
makes real projects and systems look very different from projects and systems
examined in textbooks. In this chapter, we describe several different methodologies,
discuss issues that need to be addressed in every project, and present three case studies
of actual projects.
The topics above are strongly interrelated. To emphasize their relationships, we selected
an iterative approach. Each chapter consists of five sections. In the first section, we introduce the
issues relevant to the topic with an illustrative example. In the second section, we describe
briefly the activities of the topic. In the third section, we explain the basic concepts of the topic
with simple examples. In the fourth section, we detail the technical activities with examples
from real systems. Finally, we describe management activities and discuss typical trade-offs. In
Chapters 4–10, we present a running case study of a complex multi-user game management
system called ARENA. By repeating and elaborating on the same concepts in increasingly
complex examples, we hope to provide the reader with an operational knowledge of object-
oriented software engineering.
The courses
Building a large, complex system can be compared with climbing a big mountain. It is
good to have a route description, but the route can never be completely mapped out, as new
crevasses may open anytime. Even though we map out our software engineering knowledge in
this book, changes will occur and methods that we believe in now may be out of date soon.
How can we teach students to cope with such rapidly changing conditions? For us, the
most important thing to pass on to a student is not only knowledge of the map, but also the
ability to negotiate the terrain. Although it is wise to study the description of a route, there is no
substitute for the experience of actually traveling the route.
We wrote this book for a semester-long software engineering project course for senior or
graduate students. We assume that students have experience with a programming language such
as C, C++, C#, or Java. We expect that students have the necessary problem-solving skills to
attack technical problems, but we do not expect that they have been exposed to the complex or
Preface xiii
changing situations typical of system development. This book can also be used for other types of
courses, such as short, intensive professional courses.
Project and senior-level courses. A project course should include all the chapters of the
book, roughly in the order presented. An instructor may consider teaching more advanced
project management concepts from Chapter 14, Project Management, early in the course so that
students become familiar with planning and controlling.
Introductory-level course. An introductory course with homework should focus on the first
three sections of each chapter. The fourth section and the case study can be used as material for
homework and can simulate the building of a minisystem using paper for UML diagrams,
documents, and code.
Short technical course. The book can also be used for a short, intensive course geared
toward professionals. A technical course focusing on UML and object-oriented methods could
use the chapter sequence 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, covering all development phases from
requirements elicitation to testing. An advanced course would also include Chapter 12,
Rationale Management, and Chapter 13, Configuration Management.
Short management course. The book can also be used for a short, intensive course geared
toward managers. A management course focusing on managerial aspects such as
communication, risk management, rationale, maturity models, and UML could use the chapter
sequence 1, 2, 3, 14, 15, 16, 12, 13.
This edition started as an upgrade of our book to UML 2 and to the latest advances in agile
methods. In the process, we also added new material about system design and testing. We thank
Tracy Dunkelberger, our publisher, for her patience. We made the following changes:
• Comprehensive upgrade to the latest UML and OCL standards. We revised most
diagrams in the book to take advantage of the latest advances of UML and OCL. In
particular, we use component diagrams with ball-and-socket notation during system
and object design.
• Expanded material on agile methods. In the second edition, we introduced coverage of
the XP methodology in Chapter 16. In this edition, we extended the material on agile
methods to Scrum and Rugby and consequently adapted the material on testing,
configuration management, and project management in Chapters 11, 13, and 14.
• New material on continuous integration. A practice of agile methods, used in other
contexts as well, is the continuous integration of software changes into main production
trunk. While this practice allows integration problems to be identified, and thus
resolved, much earlier, its realization presents initially many challenges. We present
this new material in Chapter 13, Software Configuration Management.
xiv Preface
• New material on U2TP and automated testing. In our teaching, we found the extensions
of the UML 2 Testing Profile facilitate the discussion of testing concepts, in particular,
the distinction between the testing system and the system under test. This also allowed
us to extend the material on testing to automated testing and automatic test generation.
• Improvements of the case study and examples throughout. Since the last edition, we
received a lot of feedback about the case study and the examples in this book. We are
grateful of this feedback and consequently implemented many suggestions, too
numerous to enumerate here in detail.
Typographical conventions
We use the following conventions throughout the book:
Production notes
This book was written and composed using Adobe Framemaker. The final print images
were generated as PDF files using Adobe Acrobat Distiller.
Dr. Allen Dutoit works in the aerospace industry in the area of avionics software
development. He received his M.S. and Ph.D. from Carnegie Mellon University and his Diplôme
d’Ingénieur from the Swiss Federal Institute of Technology in Lausanne. He has taught software
engineering project courses with Professor Bruegge since 1993, both at Carnegie Mellon
University and the Technische Universität München, where they used and refined the methods
described in this book. Dutoit’s research covered several areas of software engineering and
object-oriented systems, including requirements engineering, rationale management, distributed
development, and prototype-based systems. He was previously affiliated with the Software
Engineering Institute and the Institute for Complex Engineered Systems at Carnegie Mellon
University.
Opener Pictures
The pictures at the beginning of each chapter are from an Alpine-style ascent of the West
Rib of Denali (6,193 m) made by one of the authors before starting to work on this book. During
this trip, the analogy between software development and mountaineering became more than
obvious. The pictures chronicle the climb, showing our expedition car on the Alaskan Canadian
Highway, a view of Mt. Robson with the Kain Face (Chapter 1), a view of Denali from the plane
(Chapters 2 and 4), the beginning of the West Rib (Chapter 3), a look 1000 meters down from
the top of the West Rib showing our foot tracks on the East Kahiltna Glacier (Chapter 5), Mt.
Foraker from Camp 5 (Chapter 6), a beautiful but difficult edge around 5,000m (Chapter 7), the
Base Camp of the normal route where we reused the remains of an igloo (Chapter 8), the landing
area for Doug Geeting’s plane (Chapter 9), a bivouac place at the top of the West Rib named
“Hotel Crux,” because one cannot dig an area big enough for a tent (Chapter 10), crossing the
Bergschrund (Chapter 11), a fresh avalanche area (Chapter 12), Denali with the Cassin Ridge
(Chapter 13), plans for different routes to the summit (Chapter 14), a “horizontal” sunrise at the
start of the Cassin Ridge (Chapter 15), and the summit of Denali (Chapter 16).
The cover picture shows the summit of K2.
This page intentionally left blank
Acknowledgments
T his book has witnessed much complexity and change during its development. In 1989, the
first author (B.B.) originally set out to teach software engineering in a single-project course
format. The goal was to expose students to the important issues in software engineering by
solving real problems described by real clients with real tools under real constraints. The first
course, listed as 15-413 in the Carnegie Mellon catalog of courses, had 19 students, used SA/SD,
and produced 4,000 lines of code. Heavily influenced by the book by James Rumbaugh and his
colleagues on object-oriented modeling and design, we have used object-oriented methods since
then. We taught several distributed versions of the course involving up to 100 students from
Carnegie Mellon and Technische Universität München, resulting in systems with up to 500
pages of documentation and 50,000 lines of code. We currently are teaching a distributed course
involving students from University of Otago in New Zealand and Technische Universität
München.
The drawback of project courses is that instructors do not escape the complexity and
change that their students experience. Instructors quickly become participants in the
development themselves, often acting as project managers. We hope that this book will help both
instructors and students conquer this level of complexity and change.
Somehow, in spite of much energy spent on the course, we found time to write and
complete this textbook and its subsequent revision, thanks to the help and patience of numerous
students, clients, teaching assistants, support staff, coinstructors, reviewers, Prentice Hall staff,
and most of all, our families. Some have contributed to improving the course, others have
provided constructive feedback on successive drafts, and yet others were simply there when the
going got tough. Over the past 20 years, we have indebted ourselves to many people whom we
acknowledge here.
xvii
xviii Acknowledgments
The participants of the project courses. Workstation Fax (1989), Interactive Maps (1991),
Interactive Pittsburgh (1991), FRIEND (1992, 1993, 1994), JEWEL, GEMS (1991, 1994, 1995),
DIAMOND (1995, 1996), OWL (1996, 1997), JAMES (1997, 1998), PAID (1998, 1999),
STARS (1999, 2000, 2001), TRAMP (2001, 2002), ARENA (2002, 2003), CampusTV (2004,
2005), Virtual Symphony Orchester (2005), WALOS (2006), and DOLLI (2007, 2008).
The people who supported the projects. For their commitment, for their kindness, and for
getting us out of trouble when we needed it: Martin Bauer, Ulrich Bauer, Catherine Copetas,
Oliver Creighton, Ava Cruse, Barry Eisel, Luca Girardo, Dieter Hege, Mariss Jansons, Joyce
Johnstone, SiegfriedKiese, Siegfried Klinkhammer, Rafael Kobylinski, Marc Lindike, Asa
MacWilliams, Monika Markl, Key Maerkl and his Aritus Quartet, Pat Miller, Martin Ott, Ralf
Pfleghar, Martin Pittenauer, Harald Ranner, Joachim Reichel, Max Reiss, Barbara Sandling,
Christian Sandor, Ralph Schiessl, Arno Schmackpfeffer, Helma Schneider, Stephan Schoenig,
Steffen Schwarz, Martin Wagner, Uta Weber, Timo Wolf, and Michael Zaddach.
The collegues, coinstructors, and friends who influenced us. Mario Barbacci, Len Bass,
Ben Bennington, Elizabeth Bigelow, Roberto Bisiani, Naoufel Boulila, Harry Q Bovik, Andreas
Braun, Manfred Broy, Sharon Burks, Marvin Carr, Mike Collins, Robert Coyne, Douglas
Cunningham, Michael Ehrenberger, Kim Faught, Peter Feiler, Allen Fisher, Laura Forsyth, Eric
Gardner, Helen Granger, Thomas Gross, Volker Hartkopf, Bruce Horn, David Kauffer, Gudrun
Klinker, Kalyka Konda, Suresh Konda, Rich Korf, Birgitte Krogh, Sean Levy, Frank Mang, K.
C. Marshall, Dick Martin (“Tang Soo”), Horst Mauersberg, Roy Maxion, Russ Milliken, Ira
Monarch, Rhonda Moyer, Robert Patrick, Brigitte Pihulak, Mark Pollard, Martin Purvis, Raj
Reddy, Yoram Reich, James Rumbaugh, Johann Schlichter, Mary Shaw, Jane Siegel, Daniel
Siewiorek, Asim Smailagic, Mark Stehlik, Eswaran Subrahmanian, Stephanie Szakal, Tara
Taylor, Michael Terk, Günter Teubner, Marc Thomas, Walter Tichy, Jim Tomayko, Blake Ward,
Alex Waibel, Art Westerberg, Jeannette Wing, and Tao Zhang.
Reviewers who gave us constructive feedback and who helped us get many details right:
Martin Barrett, Brian Berenbach, Alex Borgida, Ramsey Bualuan, Dave Chesney, Andrea De
Lucia, Debora East, Thomas Eichhorn, Henry Etlinger, Ray Ford, Jim Helm, Jonas Helming,
Korbinian Herrmann, Allen Holliday, John Keklak, Robert Lechner, Max Koegel, Jonathan
Maletic, Jeff McKinstry, Bruce Maxim, Gerhard Mueller, Michael Nagel, Helmut Naughton,
Barbara Paech, Dennis Pagano, Daniel Paulish, Joan Peckham, Gary Pollice, David Rine,
Florian Schneider, Ingo Schneider, Anthony Sullivan, Damla Turgut, and the many anonymous
reviewers for their constructive and detailed comments. All remaining errors are ours.
Everybody at Prentice Hall who helped us making this book a reality, in particular Alan Apt,
our first publisher, for never losing faith; Lakshmi Balasubramanian, Toni Holm, Patrick
Lindner, Camille Trentacoste, Jake Warde, and, for this edition, Tracy Dunkelberger, Scott
Disanno, and many others who worked hard toward the completion of this book, but whom we
did not have the opportunity and pleasure to meet personally.
And finally, our families, to whom we dedicate this book and without whose infinite love and
patience this enterprise would never have been possible.
Contents at a Glance
Foreword v
Preface vii
Acknowledgments xvii
Foreword v
Preface vii
Acknowledgments xvii
xxi
xxii Table of Contents
5.4.5
Modeling Interactions among Objects with
CRC Cards 189
5.4.6 Identifying Associations 190
5.4.7 Identifying Aggregates 192
5.4.8 Identifying Attributes 193
5.4.9 Modeling State-Dependent Behavior of
Individual Objects 194
5.4.10 Modeling Inheritance Relationships between Objects 195
5.4.11 Reviewing the Analysis Model 196
5.4.12 Analysis Summary 197
5.5 Managing Analysis 199
5.5.1 Documenting Analysis 199
5.5.2 Assigning Responsibilities 200
5.5.3 Communicating about Analysis 201
5.5.4 Iterating over the Analysis Model 203
5.5.5 Client Sign-Off 204
5.6 ARENA Case Study 206
5.6.1 Identifying Entity Objects 206
5.6.2 Identifying Boundary Objects 211
5.6.3 Identifying Control Objects 212
5.6.4 Modeling Interactions Among Objects 212
5.6.5 Reviewing and Consolidating the Analysis Model 213
5.6.6 Lessons Learned 217
5.7 Further Readings 218
5.8 Exercises 219
Chapter 6 System Design:
Decomposing the System 223
6.1 Introduction: A Floor Plan Example 224
6.2 An Overview of System Design 226
6.3 System Design Concepts 228
6.3.1 Subsystems and Classes 228
6.3.2 Services and Subsystem Interfaces 230
6.3.3 Coupling and Cohesion 230
6.3.4 Layers and Partitions 235
6.3.5 Architectural Styles 238
6.4 System Design Activities: From Objects to Subsystems 247
xxvi Table of Contents
2
1
Introduction to
Software Engineering
The amateur software engineer is always in search of magic,
some sensational method or tool whose application promises to
render software development trivial. It is the mark of the
professional software engineer to know that no such panacea
exists.
T he term software engineering was coined in 1968 as a response to the desolate state of the
art of developing quality software on time and within budget. Software developers were not able
to set concrete objectives, predict the resources necessary to attain those objectives, and manage
the customers’ expectations. More often than not, the moon was promised, a lunar rover built,
and a pair of square wheels delivered.
The emphasis in software engineering is on both words, software and engineering. An
engineer is able to build a high-quality product using off-the-shelf components and integrating
them under time and budget constraints. The engineer is often faced with ill-defined problems
and partial solutions, and has to rely on empirical methods to evaluate solutions. Engineers
working in such application domains as passenger aircraft design and bridge construction have
successfully met similar challenges. Software engineers have not been as successful.
The problem of building and delivering complex software systems on time has been
actively investigated and researched. Everything has been blamed, from the customer (“What do
you mean I can’t get the moon for $50?”) to the “soft” in software (“If I could add that one last
feature ...”) to the youth of this discipline. What is the problem?
Useful software systems are complex. To remain useful they need to evolve with the end users’
need and the target environment. In this book, we describe object-oriented techniques for
conquering complex and changing software systems. In this chapter, we provide a motivation for
object-oriented techniques and define the basic concepts used throughout this book.
3
4 Chapter 1 • Introduction to Software Engineering
Each of the failures described above resulted from a software-related problem. In some cases,
developers did not anticipate seldom-occurring situations (a person living more than 100 years,
leap years impacting expiration dates). In other cases, developers did not anticipate the user
actively misusing the system (taping down a button, exploiting security holes in network
software). In yet other cases, system failures resulted from management failures (late and over-
budget delivery, on-time delivery of an incorrect system, unnecessary complexity).
Software systems are complex creations. They perform many functions; they are built to
achieve many different, and often conflicting, objectives. They comprise many components;
many of their components are custom made and complex themselves. Many participants from
different disciplines take part in the development of these components. The development process
and the software life cycle often spans many years. Finally, complex systems are difficult to
understand completely by any single person. Many systems are so hard to understand, even
during their development phase, that they are never finished: these are called vaporware.
Software development projects are subject to constant change. Because requirements are
complex, they need to be updated when errors are discovered and when the developers have a
better understanding of the application. If the project lasts many years, the staff turn-around is
high, requiring constant training. The time between technological changes is often shorter than
the duration of the project. The widespread assumptions of a software project manager that all
changes have been dealt with and that the requirements can be frozen will lead to the
deployment of an irrelevant system.
In the next section, we present a high-level view of software engineering. We describe
software engineering from the perspective of science, engineering, and knowledge acquisition
and formalization. In Section 1.3, we describe in more detail the main terms and concepts we
use in this book. In Section 1.4, we provide an overview of the development activities of
software engineering. In Section 1.5, we provide an overview of the managerial activities of
software engineering.
into knowledge. Knowledge acquisition is not sequential, as a single piece of additional data can
invalidate complete models.
Software engineering is a rationale-driven activity. When acquiring knowledge and
making decisions about the system or its application domain, software engineers also need to
capture the context in which decisions were made and the rationale behind these decisions.
Rationale information, represented as a set of issue models, enables software engineers to
understand the implication of a proposed change when revisiting a decision.
In this section, we describe in more detail software engineering from the perspectives of
modeling, problem solving, knowledge acquisition, and rationale. For each of these activities,
software engineers have to work under people, time, and budget constraints. In addition, we
assume that change can occur at any time.
1.2.1 Modeling
The purpose of science is to describe and understand complex systems, such as a system of
atoms, a society of human beings, or a solar system. Traditionally, a distinction is made between
natural sciences and social sciences to distinguish between two major types of systems. The
purpose of natural sciences is to understand nature and its subsystems. Natural sciences include,
for example, biology, chemistry, physics, and paleontology. The purpose of the social sciences is
to understand human beings. Social sciences include psychology and sociology.
There is another type of system that we call an artificial system. Examples of artificial
systems include the space shuttle, airline reservation systems, and stock trading systems. Herbert
Simon coined the term sciences of the artificial to describe the sciences that deal with artificial
systems [Simon, 1970]. Whereas natural and social sciences have been around for centuries, the
sciences of the artificial are recent. Computer science, for example, the science of understanding
computer systems, is a child of the twentieth century.
Many methods that have been successfully applied in the natural sciences and humanities
can be applied to the sciences of the artificial as well. By looking at the other sciences, we can
learn quite a bit. One of the basic methods of science is modeling. A model is an abstract
representation of a system that enables us to answer questions about the system. Models are
useful when dealing with systems that are too large, too small, too complicated, or too expensive
to experience firsthand. Models also allow us to visualize and understand systems that either no
longer exist or that are only claimed to exist.
Fossil biologists unearth a few bones and teeth preserved from some dinosaur that no one
has ever seen. From the bone fragments, they reconstruct a model of the animal, following rules
of anatomy. The more bones they find, the clearer their idea of how the pieces fit together and
the higher the confidence that their model matches the original dinosaur. If they find a sufficient
number of bones, teeth, and claws, they can almost be sure that their model reflects reality
accurately, and they can guess the missing parts. Legs, for example, usually come in pairs. If the
left leg is found, but the right leg is missing, the fossil biologists have a fairly good idea what the
What Is Software Engineering? 7
missing leg should look like and where it fits in the model. This is an example of a model of a
system that no longer exists.
Today’s high-energy physicists are in a position similar to that of a fossil biologist who has
found most of the bones. Physicists are building a model of matter and energy and how they fit
together at the most basic, subatomic level. Many years of experiments with particle accelerators
have given high-energy physicists enough confidence that their models reflect reality and that
the remaining pieces that are not yet found will fit into the so-called standard model. This is an
example of a model for a system that is claimed to exist.
Both system modelers, fossil biologists and high-energy physicists, deal with two types of
entities: the real-world system, observed in terms of a set of phenomena, and the application
domain model, represented as a set of interdependent concepts. The system in the real world is a
dinosaur or subatomic particles. The application domain model is a description of those aspects
of the real-world system that are relevant to the problem under consideration.
Software engineers face similar challenges as fossil biologists and high-energy physicists.
First, software engineers need to understand the environment in which the system has to operate.
For a train traffic control system, software engineers need to know train signaling procedures.
For a stock trading system, software engineers need to know trading rules. The software
engineer does not need to become a fully certified train dispatcher or a stock broker; they only
need to learn the application domain concepts that are relevant to the system. In other terms,
they need to build a model of the application domain.
Second, software engineers need to understand the systems they could build, to evaluate
different solutions and trade-offs. Most systems are too complex to be understood by any one
person, and most systems are expensive to build. To address these challenges, software
engineers describe important aspects of the alternative systems they investigate. In other terms,
they need to build a model of the solution domain.
Object-oriented methods combine the application domain and solution domain modeling
activities into one. The application domain is first modeled as a set of objects and relationships.
This model is then used by the system to represent the real-world concepts it manipulates. A
train traffic control system includes train objects representing the trains it monitors. A stock
trading system includes transaction objects representing the buying and selling of commodities.
Then, solution domain concepts are also modeled as objects. The set of lines used to depict a
train or a financial transaction are objects that are part of the solution domain. The idea of
object-oriented methods is that the solution domain model is a transformation of the application
domain model. Developing software translates into the activities necessary to identify and
describe a system as a set of models that addresses the end user’s problem. We describe in more
detail modeling and the concepts of objects in Chapter 2, Modeling with UML.
8 Chapter 1 • Introduction to Software Engineering
that offered to teach all the German poems by pouring them into the student’s head in 6 hours
with a funnel.1 The idea of using a funnel for learning is based on the widespread assumption
that our mind is a bucket that is initially empty and can be filled in a linear fashion. Material
enters through our senses, accumulates, and is digested. Popper calls this linear acquisition
model for knowledge “the bucket theory of the mind.” Among the many other things that are
wrong with this theory (described in [Popper, 1992]) is the assumption that knowledge is
conceived as consisting of things that can fill a bucket; that is, the fuller the bucket, the more we
know.
Knowledge acquisition is a nonlinear process. The addition of a new piece of information
may invalidate all the knowledge we have acquired for the understanding of a system. Even if
we had already documented this understanding in documents and code (“The system is 90%
coded, we will be done next week”), we must be mentally prepared to start from scratch. This
has important implications on the set of activities and their interactions we define to develop the
software system. The equivalent of the bucket theory of the mind is the sequential waterfall
model for software development, in which all steps of the engineering method are accomplished
sequentially.
There are several software processes that deal with this problem by avoiding the sequential
dependencies inherent in the waterfall model. Risk-based development attempts to anticipate
surprises late in a project by identifying the high-risk components. Issue-based development
attempts to remove the linearity altogether. Any development activity—analysis, system design,
object design, implementation, testing, or delivery—can influence any other activity. In issue-
based development, all these activities are executed in parallel. The difficulty with nonsequential
development models, however, is that they are difficult to manage.
1.2.4 Rationale
When describing the acquisition or evolution of knowledge, we are even less well equipped than
when describing the knowledge of an existing system. How does a mathematician derive a
proof? Mathematical textbooks are full of proofs, but rarely provide hints about the proof
derivation. This is because mathematicians do not think this background is important. Once the
axioms and the rules of deduction have been stated, the proof is timeless.
For software engineers, the situation is different. Assumptions that developers make about
a system change constantly. Even though the application domain models eventually stabilize
once developers acquire an adequate understanding of the problem, the solution domain models
are in constant flux. Design and implementation faults discovered during testing and usability
problems discovered during user evaluation trigger changes to the solution models. Changes can
also be caused by new technology. The availability of a long-life battery and of high-bandwidth
wireless communication, for example, can trigger revisions to the concept of a portable terminal.
1. G. P. Harsdoerfer (1607–1658), “Poetischer Trichter, die teutsche Dicht- und Reimkunst, ohn Behuf der lateinischen
Sprache, in 6 Stunden einzugießen,” Nuernberg, 1630.
10 Chapter 1 • Introduction to Software Engineering
Change introduced by new technology often allows the formulation of new functional or
nonfunctional requirements. A typical task of software engineers is to change a currently
operational software system to incorporate this new enabling technology. To change the system,
it is not enough to understand its current components and behavior. It is also necessary to
capture and understand the context in which each design decision was made. This additional
knowledge is called the rationale of the system.
Capturing and accessing the rationale of a system is not trivial. First, for every decision
made, several alternatives may have been considered, evaluated, and argued. Consequently,
rationale represents a much larger amount of information than do the solution models. Second,
rationale information is often not explicit. Developers make many decisions based on their
experience and their intuition, without explicitly evaluating different alternatives. When asked to
explain a decision, developers may have to spend a substantial amount of time recovering its
rationale. In order to deal with changing systems, however, software engineers must address the
challenges of capturing and accessing rationale.
So far, we have presented a high-level view of software engineering from the perspectives of
modeling, problem solving, knowledge acquisition, and rationale. In this section, we describe
the main terms and concepts we use throughout the book.2 A Project, whose purpose is to
develop a software system, is composed of a number of Activities. Each Activity is in turn
composed of a number of Tasks. A Task consumes Resources and produces a WorkProduct. A
WorkProduct can be either a System, a Model, or a Document. Resources are either
Participants, Time, or Equipment. A graphical representation of these concepts is shown in
Figure 1-1. Each rectangle represents a concept. The lines among the rectangles represent
different relationships between the concepts. For example, the diamond shape indicates
aggregation: a Project includes a number of Activities, which includes a number of Tasks.
The triangle shape indicates a generalization relationship; Participants, Time, and Equipment
are specific kinds of Resources. Figure 1-1 is represented in the Unified Modeling Language
(UML) notation. We use UML throughout the book to represent models of software and other
systems. Intuitively, you should be able to understand this diagram without full knowledge of the
UML semantics. Similarly, you can also use UML diagrams when interacting with a client or a
user, even though they may not have any knowledge of UML. We describe the semantics of
these diagrams in detail in Chapter 2, Modeling with UML.
2. As much as possible, we follow the definitions of the IEEE standards on Software Engineering [IEEE Std. 610.12-
1990].
Software Engineering Concepts 11
Project
Activity
is produced by * consumes
* *
WorkProduct Task Resources
System Participant
Model Time
Document Equipment
Figure 1-1 Software engineering concepts depicted as a UML class diagram [OMG, 2009].
Developing a software system requires the collaboration of many people with different
backgrounds and interests. The client orders and pays for the system. The developers construct
the system. The project manager plans and budgets the project and coordinates the developers
and the client. The end users are supported by the system. We refer to all the persons involved in
the project as participants. We refer to a set of responsibilities in the project or the system as a
role. A role is associated with a set of tasks and is assigned to a participant. The same
participant can fill multiple roles.
Consider a TicketDistributor system:
TicketDistributor is a machine that distributes tickets for trains. Travelers have the option of
selecting a ticket for a single trip or for multiple trips, or selecting a time card for a day or a week. The
TicketDistributor computes the price of the requested ticket based on the area in which the trip will
take place and whether the traveler is a child or an adult. The TicketDistributor must be able to
handle several exceptions, such as travelers who do not complete the transaction, travelers who attempt
to pay with large bills, and resource outages, such as running out of tickets, change, or power.
Table 1-1 Examples of roles in software engineering for the TicketDistributor project.
Client The client is responsible for providing the high- Train company that
level requirements on the system and for defining contracts the
the scope of the project (delivery date, budget, TicketDistributor.
quality criteria).
Human Factors A human factors specialist is responsible for the Zoe (Human Computer
Specialist usability of the system. Interaction specialist)
a. As TicketDistributor is a small project, Zoe fills both the human factor specialist and the tester roles,
and John fills the analyst and the technical writer roles.
Specification Deliverable The specification describes the system from the user’s point of
view. It is used as a contractual document between the project
and the client. The TicketDistributor specification
describes in detail how the system should appear to the traveler.
Status report Internal work A status report describes at a given time the tasks that have
product been completed and the tasks that are still in progress. The
status report is produced for the manager, Alice, and is usually
not seen by the train company.
Test manual Internal work The test plans and results are produced by the tester, Zoe. These
product documents track the known defects in the prototype
TicketDistributor and their state of repair. These documents
are usually not shared with the client.
A task represents an atomic unit of work that can be managed: A manager assigns it to a
developer, the developer carries it out, and the manager monitors the progress and completion of
the task. Tasks consume resources, result in work products, and depend on work products
produced by other tasks.
Resources are assets that are used to accomplish work. Resources include time,
equipment, and labor. When planning a project, a manager breaks down the work into tasks and
assigns them to resources.
Table 1-3 describes examples of activities, tasks, and resources in software engineering.
Table 1-3 Examples of activities, tasks, and resources for the TicketDistributor project.
Develop “Out of Change” Task This task, assigned to Zoe (the tester) focuses on
test case for verifying the behavior of the ticket distributor
TicketDistributor when it runs out of money and cannot give the
correct change back to the user. This activity
includes specifying the environment of the test, the
sequence of inputs to be entered, and the expected
outputs.
Review “Access Online Task This task, assigned to John (the human factors
Help” use case for usability specialist) focuses on detecting usability issues in
accessing the online help features of the system.
colors are nonfunctional requirements. Other nonfunctional requirements may include using
specific hardware platform for the system, security requirements, how the system should deal
with failures and faults, and how to provide backward compatibility with an old system that the
client is unwilling to retire.
ebookball.com