case study
6/05/2014
Experiencing
RUP
1
2
A naïve view of RUP
RUP
• Rational Unified Process (RUP) is a
process model that defines:
Who
• Extremely detailed guidelines
– 30 different “roles” for team members (e.g. “developers” subclassified as architects, designers, user-interface designers, capsule designers,
database designers, implementors, integrators)
needs to do
– Each role characterized by
What
• List of activities
• List of artefacts that must be produced (e.g. “user-interface
and
When it must be done by
in order to achieve
Goals defined in Project Vision
designer” must produce a “navigation map” and a “user interface prototype”)
– Each “discipline” (Requirements, Deployment, …)
characterized by a detailed workflow model
3
4
Guidelines!
• Project groups aren’t expected to use all
the RUP stuff in any particular project.
A RUP example
• Groups follow those RUP guidelines that
are appropriate given the scope and
nature of the project that they are working
on.¶
¶One of the first tasks is development of the “Development Case” which identifies
those aspects of RUP that will be used.
Experience RUP vicariously by
reliving the experience of the
PSP-tools team!
5
6
Bit like watching a porno-movie, you don’t participate but you may be inspired
1
6/05/2014
“Textbook”
Why did Pollice et al write it?
• “Software Development for Small Teams:
A RUP-Centric Approach”,
G. Pollice, L. Augustine, C. Lowe, J.
Madhur.
(PSP-tools team)
• Not a textbook!
• An experience report.
• It is a challenge for project managers (and, more
generally, software developers) to find the
development process that works best for their
projects.
• Ideally
– Try each of them on equivalent projects
– Pick the best
• Impossible!
• So, instead, take guidance from published
experience reports.
• As an experience report – quite useful.
7
Not a student project in style of CSCI321!
“Software Development for Small Teams”
• Team:
• Small team
• Real, though relatively simple, application
– Essentially a system for recording work records – how much time, what
task, etc, etc.
– Has a few reporting functions that generate summary statistics.
• Team using (slightly simplified) version of Rational
Unified Process¶
– RUP more typically used with somewhat larger projects
• Team’s records (the book) detail an experience
of RUP,
hence you can share their experience and so
decide if RUP is good for you
¶ (Also slightly “contaminated” RUP, they drop into lighter weight XP practices in places.)
8
9
Not a student project in style of CSCI321!
• Team:
– Each individual has specializations wherein they are
competent.
• Gary – “project lead” - business systems degree, software
engineering grad school, familiar with problem domain (PSP),
30 years experience, different methodologies, limited RUP
experience
• Liz – “technical writer (also tester, tool engineer)” – 20 years
experience, comp. sci. degree, programmer before becoming
tech writer/tools engineer/tester, interested in “light weight”
process
• Chris – “? Developer/tester” – 15 years, C/C++, Windows,
Windows GUI, wants more Java, has heard of RUP
• Jas – “? tester” – had some experience with RUP in a larger
scale project, knows a little about problem domain (PSP)
• Russell – “? Customer/Business manager” – person who
wants a usable PSP-tools product
11
– Diverse
– All experienced
– All familiar (to varying degrees) with
development language and development
tools.
– Some having limited experience in problem
domain.
– All have participated in a number of projects
– All had been employees of Rational and so
knew about RUP and Rational’s tools (UML
tool, project management tool, etc)
10
“Project Guideline 1”
• Violated in all student projects!
• Get the right mix of people on your project
– Senior members who lead and teach junior
members (Gary/Chris)
– Senior members have experience on similar
projects (Gary)
– There are team members with existing
technical expertise in all critical areas
(actually they had some problems here, no real database guru).
12
2
6/05/2014
Four phases
• PSP-tools group describe their activities
for four phases of RUP
– What they did.
– What parts of RUP got used.
– What they should have done.
•
•
•
•
Inception (1 week)
Elaboration (3 weeks)
Construction (8 weeks)
Transition (3 weeks)
13
Actually PSP-tools group had a
pre-inception phase
14
Inception
• Meet as group,
–
–
–
–
Introduce selves,
Explain what you view as your strengths and weaknesses
Discuss roles that you might take on later
Begin to notice possible weaknesses of group (hence “risks” that will be
identified in the inception stage)
•Most of the business modelling
•Chunk of requirements
•A little high level analysis and design
• Get some idea of project
– PSP-tools group all did
• A little reading about PSP
• A couple of exercises on manually recording times on tasks as if they were
using PSP
• This “pre-inception” phase is not standard
•Project management tasks e.g. who will
– In real world, most of group will already have worked as colleagues on
other projects in a company and so introductions and identification of
potential roles already accomplished
do what
•Initial set up of environment
• GOOD IDEA to try something like this when starting your CSCI321
project or any large group project component in another subject.
15
16
Inception
Inception – iterations?
PSP-tools : Inception
• Usually Inception phase has just one “iteration”
– Might get second iteration if “risk” analysis of first
proposal suggests it will fail, could then try again with
a changed vision for proposed product
• Style of RUP project here is similar to old
waterfall model – business model, requirements,
analysis and design are largely “completed”
• Some agile methodologies would already have
code being generated and its behaviour being
evaluated by the “customer”, final functionality of
product being left incompletely specified
17
Inception
• “Development case”
– Really part of the “project management” discipline
– Decide how to use RUP
• “A development case is a brief description of how you should
apply the RUP, what artefacts to produce when and with
what formality, how to map roles to people in your project,
and so on. You typically produce a development case for a
project or a type of project. The development case should be
very short, ideally only a couple of pages long. Rather than
duplicating information in the RUP, you can link to activities,
artefacts, and roles in the RUP from the development case.”
18
Inception
3
6/05/2014
PSP-tools development case:
artefacts
PSP-tools : development case
We will create the use-case models in the inception phase modify them during
elaboration; naturally, the “Vision” thing is created at inception. We allocate
responsibility for these artefacts to roles as shown.
Initial “who does what” map; define the roles that group members will fill.
19
20
Inception
PSP-tools : Inception
Inception
PSP-tools : Inception
• Start developing environment
(environment discipline)
• “Iteration plan” for rest of inception phase
(management discipline)
– PSP-tools group picked up some
“collaborative workspace” product
– Artefact, who responsible, when due
• Think of it as structured bulletin board
21
22
Inception
PSP-tools : Inception :
the Vision
Inception
PSP-tools: Problem statement
• What problem are we trying to solve? (Problem
Statement)
• Who are the stakeholders?
Who are the users?
What are their respective needs?
• What are the product features?
• What are the functional requirements? (Use
Cases)
• What are the non-functional requirements?
• What are the design constraints?
“describe the problem, who it affects, how it affects them, and
what type of solution would ease the pain.”
23
Inception
24
Inception
4
6/05/2014
PSP-tools: “Position statement”
Getting the money …
• Sometimes, “Vision” thing is created by
entrepreneurial developers who must then sell it
to venture capitalists.
• PSP-tools team had been commissioned to develop the software
• Most of projects you will be working on in future will similarly have
been commissioned either by marketing seeing some product niche
or by another part of company having some perceived need for
software.
– In these cases, “Vision” thing’s role is to establish some common
understanding of project for development team and commissioning
customer;
Vision will be fleshed out as get into requirements
If you could develop software that would solve the problem described in the
Problem statement:
who would buy it
and what would make it unique
25
26
Inception
Identify stakeholders
Inception
Identify some features
• PSP-tools:
• Customers
• Management
• Team
– “record personal statistics”
• Time
• Software defects
• Source code size
• Others
– “reporting”
• Personal reports
• Team reports
– Some projects will need to satisfy government regulations etc
(e.g. privacy of data), then someone in organization will have to
act as a proxy for government, checking project’s compliance
• PSP-tools stakeholders were the team members and the
customer Russell
– Viewing
– Statistics
–…
27
28
Inception
Inception
Iterate a bit with your initial use
cases!
Sketch some high level use cases
• PSP-tools team reduced that initial use
case diagram down to this:
• Software Engineer will use
PSP-tools to:
–
–
–
–
–
–
Create project
Enter data
Count items
Use on line help when needed
Create report
…
• Process administrator will use
PSP-tools to:
–
–
–
–
–
Configure system
Configure project
Install PSP-tools
Use on line help when needed
…
29
Inception
30
Inception
5
6/05/2014
Identify non-functional
requirements
Non-functional requirements
• Typical things:
• Generally aspects such as
– Usability
– Must be implemented using AAA and BBB running on the CCC
operating system (because those are standards for the company)
– Must run reasonably¶ on a machine with following configuration
…
– Must be built using a process that complies with standard xxx
– Must have support for internationalization
– Must meet following security requirements limiting access to
personal data …
– Must have 99.999% availability 24/365
– Must accommodate visually impaired users
• Accessibility, aesthetics, consistency, …
– Reliability
• Scheduled downtimes, recoverability after various disasters
– Performance
• Throughput, response times
– Supportability
• Ease of configuration, deployment, …
– Design constraints
• E.g. must work with hierarchical database
– Implementation constraints
• E.g. Use C++
• PSP-tools guys don’t appear to have identified any non-functional
requirements during the inception phase.
James Gibson, the only
¶Take care when you see a requirement like that. What seems
“reasonable” to you might seem “pathetically bad” to me! You must
get stakeholder to define a quantifiable measure of “reasonableness”
real software engineer to
have worked in this department,
says I should use “shall” rather
than “must”!
So quaintly archaic! 31
– Interface constraints
• E.g. Must upload data from a Blackberry
– Physical constraints
• Usually only for military and embedded systems – must run on hardware
that fits in this box and uses this much power
32
Inception
Initial Project Plan
Initial Project Plan
• Once you have prioritized use-cases, assign
them to iterations in elaboration and construction
phase
• Prioritize requirements
– Remember two of the “Spirit of RUP” rules
• Baseline an executable architecture early on
• Stay focussed on executable software
– High priority on getting some minimal subset of overall project running.
– Another high priority is getting some preliminary work done in area of
high risk (areas where difficulties can be expected or where team knows
it lacks significant expertise); starting these early helps quantify risks
(and in worst case means project can be abandoned before too much
effort expended)
– Customer ranking of functionality
– Other priority constraints – e.g. feature X depends on feature Y,
therefore feature Y must have higher priority so it gets done first
• PSP-tools: priorities for use cases
– A minimal set of use cases, just enough to start an
“executable architecture”, will get at least partially
implemented in elaboration phase
• Some beginnings of user interface
• Some minimal functionality
• For use in subsequent iterations of negotiation with
“customer”/“users” needed to clarify requirements and
accommodate changed perceptions
– Other use cases
– 1) create database; 2) add data; 3) report data
• Assign them to iterations in construction according to priority
order; an iteration will deal with some number of use cases
33
34
Inception
“Time boxing” iterations
Inception
Initial Project Plan
• This is typical.
• Other artefacts
– Iteration-x, must complete in 3 weeks
• If, when engaged in Iteration-x, you find that it
isn’t going to be completed, you get approval for
lowest priority feature assigned to that iteration
to be pushed into a later iteration.
• As PSP-tools was a more “amateur” project
(they were working in their spare time), they
didn’t do time-boxing (to be honest, they really
didn’t plan the iterations for the construction
phase). They still did feature culling.
35
– Initial plan must also specify phase and
iteration in which other artefacts will be
delivered
– Initial plan just defines order, as plans revised
dates get added.
36
Inception
6
6/05/2014
Initial Project Plan
•
Identify Risks
PSP tools initial plan
1.
2.
3.
4.
5.
6.
7.
8.
10th
Plan done by
Oct
Environment set up …
Vision complete by …
Supplementary
requirements
Initial use cases by ..
Risk list
Test plan
Finish “Inception Iteration”
•
This is the task that is impossible for students who usually end up relying on
undergraduate “humour” (“struck by lightning”, “thrown out of apartment”, “break with girl-friend/boyfriend/both”, “hard assignments in other core subjects”, …)
• In real-world projects:
– Business manager and project team leader list things that have,
in their past experience, resulted in disruptions to similar
projects.
• Typical things
– Project requires arcane knowledge or obscure technical
experience (e.g. “must utilize the IMS hierarchical database”) – risk is that
you won’t find anyone with the requisite knowledge
– Project requires development environment, or methodology, that
is new to most members
– Constraints on team members (“no recruitment, must use existing
employees”) may constitute risk (“difficult people” etc)
37
38
Inception
Identify risks – and propose
countermeasures
PSP-tools
• No good just identifying risks,
have to outline how they will be reduced.
• Examples:
• They did a little more on setting up
environment
– Chose an IDE
– Chose a code-versioning tool
– Chose testing tools
– Chose tools to record management
information such as the plans (could just be a
spreadsheet or even a word-processor
document)
– Use IMS? !
• Convince customer to allow use of relational database?
• Separate out a distinct sub-process that cruds¶ with IMS,
employ a consultant to implement it
– New Environment, New Methodology?
• Pay for training courses
– Difficult team member?
• Invoke help from the gods
¶crud – create, read, update, delete
39
40
Inception
Inception
End of RUP inception –
the Lifecycle Objective Milestone
PSP-tools : end of inception
• Conventional RUP requires an evaluation point – the Lifecycle
Objective Milestone – at end of inception.
• This should verify:
• Artefacts delivered
–
–
–
–
–
An initial project plan
Vision endorsed by the stakeholders
Programming guidelines ¶
Initial requirements
The development environment set up and ready for
the remainder of the project
– A test plan ¶
– An initial Risk List
– The iteration plan for the Elaboration iteration ¶
– Stakeholder concurrence on scope definition and cost/schedule
estimates.
– Requirements understanding as evidenced by the fidelity of the primary
use cases.
– Credibility of the cost/schedule estimates, priorities, risks, and
development process.
– Depth and breadth of any architectural prototype that was developed.
– Actual expenditures versus planned expenditures.
• Some of these elements not relevant to PSP-tools as there were no
budgets, costs, etc (it really is more like an open source
collaborative project than a real costed industry project)
41
¶Book doesn’t contain any details of these in its “Inception” section
Inception
42
Inception
7
6/05/2014
Inception
Elaboration
•Tail end of the business modelling
•Requirements refined
•Most of high level analysis and design
• You can vary the formality of RUP for inception
• You can make it like Waterfall
• Complete business modelling
• Work through all requirements
• Hand over to next phase
• Or more like XP
• Minimal requirements
• No “analysis=paralysis”
• Start implementing with “user” on hand
• “Is this what you want?”
• “Is it better now?”
• “What do you want next?”
•A chunk of implementation
•Unit testing begins
•Version your source code
•Project management tasks
•Improve environment
43
44
Elaboration
Elaboration
Elaboration - aims
• Artefacts may include
– Updated versions of
• Not yet the product!
• Aims –
•
•
•
•
•
– A “stable architecture”
• No more radical changes (“Hey, I’ve just had a great idea, lets make it
web-based 3-tier client-server instead of a Unix shell-script!”)
– Supplementary Specifications
• Lesser changes are permitted in later phases
–
–
–
–
–
Vision Document.
Risk List.
Software Development Plan
Iteration Plan.
Use-Case Model.
• Finalized documented version of the non-functional requirements
– Prototypes
Use cases elaborated with key scenarios worked through
Detailed plan for iterations in subsequent construction phase
Development environment effective and stable
The beginnings of executable software
The start of automated re-testing system for subsequent
additions and changes
•
•
explore software ideas
demonstrate specific behaviour.
– Software Architecture Document—
•
•
•
•
• Success of elaboration to be evaluated at end when
reach the Lifecycle Architecture Milestone
Logical View
Use-Case View
Process View
Deployment View
– Design Model.
– Implementation Model
45
Elaboration
PSP-tools: Elaboration Iteration
Plan
• A collection of components, data, and subsystems that express the product
design.
– Project Specific Templates and Tools
46
Elaboration
PSP-tools : elaborate the use cases
• Fill in some detail
– HOW?
• Based on experience with similar things in other projects
• Guessing
Who is John?
Oh, he withdrew from
CSCI321 about week-7 of
session-1.
We had to finish without
him.
Note defining tests – some members started thinking about acceptance tests (use the
system to perform tasks – “black box” testing), others thinking about unit tests (“white box”
47
Testing)
Elaboration
• They initially created text descriptions
“Open project use
case”
This is their version of “scenarios”
48
Elaboration
8
6/05/2014
And MAGICALLY classes appear
• Gary
– project lead,
– lots of experience on similar projects
• Draws up an initial UML sequence diagram
49
Elaboration
Now how did we get to those
classes?
Classes! ?!
•
•
•
•
•
50
Elaboration
“mainFrame”
“openDialog”
“openManager”
“databaseFactory”
“PSPDatabase”
• Magic.
• The textbooks NEVER explain this.
• It is probably the hardest part of this stage of
development.
51
52
Elaboration
Elaboration
They aren’t classes anyway.
Lots of use of previous experience
• What Gary has done is introduce a number of
“Categories”
– category: a priori conceptions applied by the mind to sense
• What is this “databaseFactory”?
• There is nothing in use case’s text description that
suggests the presence of any such class!
impression, or relatively fundamental philosophical concepts
• Gary has worked on similar applications.
• Gary knows that
– There will be a control element that picks up a “Do create
database” command from some form of GUI, so he infers that
there is a something that he declares as a “mainFrame” object
– This will result in display of a dialog where user enters details of
database that is to be created – hence Gary’s openDialog
– Input data will be used
• Gary is using a “design pattern” with which he is familiar
– “Factory Method” : define an interface for creating an object but
let subclases decide which class to instantiate
• Gary has used something similar in another project and
has just assumed it will be relevant here.
• Firstly to confirm authorization (name/password checks maybe)
• Then to parameterize the code to create the tables.
• Garry is guessing here and picks
– openManager, databaseFactory, and PSPdatabase
53
54
Elaboration
Elaboration
9
6/05/2014
Don’t expect these “classes” (categories) to
survive through many iterations
Use previous experience
• There is nothing in use case, or the text
description that suggests the presence of this
factory class!
• In fact, its occurrence will probably turn out later
to be wrong;
• These won’t be your actual classes.
• A few more iterations are necessary to get your initial class
definitions in terms of “owns” and “does”
• Caution:
– Working from use cases often leads to bad designs where you have
• a “main” class that has essentially all the program’s business logic
• Some “entity” classes that are really just structs representing rows in a
relational database
• A few minor wrapper classes, e.g. a “wrapper” around the datastore code
that allows switching between file-based and relational-table style data
repositories.
– at this stage they imagined that they might be
creating different kinds of database structures – data
for PSP-level-0 differs from data needed for PSPlevel-1 so maybe they needed to created different
kinds of PSPDatabase object.
So, “Factory” – makes it possible to create different
kinds of database object given parameter data
– They will probably simplify that later!
– Good designs
• business logic assigned appropriately to meaningful application specific
business classes
• Use of design patterns like “Command”, “Observer”, “Flyweight”, “Singleton”
which suggest groups of classes useful when handling tasks such as those
that emerge in use cases
55
56
Elaboration
Elaboration
Classes Responsibilities Collaborations
Game – pick your roles
No previous experience?
• So how do you get your classes (categories) if
you don’t have Gary’s experience?
• Try the “Classes Responsibilities Collaborations”
game
– Group members play act roles of things in program
– Try exploring how user requests might be handled
– Note
• the things you need to know for your role,
• The requests that you receive
• The requests that you make to others
•
Group members play act roles of things in program
– Member-1 “I’m the database; I can crud a table; don’t ask me to do anything
else. I am unique. I am a singleton.”
– Member-2 “I’ll manage the database; creating new PSP-project tables, accessing
existing tables. So I am THE DATABASEMANAGER. I think I’m a singleton, but
there might be more than one of me.”;
“I will also pretend to be another object – something that verifies ‘log-ins’ to make
sure that only authorized people create of use tables. In this role, I’m definitely a
singleton.”
– Member-3 “I like being schizophrenic. I’ll pretend to be each of the GUI data
entry forms and responses. So I represent several objects from several different
classes at different times”
– Member-4 “I’ll take the role of listening for inputs on GUI forms – from my friend
member-3. I am probably several objects – listeners of different classes for
different forms. My role as listener is to get the work done via Member-2 and/or
member-1. I’ll tell member -3 what results to display”
– Member-5 “I’m main(). I create all you other guys and set links so you can talk to
one another. Then my thread sleeps. Don’t ask me to do anything.”
– Member-6 “I suppose I’m the user”
57
58
Elaboration
Elaboration
Classes Responsibilities Collaborations
Game – play your roles
Guessing classes
– Member-6 “I want to create a database”
– Member-3 “I suppose I’d better be a “LoginPanel” object;
somehow #5 had better arrange that I’m displayed first when the
program starts. I show name and password fields and createdatabase, connect-to-database buttons”
– Member-6 “I fill in my name in and hit #3’s create button”
– Membe-4 “I’m a createButtonListener object, #5 arranged that I
was waiting for this button press; I ask #3=LoginPanel for the
name and password; there is no password; shucks; I think I can
probably put up an error alert dialog; I’m not going to do anymore
work now; if I can’t put up the error alert, then it will have to be a
responsibility of #3”
59
Elaboration
LoginPanel
Owns:
textfields Name, Password
buttons create, connect
Does:
access functions readName,
readPassword
maybe showErrorAlert
?
createButtonListener
Owns:
reference to loginPanel
reference to databaseManager
Does:
handle action-event on create button
maybe showErrorAlert
?
Record the things you own, the things you do, who you talk to, what you
ask them to do
60
10
6/05/2014
Classes Responsibilities Collaborations
Game – play your roles
Somehow, magic occurs
– Member-6 “I close that stupid error alert!
I fill in my name in and my password.
I hit #3’s create button”
– Member-4 “I’m a createButtonListener object,
I ask #3=LoginPanel for the name and password; I ask #2, in her guise
of loginChecker to check the name password combination”
– Member-2 “In my role of loginChecker, I ask #1 database to retrieve the
encrypted password for user with name=… from the users’ table”
– Member-1 “I’m the database. I crud. I return data”
– Member-2 “I encrypt supplied password, compared with crudded data,
they match, I return OK”
– Member-4 “I’m still the createButtonListener, I resume my work on the
login, I now ask #2 DATABASEMANAGER to create database”
– Member-2 “Er, problem here, you haven’t told me anything about the
new database table, should there be some additional input data?
Should login be a separate step from create, using different GUI panels
maybe?”
• Based on previous experience, or CRC
role-play, you do get
– Some initial classes
• Owns …
• Does …
• Talks to …
– And some guess at an interaction diagram for
the use case that you are working on
61
62
Elaboration
Elaboration
Elaboration - testing
RUP test plan
• Gary + Chris to do most of programming
– Decided to do it xP style with test driven
development and unit testing
• First write the test plan
– “Let’s follow the RUP guidelines”
63
64
Elaboration
Elaboration
RUP test plan
RUP test plan template
Data and Database Integrity Testing
•
29 pages like this!
Test Objective:
–
•
Ensure database access methods and processes function properly and
without data corruption.
Technique:
–
–
•
Invoke each database access method and process, seeding each with valid
and invalid data or requests for data.
Inspect the database to ensure the data has been populated as intended, all
database events occurred properly, or review the returned data to ensure that
the correct data was retrieved for the correct reasons
Completion Criteria:
–
•
All database access methods and processes function as designed and without
any data corruption.
Special Considerations:
–
–
–
Testing may require a DBMS development environment or drivers to enter or
modify data directly in the databases.
Processes should be invoked manually.
Small or minimally sized databases (limited number of records) should be
used to increase the visibility of any non-acceptable events.]
65
66
Elaboration
Elaboration
11
6/05/2014
RUP test plan
PSP-tools
• Er – maybe not, that stuffs for bigger
projects!
• Similar detailed templates
–
–
–
–
–
–
–
–
–
–
–
–
Data and Database Integrity Testing
Function Testing
Business Cycle Testing
User Interface Testing
Performance Profiling
Load Testing
Stress Testing
Volume Testing
Security and Access Control Testing
Failover and Recovery Testing
Configuration Testing
Installation Testing
• PSP-tools Test Plan
– Each class will have corresponding unit tests.
No code will be checked into version control
unless all unit tests pass.
– Acceptance tests will be run and will pass
before any software is delivered to the
customer.
67
68
Elaboration
Elaboration
PSP-tools : acceptance tests
Architecture
• They started sketching these
• PSP-tools persons admit they cannot give a good
definition of architecture (page 83).
• “Highest level concept of a system in its environment”
• Actually, multiple levels
– Really just a variant on the existing use-case description with a few
annotations.
– A guess as to how eventual user might interact with some interface
element
– Process and inter-process communication level
•
•
•
•
What processes make up system?
What machines do they run on?
How do they intercommunicate?
What messages are exchanged?
– Process
• Subparts
– GUI interface, Database interface, Control code, Business logic parts,
…
– “Subpart”
• Principle classes and packages
69
Elaboration
Architecture – PSP-tools
70
PSP-tools is a simple, single process application; architectural effort reduced!
Elaboration
Use previous experience
• Slightly odd here
• Under heading “architecture” they discuss
– their first ideas as to user interface
– The “packages” – GUI, managers (control), database,
data-objects and “utilities”
• ?
• The GUI design didn’t really seem to fit the
architecture heading;
RUP puts architecture responsibilities with
“System Architect”
RUP assigns prototype GUI design to another
role – “User Interface Designer”
• “A good analyst is a biased analyst”¶
• The GUI design proposed reflected lots of
experience with Java swing framework.
– Gary + Chris knew swing classes most often
used to create GUIs, and common GUI
configurations
• Classes : JFrame, JPanel, JTree, JTabbedPane
• Configuration:
– Tabbed Pane interface with “tabs” for different input
forms, tabular responses, and message;
– Hierarchical tree-view for selecting subsets of data
71
Elaboration
¶If you know that “tree views” are easy to implement, this influences your analysis
and you end up suggesting to the user that some data should be displayed in a tree view
72
Elaboration
12
6/05/2014
PSP-tools : GUI
Menus and dialogs
• Design model 1
– Tabbed Pane has “tabs” for data input forms and for tabular
presentations of selected data
• Design model 2 (the one used by PSP-tools)
Tabbed pane – panels for
different “data entry forms”
and responses
– Tabbed Pane only has “tabs” for displays of selected
data
– Data entry to be achieved by using menu to get dialog
displayed, data entered in dialog – action button
submits data and closes dialog
– Data entry updates database and also tree view in left
panel
– Tree view is “active” – click on entry to place selected
data in a structure that can then be viewed in a
tabbed pane panel
Treeview
73
74
Elaboration
PSP-tools : “package architecture”
Architecture?
• Haven’t really advanced much.
• The “architecture” derived so far:
– Describes essentially every
• Java-GUI/back-end data-store application via JDBC
• C#/Visual-Basic “Winforms” using data access objects and a
back-end data-store
• Developing this architecture was easy for PSPtools guys
– We’ve done dozens of applications like this, roll out
the standard elements
75
76
Elaboration
Elaboration
Not always so easy in CSCI321
Database design
• May be required to construct an interface using
a technology with which no group member is
familiar
– TCL/TK for GUI interfaces maybe?
• Does it support “Tree Views”, “Tabbed Panes”?
• Are the GUI elements instances of classes or are they
something else.
• Application may require an architecture more
elaborate than those that you have met:
– Single process
– “Two-tier” (process that talks to database)
– Simple WWW (browser-client, middleware, database)
77
78
Elaboration
Elaboration
13
6/05/2014
Database design
Database design
• Tables (“entities”)
• As you refine your ideas, you get to
– The different types of data item you wish to store;
– For PSP-tools
– Table declarations
•
•
•
•
Projects
Users (many users participate in a project)
Phases (several phases in a project)
Tasks (many tasks in a project, each task the responsibility of
one user)
• Time entry (time entry associated with user, phase & hence
project, and task)
• DefectEntry (similar)
• Primary keys (often auto-allocated, e.g. defect
item’s primary key to be allocated by database)
• Foreign keys (defect introduced by user – so
defect record will have a foreign key that is primary
key in user table)
• Other fields
– User
» Name, Initials, encrypted password, …
79
80
Elaboration
Elaboration
Database
Database classes
• Effectively defining “entity classes” at same time.
• You read a user-record from database
Either
you only want one field (select password
from users where username=? and initials =?); if
this is always the case, then can take data from
result set,
Or
you want to use more of the data – in which
case you probably want a “class User” that you
can instantiate and fill in details
• Consider defect:
– In table: unique id, date, type, foreign-keys for phase, task
– In memory
• Unique id, date, type are ok
• Do you want foreign keys as longs
class Defect { private: long id, task, phase; date d; string type; … }
• Or do you also load in phase and task data and build
class Defect { private: long id; Task* tsk; Phase* phs; date d; string
type; …
• You probably don’t know which way to go at this stage;
it is going to depend on the most typical patterns of
processing;
pick simpler style now, but remember you may have to
change later.
81
82
Elaboration
Elaboration
Database – consistency, etc
• Enumerated type e.g. Defect type –
– how about defining a constraint on values of field in table so database
validates info on entry.
• Foreign keys –
– you cannot expect PSP-tools user to know the unique id for project and
for their identity when recording a defect or time entry;
– implicit requirement that your processing code will have to get this
information from data-tables once user has logged in and identified task
for which they are entering data (in PSP-tools, they load the data into the
tree view);
– how are they going to identify task – your code will have to present a list
showing possible tasks
– Look how just thinking about data-table has given you a whole
series of subtasks that you should record so that they can be
scheduled and allocated
• Deletes – “cascading the changes”
– Remove a task?
Not appropriate in this application, but similar applications will have
deletes.
83
All time logs, and all defects relating to that task should be deleted.
Elaboration
PSP-tools
• Gary devised some SQL create table statements given
their first database design diagram
• Tables created by running scripts – departure from
earlier plan of having application create tables
dynamically.
• Later they considerably simplify their data model and
change all the tables.
– Such a change allowed in “lightweight” approaches.
– More formal (Waterfall) methods would have required them to do
more careful analysis of data model at this stage and then have
had the database design frozen.
– That would have made the implementation problems they had
much more serious.
84
Elaboration
14
6/05/2014
Management activities
Engineering backlog
• “Engineering backlog”
– Note examples
• CRC role play, participants noted that their
conceived user-interaction hadn’t provided the
data needed to create a tables
• Decisions about data stored for a time record or
defect record identified need to retrieve keys
identifying user and a list of keys and descriptions
for tasks
– Add these to “project engineering backlog”
85
86
Elaboration
Elaboration
Management – feature cull and reprioritize
Engineering backlog
• This is an “agile” feature.
• Less agile approaches require that you
have the foresight to identify all the tasks
before you start the phase, so there won’t
be anything to add.
• PSP-tools
– Originally, had some idea of allowing users of
PSP-tools to customize it so that they could
select the data to be recorded etc;
– Requires customization of data-entry forms,
data-tables, entity classes etc
– Ooops – too hard
– Defer to “release 2”
• Agile is more realistic
87
88
Elaboration
Elaboration
Management
Incidentals
• Things you didn’t ever think of that mess you up and
divert you to work on support tasks
• Keep records of features
– Their revised priorities
– Iterations for implementation
– “Release”
– Cost time
– Time that was never budgeted
– Will make your project run late and cost too much
• PSP-tools
– Installation
• Technically less sophisticated group members (representing
customers) couldn’t install and run the prototypes
• Have to divert effort into obtaining and learning how to use one of
those systems that lets you create “self-installing” applications.
– How to use the GUI?
• Found it necessary to get a Windows screen recording thingy that
let them record “movies” of sessions so that potential users could in
effect watch demonstrations.
89
90
Elaboration
Elaboration
15
6/05/2014
Elaboration – steps toward the first
executable
• PSP-tools Starting
Build a GUI
• No functionality behind it
• Just a GUI
– Install Java
– Install a database product (Cloudscape)
• Often people choose things like MySQL or Apache Derby for
the database used in development phase
• The “Developer” (or “Express”) editions of DB2, SQLServer,
Oracle etc might be more appropriate
– Picked a code versioning system
• Defined their project in terms of layers – userinterface, control and business logic, persistent
data;
used this to define an initial package structure
• See book for their arguments as to why they made this
their starting point
– More the “agile” style
– They have a tame user, they want to keep Russell constantly
involved, showing him bits and asking “is this right?”
– They argue that changes to GUI have major ripple effects
causing changes to all other parts, hence they argue that do as
much as possible to get the GUI right early on
91
92
Elaboration
Elaboration
PSP-tools GUI
Early GUI
• Important to explain to quality testers and
customer representatives that functionality
is limited or non-existent.
• Otherwise
– “Defect report log” gets filled with bug reports
about things not working (when engineers
knew they weren’t implemented yet)
Faked! Data shown in tree defined by constants in early code.
Data “added” via form-panels isn’t added to anything.
93
94
Elaboration
Elaboration
They simplified their database
model
Simple entity classes
• They defined a number of simple entity classes
– each corresponding to a table.
• Entity objects represent rows.
• “Documented” them with UML class diagrams –
but these are simply lists of the fields (tablecolumns)
– No real functionality defined for these classes
– Presumably (though not shown) there are getX
(accessor) and setX (mutator) functions for each field
Main thing is that now the database represents a single project where
participants are using PSP; so don’t have to keep track of which project
users and tasks belong to etc; a lot of earlier relations between entities
have gone so removing need for foreign keys etc.
• UML class diagram maps easily to SQL
createtable
95
96
Elaboration
Elaboration
16
6/05/2014
PSP-tools Entity classes
PSP-tools Entity classes
97
98
Elaboration
Elaboration
Entity classes
Classes other than entity classes
• They really were thinking in terms of the
database tables.
• They could simply have used SQL createtable statements and created the tables
• Many systems can import meta-data from
database and use this to create entityclasses or entity class diagrams.
I have feeling that they were hacking a bit at this stage; a little too much agility,
not enough thinking things out.
• They’ve built their GUI
– Used a GUI-builder to assist the process
• See their comments about problems that this can
cause if you switch development environments
• They’ve got their entity classes
• Now they need the bits with the control
logic and the database managers – the
bits that really provide functionality
99
100
Elaboration
Elaboration
PSP-tools group adopts “Test
Driven Development” strategy
JUnit testing
• Really an XP practice.
• They created their unit test cases
• For example
• You are planning to implement class X which (in this
phase) has functionality f1,f2, and f3
– They plan a class PSPUser
• It has name, and loginname fields, these to be set by the
constructor
• It will have an “equals” operation
• Two PSPUsers are “equal” if they contain same strings in their
name fields, and in their loginname fields
• You start by thinking up tests
–
–
–
–
–
–
Create an X object
Initialize it
Ask for property value
Invoke f1 operation that should change that property’s value
Ask for (changed) property value
Assert difference between original and new values is the
difference that was expected
– Hence test
public void testEquals() {
PSPUser u = new PSPUser(“Gary Pollice”, “gpollice”);
Assert.assertTrue(u.equals(new PSPUser(“Gary Pollice”,
“gpollice”);
}
101
Elaboration
Uhm – I’m still not convince of the value of such micro tests.
102
Elaboration
17
6/05/2014
PSP-tools view of state at end of
elaboration
End of elaboration phase
• Build an executable architecture?
– Er no
• But they have a GUI toy that does nothing, but
does that in an attractive way that pleases the
customer
• They have some faked data inserted into tables so
they will soon be able to start testing data
management code and entity classes
• They have their unit test framework set up;
the tests are scripted; they will be able to
automatically retest after every change from now
on.
• We have an executable architecture!
• We have refined the scope
– Taken out some things that would have been
too hard
• We have a sketch of an iteration plan for
construction phase (they don’t appear to
include it in the text)
103
104
Elaboration
Elaboration
Construction
A bit light on the planning!
• The account in the book suggests that there was
significantly less work done on planning (managerial,
analysis+design, …) then might be expected for a
professional RUP project
• Examples
•Requirements refined again
•Feedback and experience leads to
more analysis and design
•Most of implementation
•Unit testing continues, integration
testing occurs
– Iterations
• Not shown the iteration plan devised for construction phase
• 12 iterations reported
•Deployment issues explored
•Versioning of all parts through
iterations
•Project management tasks
•Improve environment
– Twelve iterations in 8 weeks?
– Really these are “after the fact iterations”, they’ve added something and
decided that the extension justifies a new “internal release” to the
customer representative and the quality assurance part of team
– Classes
• Evidence suggests no UML class designs
105
106
construction
construction
No UML class design?
“Agile”
• Supposedly we
–
–
–
–
–
Create designs
Diagram them in UML
Review
Work out interaction patterns, document these
Then code
• They dived into coding after only limited design
• Appear to have “Reverse engineered” the code to get UML
diagrams
– Reverse engineering is a feature available in “professional” versions of
things like RationalRose
– Use is meant to be:
• Create UML design overviews for imported or legacy code
• Reduce work involved in updating UML diagrams to maintain consistency
with code after “refactoring”
They don’t put reverse engineering into the versions of RationalRose used when
learning UML – because they don’t want to encourage such hacking!
• As noted in text, this wasn’t a pure RUP model.
• They also wanted to get some experience with agile
methods; XP (eXtreme Programming gets a couple of mentions), unit
test strategies were XP motivated.
• Agile methods do tend to go more lightly on the design
documentation – so no UML class diagrams, code first,
reverse engineer afterwards to get documentation
Waterfall---RUP---Agile---Hacker---Student
You can position your work style anywhere along
this axis. Whatever you choose, you will encounter
problems – the particular difficulties you meet vary
with your chosen style.
107
construction
108
construction
18
6/05/2014
Environment
Management
• RUP diagram shows “hump” for environment discipline at the start of
each phase
– You extend your environment
– Different support tools required in the different phases, you must install,
make available to team members, and possibly train some team
members in their use
• PSP-tools
– A few extra problems
– They switched existing tools as well (Sun Forte Java IDE replaced by
Eclipse etc)
– When doing your CSCI321 project, try to avoid following the example of
this team in regard to environment changes!
• Typically, at start of construction phase
– Start using code versioning system seriously
– Additional testing tools (code coverage, scripted GUI-testers, batch
scripts for regression testing) come into use
– Code generators may be used (possibly necessitating training in their
use)
• Put in place system for “defect tracking”
– PSP-tools illustration shows most of “defect
notices” being raised by Russell (Customer)
who continues to be supplied with “executable
releases”
– More typically defects logged by
• Your group’s “Quality assurance” person
performing “black box” testing of the system
• Developer’s flagging problems with code that has
been done in an earlier iteration
109
110
construction
construction
Defect logging
Management
• Requirements traceability
– Get list of agreed requirements (from updated Vision
produced at end of elaboration phase)
– Check that each requirement has a use case
associated with it
– Check that each use case is being developed into
code
111
112
construction
Traceability matrix
Construction
• Executable architecture from “elaboration”
– Nothing relating to
•
•
•
•
Generating reports
Viewing data from time records or defect records
Recording size data for tasks
…
– Faked GUI support (but no underlying processing of data or
persistence) for:
• Recording time on tasks
• Recording defects
• …
113
114
construction
19
6/05/2014
Construction - iterations
Construction – a first iteration
• First couple of iterations look as if there may
have been some planning prior to
commencement of construction;
subsequent iterations are “serendipitous”
• An executable architecture that actually does
something
– “Chris and Gary worked at a steady pace to
implement the needed functionality. Every few
weeks, they produced a build that was ready for
testing. When the build was released, anyone could,
and everyone was expected to test it, and report any
defects found. Russell or Gary often added requests
for enhancements; after considering priority and
effort, the became new requirements. Then Russell
and Gary would reallocate work based on the
priorities. We did this all without a formal planning
cycle.”
– Details are not clear from the account but it appears
that a user of the PSPtool program constructionversion-1 could
• Open an existing database
• Add time records and defect records
– still only stored in memory (no persistence to database!)
– Appear in tree view, can be processed when generating
summary reports
• View totals (simple summary reports) in tabbed pane panels
115
116
construction
Construction – a first iteration
construction
Construction – a first iteration
• Time for first iteration not specified.
• Book discusses “delighters” –
– Something that costs nothing to implement and will delight users
– In this case, it lead to a User Preference’s file
• Why a file? Why not a table in database?
If you make it a file, it isn’t the same when user working own main
desktop machine or on own laptop.
If you make it a file, there will be issues with multiple users needing
preferences files – do you understand enough about home
directories on different operating systems so that you can put the
file there?
– At this stage, preferences file records the “database” last used,
the “delighter” feature makes it a one-click step to open this database
(otherwise dialog needed, name must be entered etc)
117
construction
Delighters?
Cloudscape database = a file; you can have many different “databases”; for things
like DB2 or Oracle you would have to be defining “schema” to achieve same thing
118
construction
Construction – Iteration 2
• More hacking?
• Features
– Help menu (actually no help at this stage, simply the
“About PSP-Tools” dialog!)
– Improved Project-menu/New User dialog
– “Prettier” dialogs
• A more thoroughly planned RUP project would
have identified the need for “user preferences”
and factored these in to the construction
iterations (and also resolved issues of where to store
preferences which apparently became a problem in a later iteration)
– Basic preferences support would have been
scheduled for a construction iteration (probably the
iteration after that where data persistence achieved)
– Different preference features would have been
scheduled into later iterations
• (Greater experience with javax.swing classes)
– FINALLY – the data go into the database tables
• Well, OK, now do have a kind of executable
architecture.
• Two weeks (remember they are working part time, so that
probably means about 16 hours work)
119
construction
120
construction
20
6/05/2014
Construction – Iterations 4-12
Construction – Iteration 3
Iteration[*]
Functionality Added
C4
Incorporated activity time and defect entries. Also implemented activity timer that updates the database
directly. Implemented ability to update task summary information directly from the task summary panel.
C5
Added line counter tool to the program. Improved login dialog. Removed need to run with a Cloudscape
database server.
C6
Installed database schema changes and automatic database upgrade mechanism. Added the Database
Properties dialog box.
C7
Added basic export function. Made user information editable.
C8
Added program size and estimation tab.
• Features
– Create a database from within PSP-tools
• As noted earlier, this is only meaningful if using small “filebased” databases like Cloudscape where each database,
with all its tables, is created in a separate file.
• Creating a new schema in a real database would have been
more involved (and usually wouldn’t be possible as only the
database administrator can create schema)
– Right-click pop-up “context sensitive” menus
associated with tree view
C9
Added ability to delete a task.
C10
Delivered a self-extracting archive that unpacked the required files into a target directory and removed
dependencies on the user's environment.
C11
Fixed defects. Released an initial User's Guide.
C12
Added an executable program for Windows that launched PSP Tools. Users no longer needed to run a
batch file, and extra windows no longer appeared on the user's task bar.
121
122
construction
Balance of effort : new & “improve”
construction
Database “versioning”
• They were still hacking re-factoring their entity classes
and the way their program interacted with the database.
• Tables and entity classes being changed
• Consequently “databases” created by QA and customer
are incompatible with later releases of the software.
• Their approach meant that they had to devote effort to
mechanisms for identifying incompatibilities and for
migrating existing data.
• You will probably create similar problems for yourselves
in CSCI321.
123
124
construction
“Single quotes in fields”
Testing
• Curious
• JUnit style tests continued.
• Also made use of a Java code-coverage tool
• But how do you test a GUI?
– Highlighted as a problem
– Everyone knows that issue easily resolved if use
PreparedStatement rather than Statement
• Varchar field for comment
• SQL of form
• They made use of a specialist tool
– “update datatable1 set description=‘” . Info . “’”
– Records actions
– Generates a script (their tool generated Java code)
– Can then rerun this script anytime and tool with drive
operations on the program under-test.
• Get’s unhappy when you put in Gary’s Info
• Well they did note that they didn’t have a
database guru on their team.
125
construction
126
construction
21
6/05/2014
Testing script code - fragment
Transition
// Frame: PSP Tools
PSPMainFrame().click();
PSPMainFrame().click();
menubar().click(atPath("File"));
menubar().click(atPath("File->Open..."));
Filename().click(); JDialog().inputChars("d:\\pspproject\\project1");
Open().click();
PSPLoginDialog().click();
passwordtext().click();
PSPLoginDialog().inputChars("psp");
Login().click();
tree().click(atPath("project1"));
menubar().click(atPath("Project"));
menubar().click(atPath("Project->New Task..."));
…
•Hopefully, nothing for these
disciplines!
•Hopefully not much here either!
•Building self installing versions of
programs
•Finalizing documentation etc
127
128
construction
transition
Transition
Transition
• PSP-tools
• RUP suggestions
– Users validate product – does it really do what we
specified
• With more agile styles, this requirement should have already
been satisfied by having the users involved in testing all the
incremental releases
– 3 weeks
– Report – well doesn’t clarify much; it
mentions:
• Fix a bug
• Finalize user manual (on-line help had disappeared
somewhere on route)
• Packaging for distribution (they had really resolved this
– User training
– Product packaging
• Installable code
• Documentation
• Help files (multi-lingual?)
earlier because of problems they had had making thing work for
their testers)
– Support engineering
• Training of users
129
130
transition
transition
PostMortem phase of a project
• Group meets to discuss project given benefit of hindsight
• Task
– Identify where problems occurred and why
– Identify what worked well
PostMortem
• Aim
– Consolidate your experience
• Build on what you did well
• Take avoiding action early if you see similar problems arising in
another project!
• Remember the final versions of the classes that you developed and
the patterns of interactions among instances of these classes;
next time, start with these as your pre-conceived categories for
analyzing use cases (instead of the rubbish categories that you
used when you started this project).
131
132
22
6/05/2014
PSP-tools PostMortem
• Some of the problems
– No database guru (5th member John dropped the project
early on, had been designated as database guru)
– Should have spent more time team building
early on
– Should have been more serious about testing
– Should have used a better defect tracking
system
–…
PSP-tools
assessment
133
134
Yes – it is more like a CSCI321
project than was intended
What mark did Pollice’s team get for their
CSCI321 project “PSP-tools”?
• Typical CSCI321 problems
• Designers of CSCI222 2005/2006
– Group member drops out
– Team members inexperienced in some aspects of
technology
– Most of the tools used were new to team members
– Most of coding work done by a subset of team
members, contribution of other members is limited
– Lack of planning, resort to hacker style development
– Inappropriate assumptions about technology
– 95 HD, great, perfect model for CSCI222,
base all assignments on this work
– 88 HD, yes
– 90 HD, concur (well, to be honest, I didn’t actually read it)
• NABG
– 70 Cr, they hacked
135
It had an advantage not shared by
CSCI321 projects
136
An example of RUP?
• His presence made a continuous use
testing approach feasible.
“Executable architecture” did develop fairly
early and subsequent iterations did build
on this.
• Phases and iterations were followed
• Importance of “executable architecture” was
recognized
• Attention was paid to different RUP disciplines –
they did explicitly consider some of management
and other tasks associated with each phase
• RUP milestones and their deliverables did help
guide what the team did in each phase.
137
138
• An involved customer – Russell
23
6/05/2014
Weaknesses
• From a RUP perspective – too little effort
in analysis, design, and planning.
• It has too much the flavor of an XP or
hacker style project.
139
24
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising