Transcript PowerPoint

CS 501: Software Engineering
Lecture 9
Techniques for Requirements Definition
and Specification I
1
CS 501 Spring 2002
Administration
Projects
• Comments are being sent to each group by email.
Should complete today.
• Teaching Assistants assigned to each project. Will
contact you.
Observations about Assignment 1
• Some projects too ambitious
• Do not design the project before requirements
analysis.
Assignment 2 will be posted shortly
2
CS 501 Spring 2002
Assignment 2: What is in a
Requirements Document?
Remember
• The requirements document specifies the functionality that
you plan to deliver to the client
•
It must be comprehensive and detailed. Everything must be
written out -- no hand waving!
The requirements document is likely to be several times as long
as Assignment 1.
3
CS 501 Spring 2002
Techniques for Requirements Analysis
and Definition
• A variety of tools and techniques.
• Many are familiar from other courses.
• There is no correct technique that fits all situations.
The craft of requirements analysis and specification is to
select the appropriate tool for the particular task.
(Other tools are described in Pfleeger, Chapter 4.)
4
CS 501 Spring 2002
Bad Example: Decision Table
University Admission Decision
High SAT
T
F
F
F
F
F
High grades
-
T
F
F
F
F
Sports
-
-
T
T
F
F
Recommendations
-
-
T
F
T
F
X
X
X
Reject
Accept
X
X
X
Note that the rules are vague.
5
CS 501 Spring 2002
Good Example: Decision Table
University Admission Decision
SAT > S
T
F
F
F
F
F
GPA > G
-
T
F
F
F
F
Athletics code = 
-
-
T
T
F
F
Recommendations > A-
-
-
T
F
T
F
X
X
X
Send rejection letter
Send acceptance letter
X
X
X
Note that the rules are now specific and testable.
6
CS 501 Spring 2002
Data-Flow Models
External entities
Processing steps
Data stores or sources
Data flows
7
CS 501 Spring 2002
Data-Flow Example:
University Admissions
Rejection
Application
Completed
form
Receive application
Evaluate
application
Applicant
Acceptance
8
CS 501 Spring 2002
Data-Flow Example:
Assemble Application Stage
Acknowledgment
Application
form
Receive
Applicant
Completed
application
Acknowledgment
AND
Initiate
evaluation
Evaluation
request
AND
Supporting
information
9
Pending
database
Applicant
database
CS 501 Spring 2002
Data-Flow Example:
Process Completed Application Stage
Rejection
Evaluation
request
Acceptance
Evaluation
Financial
aid
Offer
Special
request
Applicant
database
10
CS 501 Spring 2002
Procedural Models: Flowchart
Operation
Decision
Manual operation
Report
11
CS 501 Spring 2002
Flowchart: University Admissions
Form
received
New?
T
Database
record
F
Update
database
Complete? T
F
Notify
student
Evaluate
Notify
student
12
CS 501 Spring 2002
Procedural Models: Pseudo-code
Example: Check project plan
check_plan (report)
if report (date_time) > due_date_time then error (too_late)
if report (client) = none then error (no_client)
if report (team) < min_team or > max_team
then error (bad_team)
if error() = none
then comments = read_report (report)
return (comments (text), comments (grade))
else return error()
13
CS 501 Spring 2002
Entity-Relation Model
A Design Methodology for Relational Databases
• A database of entities and relations
• Tools for displaying and manipulating entity-relation
diagrams
• Tools for manipulating the database (e.g., as input to
database design)
Warning: There is much confusion about definitions and
notation
14
CS 501 Spring 2002
Entity-Relation Diagram
An entity
A relation between
entities
An entity or relation
attribute
An inheritance
relation
15
CS 501 Spring 2002
Example: CS 501 Project
Major
Client
0:n
1
Student
Project
Person
0:n
1
CS501
Student
16
5 to 7
0:n
Tech contact
Member of
CS 501 Spring 2002
Example: MARC Catalog Record
Caroline R. Arms, editor, Campus strategies for libraries and
electronic information. Bedford, MA: Digital Press, 1990.
17
CS 501 Spring 2002
MARC Format for Books
001
245
260
650
650
700
18
89-16879 r93
Campus strategies for libraries and electronic information
{Bedford, Mass.} : Digital Press, c1990.
Academic libraries--United States--Automation.
Libraries and electronic publishing--United States.
Arms, Caroline R. (Caroline Ruth)
CS 501 Spring 2002
Entity-Relation Diagram for MARC
Book
0:n
Author of
0:n
1
0:n
Editor of
Describes
0:n
Catalog
record
Short title
19
1:n
Is about
Creator
0:n
0:n
Subject
heading
Control numb
CS 501 Spring 2002
Data Dictionaries
A data dictionary is a list of names used by the system
• Brief definition (e.g., what is "date")
• What is it (e.g., number, relation)
• Where is it used (e.g., source, used by, etc.)
• May be combined with a glossary
As the system is implemented, the data dictionary in the
requirements is input to the system data dictionary, which is a
formal part of the system specification.
20
CS 501 Spring 2002
A Note on Object Models
This course teaches object models as a tool for design.
Some people recommend object models for requirements
definition, but it is difficult to use them without constraining
the system design.
21
CS 501 Spring 2002
Examples
For examples of requirements documentation, see the Pfleeger
web site:
http://www.cs.umd.edu/~sharip/swebook/requirement.html
22
CS 501 Spring 2002
Discussion of Pfleeger, Chapter 4
Format:
State a question.
Ask a member of the class to answer.
(Sorry if I pronounce your name wrongly.)
Provide opportunity for others to comment.
When answering:
Stand up.
Give your name or NetID. Make sure the TA hears it.
Speak clearly so that all the class can hear.
23
CS 501 Spring 2002
Question 1: Terminology
(a) What is the purpose of requirements definition?
(b) What is the purpose of requirements specification?
(c) What are functional requirements?
(d) What are non-functional requirements?
24
CS 501 Spring 2002
Question 2: Static descriptions of
requirements
(a) What is a static requirements definition?
(b) Give two examples of application areas where a
static requirements description might be used.
(c) How do static definitions of requirement relate to
system testing?
(d) How do static definitions of requirement relate to
system and program design?
25
CS 501 Spring 2002
Question 3: Transition Diagrams
(a) What does the book mean by a state? Give an example.
(b) What does the book mean by a transition? Give an
example.
(c) Explain the notation in the expression:
f (Si, Cj) = Sk
Use the following diagram as an example:
0
1
S1
0
26
1
S3
S2
0
1
CS 501 Spring 2002
Question 4: Petri Nets
Explain the following diagrams:
A
Event
S
Event 1
S
A
Event n
Event 1
A
Event n
27
S1
..
Sm
CS 501 Spring 2002
Question 5: Prototyping
Requirements
(a) How does rapid prototyping differ from other
forms of prototyping?
(b) Under what circumstances would you use rapid
prototyping?
28
CS 501 Spring 2002