Software Requirements Engineering Material for Software Engineering for Outsourced & Offshore Development Bertrand Meyer Bernd Schoeller Chair of Software Engineering, ETH Zurich Fall 2005 Softw are Engineering Statements about requirements: Brooks Source*: Brooks 87 The hardest single part of building a software system is deciding precisely what to build. No other part of the conceptual work is as difficult as establishing the detailed technical requirements, including all the interfaces to people, to machines, and to other software systems. No other part of the work so cripples the resulting system if done wrong. No other part is more difficult to rectify later. *For sources cited, see bibliography 2 Softw are Engineering
Statements about requirements: Boehm Source*: Boehm 81 Relative cost to correct a defect 70 60 50 40 30 20 10 0 Requirements Design Code Development Acceptance Operation Testing Testing 3 Source: Boehm, Barry W. Software Engineering Economics . Englewood Cliffs, NJ: Prentice-Hall, 1981 Softw are Engineering Topics Part 1: Overview Part 2: Standards & Methods Part 3: Tools Part 4: Object-Oriented Requirements Part 5: Formal Requirements Part 6: Non-functional requirements, conclusion Complementary material: Glossary, Bibliography 4 Softw are Engineering
Source*: Wing 88 The case study Consider a small library database Transactions 1, 2, 4, and 5 are with the following transactions: restricted to staff users, except that ordinary borrowers can 1. Check out a copy of a book. perform transaction 4 to find Return a copy of a book. out the list of books currently 2. Add a copy of a book to the borrowed by themselves. The library. Remove a copy of a database must also satisfy the book from the library. following constraints: 3. Get the list of books by a � All copies in the library must particular author or in a be available for checkout or particular subject area. be checked out. 4. Find out the list of books � No copy of the book may be currently checked out by a both available and checked particular borrower. out at the same time. 5. Find out what borrower last � A borrower may not have checked out a particular copy more than a predefined of a book. number of books checked out There are two types of users: staff at one time. users and ordinary borrowers. 5 Softw are Engineering Part 1 : Overview of the requirements task Softw are Engineering
A definition “A requirement” is a statement of desired behavior for a system “The requirements” for a system is the collection of all such individual requirements 7 Softw are Engineering Goals of performing requirements Source: OOSC � Understand problem or problems that the eventual software system, if any, should solve � Prompt relevant questions about problem & system � Provide basis for answering questions about specific properties of problem & system � Decide what system should do � Decide what system should not do � Ascertain that system will satisfy the needs of its stakeholders � Provide basis for development of system � Provide basis for V & V* of system *Validation & Verification , including testing 8 Softw are Engineering
Products of requirements � Requirements document � Development plan � V&V plan (including test plan) 9 Softw are Engineering Possible requirements stakeholders � Legal experts � Clients (tailor-made system) � Purchasing agents � Customers (product for � Software developers general sale) � Software project � Clients’ and customers’ managers customers � Software documenters � Users � Software testers � Domain experts � Trainers � Market analysts � Consultants � Unions? 10 Softw are Engineering
Your turn! Who are the stakeholders? Consider a small library database Transactions 1, 2, 4, and 5 are with the following transactions: restricted to staff users, except that ordinary borrowers can 1. Check out a copy of a book. perform transaction 4 to find Return a copy of a book. out the list of books currently 2. Add a copy of a book to the borrowed by themselves. The library. Remove a copy of a database must also satisfy the book from the library. following constraints: 3. Get the list of books by a � All copies in the library must particular author or in a be available for checkout or particular subject area. be checked out. 4. Find out the list of books � No copy of the book may be currently checked out by a both available and checked particular borrower. out at the same time. 5. Find out what borrower last � A borrower may not have checked out a particular copy more than a predefined of a book. number of books checked out There are two types of users: staff at one time. users and ordinary borrowers. 11 Softw are Engineering Requirements categories Functional Non-functional Software only Full system Object-oriented Procedural vs Formal Informal Graphical Textual Non-executable Executable 12 Softw are Engineering
Requirements vs prototyping “ Prototype ” may mean: 1. Pilot project 2. Throw-away development Brooks: “ Plan to throw one away; you will anyhow ” 3. Incremental development 4. Preparing for reusable components 5. Experimentation: user interface, implementation… 6. Experimentation: requirements capture A prototype (1, 5, 6) may help requirements, but is not a substitute for requirements. 13 Softw are Engineering 14 habits of successful requirements � Correct � Traceable � Complete � Delimited � Consistent � Readable � Unambiguous � Modifiable � Feasible � Testable � Relevant � Prioritized � Abstract � Endorsed 14 Softw are Engineering
Difficulties of requirements � Natural language and its imprecision � Formal techniques and their abstraction � Users and their vagueness � Customers and their demands � The rest of the world and its complexity 15 Softw are Engineering The two constant pitfalls � Committing too early to an implementation Overspecification! � Missing parts of the problem Underspecification! 16 Softw are Engineering
A simple problem Source: Naur Given a text consisting of words separated by BLANKS or by NL (new line) characters, convert it to a line-by-line form in accordance with the following rules: 1. Line breaks must be made only where the given text has BLANK or NL; 2. Each line is filled as far as possible as long as: 3. No line will contain more than MAXPOS characters 17 Softw are Engineering Source: Goodenough & Gerhart “Improved” The program's input is a stream of The program's output should be the same characters whose end is signaled sequence of words as in the input, with with a special end-of-text the exception that an oversize word (i.e. a character, ET . There is exactly one word containing more than MAXPOS ET character in each input stream. characters, where MAXPOS is a positive Characters are classified as: integer) should cause an error exit from the program (i.e. a variable, Alarm , should � Break characters — BL (blank) have the value TRUE ). Up to the point of and NL (new line); an error, the program's output should � Nonbreak characters — all have the following properties: others except ET ; 1. A new line should start only between � The end-of-text indicator — ET . words and at the beginning of the output A word is a nonempty sequence of text, if any. nonbreak characters. A break is a 2. A break in the input is reduced to a sequence of one or more break single break character in the output. characters. Thus, the input can be 3. As many words as possible should be viewed as a sequence of words placed on each line (i.e., between separated by breaks, with possibly successive NL characters). leading and trailing breaks, and ending with ET . 4. No line may contain more than MAXPOS characters (words and BL s). 18 Softw are Engineering
Recommend
More recommend