requirements specification. welcome to software engineering: “requirements specification”...

28
Requirements Specification

Upload: allen-fox

Post on 04-Jan-2016

288 views

Category:

Documents


10 download

TRANSCRIPT

Page 1: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Requirements Specification

Page 2: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Welcome to Software Engineering: ““Requirements Specification”Requirements Specification”

Verb?Verb? Noun?Noun? ““Specification” not the same as Specification” not the same as

“Requirements Specification”?“Requirements Specification”? ““Requirements” not the same as Requirements” not the same as

“Specification”?“Specification”?

Page 3: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Requirements vs Specifications

A A specificationspecification is a precise statement of the is a precise statement of the requirements that the system must satisfy.requirements that the system must satisfy.

Page 4: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Requirements Specification

Sommerville:Sommerville: is the activity of translating the is the activity of translating the information gathered during the analysis activity information gathered during the analysis activity into a document that defines a set of requirements.into a document that defines a set of requirements.

IEEEIEEE: Requirements specification is documentation : Requirements specification is documentation of the essential requirements (functions, of the essential requirements (functions, performance, design constraints, and attributes) of performance, design constraints, and attributes) of the software and its external interfaces. (STD the software and its external interfaces. (STD 1012)1012)

Page 5: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Uses of requirements

Statement of the needs of the usersStatement of the needs of the users Statement of the things the system has to do Statement of the things the system has to do

for the designers.for the designers. Statement of reference for maintenanceStatement of reference for maintenance

Page 6: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Formality

Informal: not formalInformal: not formal Formal (Davis): Written down in an SRS in Formal (Davis): Written down in an SRS in

a natural language (e. g. English).a natural language (e. g. English). Formal (Ghezzi): Written down in a formal Formal (Ghezzi): Written down in a formal

specification language (e. g. Z, Larch, First-specification language (e. g. Z, Larch, First-Order Language, VDM, …)Order Language, VDM, …) Formal languages have formal, Formal languages have formal,

mathematically defined semantics mathematically defined semantics

Page 7: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Functional vs Non-functional

functional requirements, (what does it do)functional requirements, (what does it do) non-functional requirements non-functional requirements

reliability, availability, security, accuracy reliability, availability, security, accuracy interface issues, operating constraints, interface issues, operating constraints, requirements on development processrequirements on development process

quality controlquality controlsystem test proceduressystem test proceduresprioritiespriorities

Page 8: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Properties of Good RequirementsHamlet

UnderstandableUnderstandable NonprescriptiveNonprescriptive CorrectCorrect Complete SetComplete Set Individually CompleteIndividually Complete

ConciseConcise PrecisePrecise ClearClear UnambiguousUnambiguous ConsistentConsistent TraceableTraceable ModifiableModifiable TestableTestable FeasibleFeasible

Page 9: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Boeing Computer Services

CompleteComplete CorrectCorrect Unambiguous, Unambiguous,

Precise, ClearPrecise, Clear ConsistentConsistent RelevantRelevant

TestableTestable TraceableTraceable FeasibleFeasible Free of Unwarranted Free of Unwarranted

Design DetailDesign Detail ManageableManageable

Page 10: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Example of Concise, not ClearHamlet

The items in tab-separated columns and The items in tab-separated columns and underscore-separated rows of the output underscore-separated rows of the output may refer to each other; but no item in may refer to each other; but no item in (row,column) position (row,column) position (i,j)(i,j) may refer to may refer to another in position another in position (p,q)(p,q) unless unless p<ip<i, or if , or if i=p,q<ji=p,q<j..

Page 11: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Less concise, but clear Hamlet

The output shall consist of rows and columns. The output shall consist of rows and columns. Items across each row shall be separated by Items across each row shall be separated by tabs. There shall be an underscore between tabs. There shall be an underscore between rows. When item X refers to item Y, Y rows. When item X refers to item Y, Y must either be in a row above X, or if they must either be in a row above X, or if they are in the same row, Y must be in a column are in the same row, Y must be in a column to the left of X. An item may not refer to to the left of X. An item may not refer to itself.itself.

Page 12: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Requirements Statement

““The system shall …”The system shall …” Grouped by functionality or subsystemGrouped by functionality or subsystem

Page 13: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Learning to Write Requirements

Learn to critique problems.Learn to critique problems. Learn to rework those requirements.Learn to rework those requirements. Learn to critique and rework your Learn to critique and rework your

requirement statements.requirement statements.

It is difficult to get these right.It is difficult to get these right.

Page 14: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

MS Word example:

Selecting is the process for designating areas Selecting is the process for designating areas of your document that you want to work on. of your document that you want to work on. Most editing and formatting actions require Most editing and formatting actions require two steps: first you select what you want to two steps: first you select what you want to work on, such as text or graphics; then you work on, such as text or graphics; then you initiate the appropriate action.initiate the appropriate action.

  

Page 15: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Another example:

The message must be triplicated. The three The message must be triplicated. The three copies must be forwarded through three copies must be forwarded through three different physical channels. The receiver different physical channels. The receiver accepts the message on the basis of two-accepts the message on the basis of two-out-of-three voting policy.out-of-three voting policy.

Page 16: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Specification Languages

UML (you’ve seen some of this already)UML (you’ve seen some of this already) SDLSDL SCRSCR

Page 17: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

SDL: Specification and Description Language Language standard from the International Language standard from the International

Telecommunications UnionTelecommunications Union Specifies real-time, concurrent, distributed Specifies real-time, concurrent, distributed

processesprocesses Inter-process communication is through Inter-process communication is through

unbounded message queuesunbounded message queues 3 Diagrams and algebraic specifications3 Diagrams and algebraic specifications

Algebraic specs here are ADTsAlgebraic specs here are ADTs

Page 18: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

SDL Diagrams

System DiagramSystem Diagram Block DiagramBlock Diagram Process DiagramProcess Diagram

Page 19: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

SCR: Software Cost Reduction

Heitmeyer, Navy Research LabHeitmeyer, Navy Research Lab Models a system as a function mapping monitored Models a system as a function mapping monitored

environmental (input) variables to (system) environmental (input) variables to (system) controlled (output) variablescontrolled (output) variables

The function is decomposed into smaller The function is decomposed into smaller functions, each of which has a table of functions, each of which has a table of input/output valuesinput/output values

The tables are composed in a data-flow formatThe tables are composed in a data-flow format

Page 20: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Execution of SCR models

Execution is modeled as a flow of variable updatesExecution is modeled as a flow of variable updates Outputs of one table may be the inputs to other Outputs of one table may be the inputs to other

tablestables When an input value to one table changes, the When an input value to one table changes, the

outputs are propagated to all the other tablesoutputs are propagated to all the other tables Used to clarify and model requirementsUsed to clarify and model requirements Some work on automated translation of SCR Some work on automated translation of SCR

models to codemodels to code

Page 21: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Classification of Specification Styles Formal vs InformalFormal vs Informal Operational vs BehavioralOperational vs Behavioral

Sometimes it it claimed that behavioral is Sometimes it it claimed that behavioral is more abstract than operational. more abstract than operational.

Page 22: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Example: operational:

Let a be an array of n elements. The result Let a be an array of n elements. The result of sorting a is an array b of n elements such of sorting a is an array b of n elements such that the first element of b is the smallest that the first element of b is the smallest element of a, the second element of b is the element of a, the second element of b is the smallest element of the array of n-1 smallest element of the array of n-1 elements obtained by removing the smallest elements obtained by removing the smallest element of a, and so on until all n elements element of a, and so on until all n elements have been removed.have been removed.

Page 23: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Example behavioral (descriptive):

The result of sorting a is an array b which The result of sorting a is an array b which is a permutation of a and is sortedis a permutation of a and is sorted ..

Page 24: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

V&V

Validation: did we build the right product?Validation: did we build the right product? For software, does the system implement For software, does the system implement

the requirements?the requirements? Verification: did we build the product right?Verification: did we build the product right?

Does each function work correctly? (For Does each function work correctly? (For software, does it match the software, does it match the specification?)specification?)

Page 25: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Techniques for Validation

WalkthroughsWalkthroughs ReviewsReviews ModelsModels

Use cases/ScenariosUse cases/Scenarios Prototypes Prototypes SimulationsSimulations

TracingTracing

Page 26: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Verification of Specifications

Recall that correctness does not imply that Recall that correctness does not imply that the program matches the intentions.the program matches the intentions.

Basically there are two ways to verify Basically there are two ways to verify things:things: observe its behavior and determine if it observe its behavior and determine if it

matches expectationsmatches expectations analyze the properties of the thing that analyze the properties of the thing that

can be deduced from the artifact createdcan be deduced from the artifact created

Page 27: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Techniques for Verification

Simulation Simulation Informal: walkthroughs, inspectionsInformal: walkthroughs, inspections Formal: prototyping Formal: prototyping

Static CheckingStatic Checking ConsistencyConsistency CompletenessCompleteness

Formal techniquesFormal techniques Model checkingModel checking Theorem provingTheorem proving

Page 28: Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”

Verification of Specifications

If it’s formal, you might be able to create some If it’s formal, you might be able to create some sort of interpreter for it. (or a simulation of it).sort of interpreter for it. (or a simulation of it).

If it’s not formal, then a prototype might be in If it’s not formal, then a prototype might be in order. Here, prototyping as a way of verifying the order. Here, prototyping as a way of verifying the specs.specs.

   Compare to a bridge: A behavioral description Compare to a bridge: A behavioral description

could be the equations governing the support could be the equations governing the support structure. The operational might be a model of the structure. The operational might be a model of the bridge, a mockup.bridge, a mockup.