Professional Documents
Culture Documents
SafeHome PDF
SafeHome PDF
y The SafeHome
Th S f H company h has d
developed
l d an iinnovative
i HW box
b that
h
implements wireless Internet (802.11) connectivity in a very small
form factor (the size of a matchbook).
y The idea is to use this technology to develop and market a
comprehensive home automation product line.
◦ This would provide security functions, control over telephone answering
machines, lights, heating, air conditioning, and home entertainment
devices.
y The first generation of the system will only focus on home security
and surveillance since that is a market the public readily
understands.
CS350 Intro. to SE
Spring 2008 4
complex than anything we've push paper around.
done in the past. Doug: Give it a chance before
Jamie: Doesn
Doesn'tt look that hard,
hard you go negative on me
me. Here's
Here s
but I agree ... our ad hoc approach what I mean. [Doug proceeds to
to past projects won't work here, describe the process framework
particularly if we have a very tight described in Chapter
p 2 and the
timeline. prescriptive process models
Doug (smiling): I want to be a presented to this point.
bit more professional in our Doug: So anyway, it seems to
approach. I went to a short course me that a linear model is not for us
last week and learned a lot about ... assumes we have all
software engineering
g g ... g
good stuff. requirements up front and
We need a process here. knowing this place, that's not
Jamie (with a frown): My job is likely.
Vinod: Yeah, and that RAD
to build computer programs
programs, not
model sounds way too IT-
CS350 Intro. to SE
Spring 2008 5
oriented ... probably good for
building an inventory control
system
y or something, g, but it's just
j
not right for SafeHome.
Doug: I agree.
CS350 Intro. to SE
Spring 2008 6
Selecting
g a Process Model,, Part 2(pg
(pg 90-
90-91
91))
y The scene: sense and I really like the flow of
◦ Meeting room for the software that spiral model thing. That's
engineering group at CPI Corporation, a keepin' it real
keepin real.
company that makes consumer products
y Vinod: I agree. We deliver an
for home and commercial use.
increment, learn from customer
y The players:
feedback, replan, and then deliver
◦ Lee Warren, engineering manager;
◦ Doug Miller, software engineering
another increment. It also fits into
manager; the nature of the product. We can
◦ Ed and Vinod,, members of the software have something g on the market
engineering team. fast and then add functionality
y The conversation: with each version, er, increment.
y (Doug describes evolutionary y Lee: Wait a minute, did y you sayy
process options.) that we regenerate the plan with
y Ed: Now I see something I like. An each tour around the spiral, Doug?
incremental approach makes That's not so great, we
CS350 Intro. to SE
Spring 2008 7
need one plan, one schedule, and y Doug (smiling): Then you'll have
we've got to stick to it. to reeducate them, buddy.
y Doug: g That's old school thinking, g
Lee. Like Ed said, we've got to
keep it real. I submit that it's better
to tweak the plan as we learn
more and as changes are
requested. It's way more realistic.
What's the point of a plan if it
d
doesn't 't reflect
fl t reality?
lit ?
y Lee (frowning): I suppose so, but
senior management's not going to
lik thi
like this ... th
they wantt a fifixed
d plan.
l
CS350 Intro. to SE
Spring 2008 8
Considering Agile Software Development (pg
113--114)
113
y The scene: y Doug: And?
◦ Doug Miller's office. y Vinod: I was talking to a friend at
y The players: another company,
p y and he was telling g
◦ Doug Miller, software engineering me about Extreme Programming. It's
manager;
an agile process model, heard of it?
◦ Jamie Lazar, software team member;
◦ Vinod Raman,
Raman software team member.
member
y Doug: Yeah, some good, some bad.
y The conversation: y Jamie: Well, it sounds pretty good to
us. Lets you develop software really
y (A knock on the door)
fast, uses something called pair
y Jamie: Doug,
Doug you got a minute? programming to do real-time quality
y Doug: Sure Jamie, what's up? checks ... it's pretty cool, I think.
y Jamie: We've been thinking about y Doug: It does have a lot of really
our process discussion
di i yesterday
t d ... good ideas. I like the pair
you know, what process we're
going to choose for this new
SafeHome project.
project
CS350 Intro. to SE
Spring 2008 9
programming concept, for y Doug: So you guys think we
instance, and the idea that should use XP?
stakeholders should be part of the y Jamie: It's definitelyy worth
team. considering.
y Jamie: Huh? You mean that y Doug: I agree. And even if we
marketing will work on the project choose an incremental model as
team with us? our approach,h th
there's' no reason
y Doug (nodding): They're a why we can't incorporate much of
stakeholder, aren't they? what XP has to offer.
y Jamie: Jeez ... they'll
they ll be y Vinod: Doug,
Doug before you said
requesting changes every five "some good, some bad." What
minutes. was the "bad"?
y Vinod: Not necessarily. y Myy friend y Doug:
g The thing g I don't like is the
said that there are ways to way XP downplays analysis and
"embrace" changes during an XP design ... sort of says that writing
project. code is where the action is.
CS350 Intro. to SE
Spring 2008 10
y (The team members look at one y Doug: I think we can, Vinod. In
another and smile.) fact, I'm sure of it.
y Doug: g So yyou agree
g with the XP
approach?
y Jamie (speaking for both):
Writing code is what we do, Boss!
y Doug (laughing): True, but I'd
like to see you spend a little less
time coding and then re-coding
and a little more time analyzing
what has to be done and
designing a solution that works.
y Vinod: Maybe we can have it both
ways, agility with a little discipline.
CS350 Intro. to SE
Spring 2008 11
Communication Mistakes (pg135)
y The scene: y Ed: What do you mean?
◦ Software engineering team workspace. y Jamie: Well, I gave Lisa Perez a
y The players: call. She's the marketing g honcho
◦ Jamie Lazar, software team member; on this thing."
◦ Vinod Raman, software team member;
y Vinod: And ... ?
◦ Ed Robbins software team member.
y Jamie: I wanted her to tell me
y The conversation:
Th ti
about SafeHome features and
y Ed: What have you heard about functions ... that sort of thing.
this SafeHome project? Instead, she began asking me
y Vinod:
Vi d The Th kick-off
ki k ff meeting ti isi questions about security systems,
scheduled for next week. surveillance systems ... I'm no
y Jamie: I've already done a little bit expert.
off investigation,
i ti ti but
b t it didn't
did 't go y Vinod: What does that tell you?
well." y (Jamie shrugs.)
y Vinod: That marketing g will need
CS350 Intro. to SE
Spring 2008 12
us to act as consultants and that y Vinod: I saw Doug reading a book
we'd better do some homework on on "requirements engineering." I'll
this product area before our kick- bet that lists some principles of
off meeting. Doug said that he good communication. I'm going to
wanted us to "collaborate" with borrow it from him.
our customer, so we'd better learn y Jamie: Good idea ... then you can
h
how tto do
d ththat.t teach us.
y Ed: Probably would have been y Vinod (smiling): Yeah, right.
better to stop by her office. Phone
calls
ll jjustt d
don't't workk as wellll ffor thi
this
sort of thing.
y Jamie: You're both right. We've
gott to
t gett our actt together
t th or our
early communications will be a
struggle.
CS350 Intro. to SE
Spring 2008 13
Preliminary System Engineering (pg163-
(pg163-164)
y The scene: y Jamie: That's why we have
◦ Software engineering team workspace additional meetings scheduling for
after the SafeHome kickoff meeting has the next five days. By the way, I
occurred
occurred. suggested that two of the
y The players: "customers" move over here for
◦ Jamie Lazar, software team member; the next few weeks. You know,
◦ Vinod Raman, software team member; live with us so we can reallyy
◦ Ed Robbins, software team member. communicate, er, collaborate.
y The conversation: y Vinod: How did that go?
y Jamie: Well, they looked at me
y Ed:
d I tthink itt went
e t pretty
p etty well.
e
lik I was crazy, b
like butt D
Doug [th
[the
y Vinod: Yeah ... but all we did was software engineering manager]
look at the overall system--we've likes the idea--it's agile--so he's
got p
g plenty y of requirements
q talking to them.
gathering work left to do for the y Ed: I was taking notes using my
software. PDA during the meeting, and I
CS350 Intro. to SE
Spring 2008 14
y came up with a list of basic panels, various sensors, and
applicance/device controllers.
functions.
◦ All will communicate via wireless
y Jamie: Cool, let's see. protocols ((e.g.,
p g , 802.11b)) and will be
y Ed: I've already e-mailed both of designed for new-home construction and
for application within existing homes.
you a copy. Take a look and we'll
◦ All hardware with the exception of our
talk. new wireless box will be off the shelf
shelf.
y Vinod: How about after lunch? y Basic software functionality that I
y (Jamie and Vinod received the could glean from our kick-off
following
g from Ed)) Preliminary
y conversation.
co e sat o
notes of the structure/functionality y Home security functions:
of SafeHome: ◦ Standard window/door/motion sensor
◦ The system will make use of one or more monitoring for unauthorized access
PCs, various wall-mounted and/or (break-ins).
handheld control ◦ Monitoring for fire, smoke, and CO levels.
CS350 Intro. to SE
Spring 2008 15
◦ Monitoring for water levels in basement y Home management functions:
(e.g., flood or broken water heater).
◦ Control lighting.
◦ Monitoring for outside movement.
◦ Control appliances.
◦ Change security setting via the Internet
Internet.
◦ Control HVAC.
y Home surveillance functions: ◦ Control video/audio equipment
◦ Connect to one or more video cameras throughout house.
placed inside/outside house. ◦ Ability
y to set house for "vacation/travel
◦ Control pan/zoom for cameras. mode" with one button sets.
◦ Define camera monitoring zones. ◦ Set appliances/lighting/HVAC
◦ Display camera views on PC. accordingly.
◦ Access camera views via the Internet
Internet. ◦ Set answering machine message.
message
◦ Selectively record camera output digitally. ◦ Contacts vendors to stop paper, mail, etc.
◦ Replay camera output.
CS350 Intro. to SE
Spring 2008 16
y Communication management y Other functions:
functions: ◦ As yet undefined.
◦ Answering machine functions. ◦ All functions are accessible via the
◦ List of callers via caller ID. I t
Internett with
ith appro-priate
i t password d
protection.
◦ Messages, time-stamped.
◦ Message text via voice recognition
system.
◦ E-mail functions (all standard e-mail
functions).
◦ Standard e-mail display.
◦ V i read
Voice d off e-mailil via
i phone
h access.
◦ Personal phone book.
◦ Link to PDA.
CS350 Intro. to SE
Spring 2008 17
Conducting a Requirements Gathering Meeting
(pg188)
y The scene: y The conversation:
◦ A meeting room. The first requirements y Facilitator (pointing at white
gathering meeting is in progress. board): So that's the current list of
y Th players:
The l objects and ser services
ices for the home
◦ Jamie Lazar, software team member; security function.
◦ Vinod Raman, software team member; y Marketing person: That about
◦ Ed Robbins,
Robbins software team member; covers it from our point of view.view
◦ Doug Miller, software engineering y Vinod: Didn't someone mention
manager; that they wanted all SafeHome
◦ three members of marketing; functionality to be accessible via
◦ a product engineering representative; the Internet? That would include
◦ a facilitator. the home security function, no?
y Marketing person: Yes, that's
right ... we
we'llll have to add that
functionality and the appropriate
objects.
CS350 Intro. to SE
Spring 2008 18
y Facilitator: Does that also add y Ed: That's easier said than done
some constraints? and....
y Jamie: It does, both technical and y Facilitator ((interrupting):
p g) I don't
legal. want to debate this issue now.
y Production rep: Meaning? Let's note it as an action item and
y Jamie: We better make sure an proceed. (Doug, serving as the
outsider can't hack into the system, recorder for the meeting, makes
disarm it, and rob the place or an appropriate note.)
worse. Heavy liability on our part. y Facilitator: I have a feeling
y Doug: Very true. there's still more to consider here.
y Marketing: But we still need y (The group spends the next 45
Internet connectivityy . jjust be sure minutes refining and ex-panding
to stop an outsider from getting in. the details off the home security
function.)
CS350 Intro. to SE
Spring 2008 19
Developing a Preliminary User Scenario
(pg190)
y The scene: y The conversation:
◦ A meeting room, continuing the first
requirements gathering meeting. y Facilitator: We've been talking
about security for access to
y Th players:
The l SafeHome functionality that will be
◦ Jamie Lazar, software team member;
accessible via the Internet. I'd like
◦ Vinod Raman, software team member;
to try something.
◦ Ed Robbins,
Robbins software team member;
y Let's develop a user scenario for
◦ Doug Miller, software engineering
manager;
access to the home security
◦ three members of marketing;
function.
◦ a product engineering representative; y Jamie: How?
◦ a facilitator. y Facilitator: We can do it a couple
of different ways, but for now, I'd
like to keep
p things
g reallyy informal.
Tell us (he points at a marketing
person) how you envision
accessing the system.
CS350 Intro. to SE
Spring 2008 20
y Marketing person: Um. .. , well, y Vinod (interrupting): The Web
this is the kind of thing I'd do if I page would have to be secure,
was away from home and I had to encrypted, to guarantee that we're
let someone into the house, say a safe and....
and
housekeeper or repair guy, who y Facilitator (interrupting): That's
good information, Vinod, but it's
didn't have the security code.
technical. Let's jjust focus on how
y Facilitator (smiling): That's the the end-user will use this
reason you'd do it .. . tell me how capability, OK?
you'd actually do this. y Vinod: No problem.
y Marketing person: Um . . . the y Marketing person: So, as I was
first thing I'd need is a PC. I'd log saying, I'd log on to a Web site
on to a Web site we'd maintain for and provide my user id and two
allll users off SafeHome.
S f H I'd provide
id levels of passwords
passwords.
my user id and ... y Jamie: What if I forget my
password?
CS350 Intro. to SE
Spring 2008 21
y Facilitator (interrupting): Good security system control panel
point, Jamie, but let's not address along with a list of functions that I
that now. We'll make a note of that can perform--arm the system,
and call it an "exception." I'm sure disarm the system
system, disarm one or
more sensors. I suppose it might
there'll be others. also allow me to reconfigure
y Marketing person: After I enter securityy zones and other thingsg
the passwords, a screen like that, but I'm not sure.
representing all SafeHome y (As the marketing person
functions will appear. I'd select the continues talking, Doug takes
h
home security
it ffunction.
ti Th
The co pious notes
co-pious notes. These form the
system might request that I verify basis for the first informal use-
who I am, say by asking for my case scenario. Alternatively, the
address or phone number or marketing gpperson could have
been asked to write the scenario,
something. It would then display a but this would be done outside the
picture of the meeting.)
CS350 Intro. to SE
Spring 2008 22
Developing a High-
High-Level Use-
Use-Case Diagram (pg195)
y The scene: y The conversation:
◦ A meeting room, continuing the y Facilitator: We've spent a fair
requirements gathering meeting.
amount of time talking g about
y Th players:
The l SafeHome home security
◦ Jamie Lazar, software team member;
functionality. During the break I
◦ Vinod Raman, software team member;
sketched a use-case diagram to
◦ Ed Robbins,
Robbins software team member;
◦ Doug Miller, software engineering
summarize the important
manager; scenarios that are part of this
◦ three members of marketing; function. Take a look.
◦ a product engineering representative; y (All attendees look at Figure 7.3.)
◦ a facilitator.
y Jamie: I'm just beginning to learn
UML notation. So the home
security function
f is represented by
the big box with the ovals inside it?
And the
CS350 Intro. to SE
Spring 2008 23
ovals represent use
use-cases
cases that adapted things a bit. I don't
don t think it
we've written in text? creates a problem.
y Facilitator: Yep. And the stick y Vinod: Okay, so we have use-
figures represent actors--the
actors the case narratives for each of the
people or things that interact with ovals. Do we need to develop the
the system more detailed template-based
narratives I've read about?
y as described by the use-case ...
oh,
h I use the
th llabeled
b l d square tto y Facilitator: Probably,
Probably but that can
represent an actor that's not a wait until we've considered other
person, in this case, sensors. SafeHome functions.
y Doug: Is that legal in UML? y Marketing g person:
p Wait,, I've
been looking at this diagram, and
y Facilitator: Legality isn't the issue.
all of a sudden I realize we missed
The point is to communicate
something.
information. I view the use of a
human-like stick figure for y F ilit t
Facilitator: Oh really.
ll T Tellll me
representing a device to be what we've missed. (The meeting
misleading. So I've continues.)
CS350 Intro. to SE
Spring 2008 24
Preliminary Behavioral Modeling (pg199)
y The scene: y The conversation:
◦ A meeting room, continuing the y Facilitator: We've just about
requirements meeting.
finished talking
g about SafeHome
y Th players:
The l home security functionality. But
◦ Jamie Lazar, software team member;
before we do, I want to discuss
◦ Vinod Raman, software team member;
the behavior of the function.
◦ Ed Robbins,
Robbins software team member;
◦ Doug Miller, software engineering y Marketing person: I don't
manager; understand what you mean by
◦ three members of marketing; behavior.
◦ a product engineering representative; y Ed (laughing): That's when you
◦ a facilitator.
give the product a "timeout" if it
misbehaves.
y Facilitator: Not exactly. Let me
explain.
y (The facilitator explains the
CS350 Intro. to SE
Spring 2008 25
basics of behavioral modeling to y Facilitator: See, you can do it.
the requirements gathering team.) y Jamie: It'll also be polling the PC
y Marketing g person:
p This seems a to determine if there is anyy input
p
little technical. I'm not sure I can from it, for example Internet-based
help here. access or configuration
y Facilitator: Sure you can. What information.
behavior do you observe from the y Vinod: Yeah, in fact, configuring
user's point of view? the system is a state in its own
y Marketing person: Uh... , well right.
the system will be monitoring the y Doug: You guys are rolling. Let's
sensors. It'll be reading give this a bit more thought . . . Is
commands from the homeowner. there a way to diagram this stuff?
It'll be displaying its status. y Facilitator: There is, but let's
postpone that until after the
meeting.
CS350 Intro. to SE
Spring 2008 26
The Start of a Negotiation (pg202-
(pg202-203)
y The scene: y Lisa (smiling): Yeah, they
◦ Lisa Perez's office, after the first actually told me they got into it,
requirements gathering meeting. and it wasn't a propeller head
y Th players:
The l activity.
◦ Doug Miller, software engineering
y Doug (laughing): I'll be sure to
manager
◦ Lisa Perez, marketing manager.
take off my techie beanie the next
time I visit ... Look, Lisa, I think we
y The conversation:
may have a problem with getting
y Lisa: So, I hear the first meeting
all of the functionality for the home
went really well. security
it function
f ti outt by
b the
th dates
d t
y Doug: Actually, it did. You sent your management is talking about.
some good people to the It's early, I know, but I've already
meeting ... they really contributed. been doing a little back of the
envelope planning and....
CS350 Intro. to SE
Spring 2008 27
y Lisa: We've got to have it by that y Doug: I understand your situation,
date, Doug. What functionality are I really do. The problem is that in
you talking about? order to give you Internet access,
y Doug: I figure we can get full we'll need a fully secure Web site
home security functionality out by up and running. That takes time
the drop-dead date, but we'll have and people. We'll also have to
to delay Internet access till the b ild a llott off additional
build dditi l
second release. functionality into the first
y Lisa: Doug, it's the Internet access release . . . I don't think we can do
that gives SafeHome "gee whiz" it with the resources we've
we ve got.
got
appeal. We're going to build our y Lisa (frowning): I see, but you've
entire marketing campaign around got to figure out a way to get it
it W
it. We've
' gottatt h
have it! done It's
done. It s pivotal to home security
functions and to other functions as
well ... the other
CS350 Intro. to SE
Spring 2008 28
y functions can wait until the next
releases . . . I'll agree to that.
y Lisa and Doug g appear
pp to be at an
impasse, and yet they must
negotiate a solution to this
problem. Can they both "win" here?
Playing the role of a mediator,
what would you suggest?
CS350 Intro. to SE
Spring 2008 29
Developing Another Preliminary User Scenario
(pg219)
y The scene: y SafeHome surveillance function.
◦ A meeting room, during the second Let's develop a user scenario for
requirements gathering meeting. access to the home security
y Th players:
The l function.
◦ Jamie Lazar, software team member;
y Jamie: Who plays the role of the
◦ Ed Robbins, software team member;
actor on this?
◦ Doug Miller,
Miller software engineering
manager; y Facilitator: I think Meredith (a
◦ three members of marketing; marketing person) has been
◦ a product engineering representative; working on that functionality. Why
◦ a facilitator. don't you play the role.
y The conversation: y Meredith: You want to do it the
y Facilitator: It's time that we begin same way we did it last time, right?
t lki about
talking b t ththe y Facilitator: Right ... same way.
y Meredith: Well, obviously the
reason for surveillance is to
CS350 Intro. to SE
Spring 2008 30
allow the homeowner to check out homeowner do this--and the
the house while he or she is away, second part is the actual
to record and play back video that surveillance function itself. Since
is captured ... that sort of thing. the layout is part of the
y Ed: Will the video be digital, and configuration activity, I'll focus on
will it be stored on disk? the surveillance function.
y Facilitator: Good question, but y Facilitator (smiling): Took the
let's postpone implementation words right out of my mouth.
issues for now. Meredith? y Meredith: Um ... I want to gain
y Meredith: Okay, so basically access to the surveillance function
there are two parts to the either via the PC or via the
surveillance function ... the first Internet. My feeling is that the
configures
f the system including I t
Internett access would ld be
b more
laying out a floor plan--we need frequently used. Anyway, I want to
tools to help the be able to display camera views
on a PC and
CS350 Intro. to SE
Spring 2008 31
control pan and zoom for a y Meredith: Okay, then I want
specific camera. I specify the thumbnail views from all the
camera by selecting it from the cameras. I also want the interface
house floor plan. I want to to the surveillance function to
selectively record camera output have the same look and feel as all
and replay camera output. I also other SafeHome interfaces. I want
wantt to
t be
b able
bl tto block
bl k access tto it tto b
be iintuitive,
t iti meaning
i Id
don't't
one or more cameras with a want to have to read a manual to
specific password. And I want the use it.
option of seeing small windows y Facilitator:
F ilit t G d job,
Good j b now, llet's
t'
that show views from all cameras go into this function in a bit more
and then be able to pick the one I detail....
want enlarged
enlarged.
y Jamie: Those are called
thumbnail views.
CS350 Intro. to SE
Spring 2008 32
Use--Case Template for Surveillance (pg222-
Use (pg222-223)
y Use-case: y Scenario:
◦ Access camera surveillance--display 1. The homeowner logs onto the
camera views (ACS-DCV). SafeHome Products Web site.
y Pi
Primary actor:
t 2 The
2. Th homeowner
h enters
t his
hi or h
her user
ID.
◦ Homeowner.
3. The homeowner enters two passwords
y Goal in context: (each at least eight characters in length).
◦ T
To view
i output
t t off camera placed
l d 4. The system displays all major function
throughout the house from any remote buttons.
location via the Internet.
5. The homeowner selects "surveillance"
y Preconditions: from the major
j function buttons.
◦ System must be fully configured; 6. The homeowner selects "pick a camera."
appropriate user ID and passwords must 7. The system displays the floor plan of the
be obtained. house.
y Trigger: 8 The homeowner selects a camera icon
8.
◦ The homeowner decides to take a look from the floor plan.
inside the house while away.
CS350 Intro. to SE
Spring 2008 33
9. The homeowner selects the "view" 3. Homeowner selects "view thumbnail
button. snapshots for all cameras"--see use-
10. The system displays a viewing case: "view thumbnail snapshots for
window that is identified by
y the all cameras."
camera ID. 4. A floor plan is not available or has not
11. The system displays video output been configured--display appropriate
within the viewing window at one error message and see use-case:
frame per second.
second "configure
g floor p
plan."
y Exceptions: 5. An alarm condition is encountered--
see use-case: "alarm condition
1. ID or passwords are incorrect or not encountered."
recognized—see use-case: "validate
ID and passwords." y Priority:
2. Surveillance function not configured Moderate priority, to be implemented
for this system--system displays after basic functions.
appropriate error message; see use- y When available: Third increment.
case: "configure surveillance
function." y Frequency of use: Infrequent.
CS350 Intro. to SE
Spring 2008 34
y Channel to actor: 1. Is security sufficient? Hacking into this
feature would represent a major invasion
Via PC-based browser and Internet
of privacy.
connection to SafeHome Web site.
2. Will system
y response
p via the Internet be
y S
Secondary
d actors:
t acceptable given the bandwidth required
System administrator, cameras. for camera views?
y Channels to secondary actors: 3. Will we develop a capability to provide
1. System
1 S t administrator:
d i i t t PC PC-based
b d system
t video at a higher frames-per-second
frames per second rate
when high bandwidth connections are
2. Cameras: wireless connectivity
available?
y Open issues:
1 What mechanisms protect unauthorized
1.
use of this capability by employees of
the company?
CS350 Intro. to SE
Spring 2008 35
Data Flow Modeling (pg231
(pg231--232)
y The scene: y Jamie: I took a software
◦ Jamie's cubicle, after the last engineering course in college, and
requirements gathering meeting has they taught us this stuff. The prof
concluded
concluded.
said it's a bit old fashioned, but
y The players: you know what? It helps me to
◦ Jamie, Vinod, Ed
clarify things.
all members of the SafeHome software
engineering team. y Ed: That's cool. But I don't see
y The conversation: any classes or objects here.
y ((Jamie has sketched out the y Jamie: No ... this is just a flow
models shown in Figures 8.9 model with a little behavioral stuff
through 8.12 and is showing them thrown in.
to Ed and Vinod.) y Vinod: So these DFDs represent
an I-P-OO view off the software,
f
right?
y Ed: I-P-O?
CS350 Intro. to SE
Spring 2008 36
y Vinod: Input-process-output. The y Jamie: Yeah, but first we've got to
DFDs are actually pretty intuitive ... develop a complete analysis
if you look at 'em for a moment, model, and this isn't it.
they show how data objects flow y Vinod: Well, it's a first step, but
through the system and get we're going to have to address
transformed as they go. class-based elements and also
y Ed: Looks like we could convert behavior aspects, although this
every bubble into an executable state diagram does some of that.
component . . . at least at the y Ed: We've got a lot of work to do
l
lowest t llevell off th
the DFD
DFD. and not much time to do it.
y Jamie: That's the cool part, you y (Doug--the software engineering
can. In fact there's a way to manager--walks into the cubical.)
t
translate
l t the
th DFDs
DFD iintot ad
design
i
architecture.
y Ed: Really?
CS350 Intro. to SE
Spring 2008 37
y Doug: So the next few days will
be spent developing the analysis
model, huh?
y Jamie (looking proud): We've
already begun.
y Doug: Good, we've got a lot of
work to do and not much time to
do it.
y (The three software engineers
look at one another and smile.)
CS350 Intro. to SE
Spring 2008 38
Class Models (pg238-
(pg238-239)
y The scene: y Ed: So when the homeowner
◦ Ed's cubicle, as analysis modeling wants to pick a camera, he or she
begins.
has to pick it from a floor plan. I've
y The players: defined a FloorPlan class.
class Here's
Here s
◦ Jamie, Vinod, Ed the diagram.
all members of the SafeHome software y (They look at Figure 8.14.)
engineering team.
y Jamie: So FloorPlan is a class
y The conversation: that is put together with walls that
y (Ed has been working to extract are composed of wall segments,
classes from the use-case doors and windows, and also
template for
f Access camera cameras; that's
th t' what
h t those
th
surveillance--display camera labeled lines mean, right?
views" [presented in an earlier y Ed: Yeah, they're called
sidebar in this chapter] and is "associations
associations." One class
presenting the classes he has y is associated with another
extracted to his colleagues.) according to the associations
CS350 Intro. to SE
Spring 2008 39
I've shown. [Associations are y Jamie: And the same goes for
discussed in Section 8.7.5.] windows and doors. Looks like
y Vinod: So the actual floor pplan is camera has a few extra attributes.
made up of walls and contains y Ed: Yeah, I need them to provide
cameras and sensors that are pan and zoom info.
placed within those walls. How y Vinod: I have a question. Why
does the floor plan know where to does the camera have an ID but
put those objects? the others don't?
y Ed: It doesn't, but the other y Ed: We'll need to identify each
classes do. See the attributes camera for display purposes.
under, say, WallSegment, which y Jamie: Makes sense to me, but I
is used to build a wall. The wall do have a few more questions.
segmentt has
h start
t t andd stop
t
coordinates and the draw ()
operation does the rest.
CS350 Intro. to SE
Spring 2008 40
y (Jamie asks questions which
result in minor modifications.)
y Vinod: Do y you have CRC cards
for each of the classes? If so, we
ought to role play through them,
just make sure nothing has been
omitted.
y Ed:" I'm not quite sure how to do
them.
y Vinod: It's not hard, and they
really pay off. I'll show you.
CS350 Intro. to SE
Spring 2008 41
CRC models (pg 245-
245-246)
y The scene: y Ed: What's the status of that?
◦ Ed's cubicle, as analysis modeling Marketing kept changing its mind.
continues.
y Vinod: Here's the first cut use-
y Th players:
The l case for the whole function ...
◦ Vinod, Ed
we've refined it a bit, but it should
members of the SafeHome software
engineering team.
give you an overall view.
y The conversation: y Use-case: SafeHome home
management function.
y (Vinod has decided to show Ed
how to develop CRC cards by y Narrative: We want to use the
showing him an example.) home management interface on a
PC or an Internet connection to
y Vinod: While you've been working
control electronic devices that
on surveillance and Jamie has
f
have wireless interface controllers.
been tied up with security, I've
The system should allow me to
been working on the home
turn specific lights
management
g function.
CS350 Intro. to SE
Spring 2008 42
on and off, to control appliances One is home, another is away, a
that are connected to a wireless third is overnight travel, and a
interface, to set my heating and fourth is extended travel. All of
air conditioning system to these situations will have settings
temperatures that I define. To do that will be applied to all devices.
this, I want to select the devices In the overnight travel and
f
from a floor
fl plan
l off the
th house.
h extended
t d d ttravell states,
t t the
th system
t
Each device must be identified on should turn lights on and off at
the floor plan. As an optional random intervals (to make it look
feature I want to control all
feature, like someone is home) and control
audio-visual devices--audio, the heating and air conditioning
television, DVD, digital recorders, system. I should be able to
and so forth
forth. With a single override these settings via the
selection, I want to be able to set Internet with appropriate
the entire house for various password protection.
situations.
CS350 Intro. to SE
Spring 2008 43
y Ed: The hardware guys have got y Vinod: I thought you didn't
all the wireless interfacing figured understand CRC.
out? y Ed: Maybey a little, but go
g ahead.
y Vinod (smiling): They're working y Vinod: So here's my class
on it, say it's no biggy. Anyway, I definition for
extracted a bunch of classes for HomeManagementlnterface.
home management, and we can y Attributes:
use one as an example. Let's use y optionsPanel--provides info on
the HomeManagementlnterface
buttons that enable user to select
class.
l functionality
y Ed: Okay . . . so the
y situationPanel--provides info on
responsibilities are ... the buttons that enable user to select
attributes
tt ib t and d operations
ti for
f the
th situation
class, and the collaborations are
y FloorPlan--same as surveillance
the classes that the
j
object but this one displays
p y
responsibilities point to
to.
devices
CS350 Intro. to SE
Spring 2008 44
y devicelcons--info on icons y ResponsibilityCollaborator
representing lights, appliances, ◦ displayControl
HVAC, etc. OptionsPanel (class)
y devicePanels--simulation of ◦ selectControl OptionsPanel (class)
appliance or device control panel; ◦ displaySituation
allows control SituationPanel (class)
y Operations:
◦ selectSituation
l tSit ti
SituationPanel (class)
◦ displayControl(), selectControl(),
◦ accessFloorplan FloorPlan
displaySituation(), selectSituation(),
(class) ...
accessFloorplan(),
Fl l ()
selectDevicelcon(), ◦ •
displayDevicePanel(), ◦ •
accessDevicePanel(), (), . . . ◦ •
y Class:
◦ HomeManagementInterface
CS350 Intro. to SE
Spring 2008 45
y Ed: So when the operation y Ed: Good way to find omissions or
accessFloorplan() is invoked, it errors.
collaborates with the FloorPlan y Vinod: Yep.
p
object just like the one we
developed for surveillance. Wait, I
have a description of it here.
(Th look
(They l k att Fi
Figure 8 8.14.)
14 )
y Vinod: Exactly. And if we wanted
to review the entire class model,
we couldld start
t t with
ith this
thi index
i d card,
d
then go to the collaborator's index
card, and from there to one of the
collaborator's
collaborator s collaborators
collaborators, and
so on.
CS350 Intro. to SE
Spring 2008 46
Design Concepts (pg270-
(pg270-271)
y The scene: y Vinod: Did you get anything out of
◦ Vinod's cubicle, as design modeling the seminar?
begins.
y Ed: Knew most of the stuff, but it's
y Th players:
The l not a bad idea to hear it again, I
◦ Vinod, Jamie, Ed
suppose.
members of the SafeHome software
engineering team . Also, Shakira, a new y Jamie: When I was an undergrad
member of the team. CS major, I never really
y The conversation: understood why information hiding
y ((All four team members have just
j was as important as they say it is.
returned from a morning seminar, y Vinod: Because ... bottom line ...
entitled "Applying Basic Design it's a technique for reducing error
Concepts," offered by a local propagation in a program. Actually,
computer science professor.) f
functional independence also
accomplishes the same thing.
CS350 Intro. to SE
Spring 2008 47
y Shakira: I wasn't a CS grad, so a whenever I can that sort of thing.
lot of the stuff the instructor y Ed: Modularity, functional
mentioned is new to me. I can independence,
p hiding,
g ppatterns ...
generate good code and fast. I see.
don't see why this stuff is so y Jamie: I still remember the very
important. first programming course I took ...
y Jamie: I've seen your work, Shak, they taught us to refine the code
and you know what, you do a lot iteratively.
of this stuff naturally ... that's why y Vinod: Same thing can be applied
your designs
d i andd code
d work. k to design, you know.
y Shakira (smiling): Well, I always y Ed: The only concept I hadn't
do try to partition the code, keep it heard of before was "refactoring."
f
focused d on one thi
thing, kkeep y Shakira: That's used in Extreme
interfaces simple and constrained, Programming, I think she said.
reuse code
CS350 Intro. to SE
Spring 2008 48
y Ed: Yep. It's not a whole lot
different than refinement, only you
do it after the design or code is
completed. Kind of an optimization
pass through the software, if you
ask me.
y Jamie: Let's get back to
SafeHome design. I think we
should put these concepts on our
review
i checklist
h kli t as we d develop
l
the design model for SafeHome.
y Vinod: I agree. But as important,
l t' allll commit
let's it tto thi
think
k about
b t th
them
as we develop the design.
CS350 Intro. to SE
Spring 2008 49
Refining an Analysis Class into a Design Class (pg273)
y The scene: as part of the surveillance and
◦ Ed's cubicle, as design modeling home management functions.
continues.
y Vinod ((nodding):g) Yeah, I seem to
y Th players:
The l recall that we used it as part of our
◦ Vinod, Ed
CRC discussions for home
members of the SafeHome software
engineering team.
management.
y The conversation: y Ed: We did. Anyway, I'm refining it
for design. Want to show how we'll
y (Ed is working on the FloorPlan
actually implement the FloorPlan
class [see sidebar discussion in
class. My idea is to implement it
Section 8.7.4 and Figure 8.14]
as a set of linked lists [a specific
and has refined it for the design
data structure]. So ... I had to
model.))
refine
fi ththe analysis
l i class
l
y Ed: So you remember the
FloorPlan (Figure 8.14) and,
FloorPlan class, right? It's used actually, sort of simplify it.
CS350 Intro. to SE
Spring 2008 50
y Vinod: The analysis class showed collaborates with FloorPlan, and
only things in the problem domain, obviously, there can be many
well, actually on the computer cameras in the floor plan.
screen, that
th t were visible
i ibl tto th
the y Vinod: Phew, let's see a picture of
end-user, right? this new FloorPlan design class.
y Ed: Yep, but for the FloorPlan y (Ed shows Vinod the drawing
design class
class, I've got to add some shown
h iin Fi
Figure 9
9.3.)
3)
things that are implementation y Vinod: Okay, I see what you're
specific. I needed to show that trying to do. This allows you to
FloorPlan is an aggregation of modify
dif the
th floor
fl plan
l easilyil
segments--hence the Segment because new items can be added
class--and that the Segment class or deleted to the list--the
is composed of lists for wall aggregation without any
aggregation--without
segments, windows, doors, and problems.
so on. The class Camera
y Ed (nodding): Yeah, I think it'll
work Vinod: So do II.
work.
CS350 Intro. to SE
Spring 2008 51
Choosing an Architectural Style (pg295-
(pg295-296)
y The scene: y Jamie: But . . . ?
◦ Jamie's cubicle, as design modeling y Ed: But . . . I have trouble
continues.
visualizingg what an object-oriented
j
y Th players:
The l architecture is. I get the call and
◦ Jamie, Ed
return architecture, sort of a
members of the SafeHome software
engineering team.
conventional process hierarchy,
but 00 .. I don't know. It seems
y The conversation:
sort of amorphous.
y Ed (frowning): We've been
y Jamie (smiling): Amorphous, huh?
modeling the security function
using UML. . . you know classes, y Ed: Yeah . . . what I mean is I
relationships, can't visualize a real structure, just
design classes floating in space.
y that sort of stuff. So I guess the
object-oriented architecture' is the y Jamie: Well, that's not true. There
right way to go. are class hierarchies . . .