Professional Documents
Culture Documents
(Process-oriented)
Specification
A broad term that means definition Used at different stages of software development for different purposes Generally, a statement of agreement (contract) between
producer and consumer of a service implementer and user
Uses of specification
Statement of user requirements
major failures occur because of misunderstandings between the producer and the user "The hardest single part of building a softwarem system is deciding precisely what to build" (F. Brooks)
Ch. 5
Ch. 5
Ch. 5
Ch. 5
Specification qualities
Precise, clear, unambiguous Consistent Complete
internal completeness external completeness
Incremental
Ch. 5
can a message be accepted as soon as we receive 2 out of 3 identical copies of message or do we need to wait for receipt of the 3rd?
Ch. 5 9
Consistent
Example: specification fragment for a word-processor
The whole text should be kept in lines of equal length. The length is specified by the user. Unless the user gives an explicit hyphenation command, a carriage return should occur only at the end of a word.
Ch. 5
10
Complete
Internal completeness
the specification must define any new concept or terminology that it uses
glossary helpful for this purpose
Ch. 5
11
Incremental
Referring to the specification process
start from a sketchy document and progressively add details
Ch. 5
12
Descriptive
Behavior described in terms of properties
Ch. 5
13
Example 1
Specification of a geometric figure E:
E can be drawn as follows: 1. Select two points P1 and P2 on a plane 2. Get a string of a certain length and fix its ends to P1 and P2 3. Position a pencil as shown in next figure 4. Move the pen clockwise, keeping the string tightly stretched, until you reach the point where you started drawing
Ch. 5
15
A descriptive specification
Geometric figure E is describe by the following equation ax2 + by2 + c = 0 where a, b, and c are suitable constants
Ch. 5
16
Another example
OP
Let a be an array of n elements. The result of its sorting is an array b of n elements such that the first element of b is the minimum of a (if several elements of a have the same value, any one of them is acceptable); the second element of b is the minimum of the array of n-1 elements obtained from a by removing its minimum element; and so on until all n elements of a have been removed.
The result of sorting array a is an array b which is a permutation of a
and is sorted.
Ch. 5 17
DES
Safehome Software
Control panel of SafeHome software System
Main Functions
System configuration Sensor monitoring User interaction Message display and status Password verification System Activation/Deactivation
Function breakdown
Context-level Diagram
Data Dictionary
Data Construct Notation Meaning is composed of and either-or n repetition of optional data delimits comments
=
Sequence Selection Repetition + [|] {}n () **
Design Concept
Software design
Software design should be :
Well structured, Modular, Simple, Robust, Verifiable, Readable.
Modularity vs Cost
Control Hierarchy
Structural partitioning
Procedure layering