280 likes | 490 Vues
Requirements Specification. Welcome to Software Engineering:. “Requirements Specification” Verb? Noun? “Specification” not the same as “Requirements Specification”? “Requirements” not the same as “Specification”?. Requirements vs Specifications.
E N D
Welcome to Software Engineering: • “Requirements Specification” • Verb? • Noun? • “Specification” not the same as “Requirements Specification”? • “Requirements” not the same as “Specification”?
Requirements vs Specifications • A specification is a precise statement of the requirements that the system must satisfy.
Requirements Specification Sommerville: is the activity of translating the information gathered during the analysis activity into a document that defines a set of requirements. IEEE: Requirements specification is documentation of the essential requirements (functions, performance, design constraints, and attributes) of the software and its external interfaces. (STD 1012)
Uses of requirements • Statement of the needs of the users • Statement of the things the system has to do for the designers. • Statement of reference for maintenance
Formality • Informal: not formal • Formal (Davis): Written down in an SRS in a natural language (e. g. English). • Formal (Ghezzi): Written down in a formal specification language (e. g. Z, Larch, First-Order Language, VDM, …) • Formal languages have formal, mathematically defined semantics
Functional vs Non-functional • functional requirements, (what does it do) • non-functional requirements • reliability, availability, security, accuracy • interface issues, operating constraints, • requirements on development process • quality control • system test procedures • priorities
Understandable Nonprescriptive Correct Complete Set Individually Complete Concise Precise Clear Unambiguous Consistent Traceable Modifiable Testable Feasible Properties of Good RequirementsHamlet
Complete Correct Unambiguous, Precise, Clear Consistent Relevant Testable Traceable Feasible Free of Unwarranted Design Detail Manageable Boeing Computer Services
Example of Concise, not ClearHamlet The items in tab-separated columns and underscore-separated rows of the output may refer to each other; but no item in (row,column) position (i,j) may refer to another in position (p,q) unless p<i, or if i=p,q<j.
Less concise, but clear Hamlet The output shall consist of rows and columns. Items across each row shall be separated by tabs. There shall be an underscore between rows. When item X refers to item Y, Y must either be in a row above X, or if they are in the same row, Y must be in a column to the left of X. An item may not refer to itself.
Requirements Statement • “The system shall …” • Grouped by functionality or subsystem
Learning to Write Requirements • Learn to critique problems. • Learn to rework those requirements. • Learn to critique and rework your requirement statements. • It is difficult to get these right.
MS Word example: Selecting is the process for designating areas of your document that you want to work on. Most editing and formatting actions require two steps: first you select what you want to work on, such as text or graphics; then you initiate the appropriate action.
Another example: The message must be triplicated. The three copies must be forwarded through three different physical channels. The receiver accepts the message on the basis of two-out-of-three voting policy.
Specification Languages • UML (you’ve seen some of this already) • SDL • SCR
SDL: Specification and Description Language • Language standard from the International Telecommunications Union • Specifies real-time, concurrent, distributed processes • Inter-process communication is through unbounded message queues • 3 Diagrams and algebraic specifications • Algebraic specs here are ADTs
SDL Diagrams • System Diagram • Block Diagram • Process Diagram
SCR: Software Cost Reduction • Heitmeyer, Navy Research Lab • Models a system as a function mapping monitored environmental (input) variables to (system) controlled (output) variables • The function is decomposed into smaller functions, each of which has a table of input/output values • The tables are composed in a data-flow format
Execution of SCR models • Execution is modeled as a flow of variable updates • Outputs of one table may be the inputs to other tables • When an input value to one table changes, the outputs are propagated to all the other tables • Used to clarify and model requirements • Some work on automated translation of SCR models to code
Classification of Specification Styles • Formal vs Informal • Operational vs Behavioral • Sometimes it it claimed that behavioral is more abstract than operational.
Example: operational: Let a be an array of n elements. The result of sorting a is an array b of n elements such that the first element of b is the smallest element of a, the second element of b is the smallest element of the array of n-1 elements obtained by removing the smallest element of a, and so on until all n elements have been removed.
Example behavioral (descriptive): The result of sorting a is an array b which is a permutation of a and is sorted.
V&V • Validation: did we build the right product? • For software, does the system implement the requirements? • Verification: did we build the product right? • Does each function work correctly? (For software, does it match the specification?)
Techniques for Validation • Walkthroughs • Reviews • Models • Use cases/Scenarios • Prototypes • Simulations • Tracing
Verification of Specifications • Recall that correctness does not imply that the program matches the intentions. • Basically there are two ways to verify things: • observe its behavior and determine if it matches expectations • analyze the properties of the thing that can be deduced from the artifact created
Techniques for Verification • Simulation • Informal: walkthroughs, inspections • Formal: prototyping • Static Checking • Consistency • Completeness • Formal techniques • Model checking • Theorem proving
Verification of Specifications • If it’s formal, you might be able to create some sort of interpreter for it. (or a simulation of it). • If it’s not formal, then a prototype might be in order. Here, prototyping as a way of verifying the specs. • Compare to a bridge: A behavioral description could be the equations governing the support structure. The operational might be a model of the bridge, a mockup.