320 likes | 339 Views
CS 501: Software Engineering. Lecture 10 Requirements 4. Course Administration. Assignment 2, First Milestone, March 6-8 Read information on the Assignments Web page Reserve time for your presentation. See the home page of the Web site. i Client must be present
E N D
CS 501: Software Engineering Lecture 10 Requirements 4
Course Administration Assignment 2, First Milestone, March 6-8 Read information on the Assignments Web page Reserve time for your presentation. See the home page of the Web site. i Client must be present ii Not all team members must be present, but each team member must make a presentation at least once during the semester iii Try to find a time when the TA can be present
Planning for the Presentation How will you use the time? This is a presentation to the client, with the instructor as a secondary audience. Possible topics: • Overview of project and progress against plan. • Presentation of assumptions, decisions. • Summary of requirements in moderate detail. • What has been learned since feasibility study? Changes in plans. Allow 15 minutes for questions. Expect interruptions. "This is our understanding of your requirements."
Planning for the Presentation Logistics Have a rehearsal, check visual aids and demonstrations. Then change nothing. Check out the equipment in the meeting room. What network will you use (if any). How will you connect a computer (if you do)? What about firewalls? Will one person act as chair and call on other members of the team? Not everybody is a great presenter, but everybody can be well-prepared.
During the Presentation • The presenter should stand. Other people should sit. • Appoint a team member to take notes. • The first presenter should introduce everybody. • When asked a question: -> If the presenter knows the answer, answer it. -> Or the presenter may ask another team member to answer. -> Otherwise make a note and reply later. • Never interrupt your colleagues. If you have information to add, raise you hand and the presenter can decide whether to call on you.
Formal Specification Why? • Precise standard to define and validate software. Why not? • May be time consuming • Methods are not suitable for all applications
Remember Formal specification does not prescribe the implementation With formal specification it is possible, at least theoretically, to generate code automatically from the specification, but this may not be the most effective way: • Writing the generator may be a very large programming task. • The resulting code may perform badly. Formal specification does not guarantee correctness • If the specification is wrong, the system will be wrong.
Specification using Mathematical Notation Mathematical requirements can be specified formally. Example: requirements for a linear programming package: • Maximize c' x, subject to Ax <= b, x >= 0 But this is not complete.
Specification using Mathematical Notation (continued) Example: requirements for a linear programming package: • Maximize c' x, subject to Ax <= b, x >= 0 • Use the Revised Simplex algorithm as defined in <reference>. • The error in the results must not exceed <specify>. • The package must be able to handle up to <specify> non-zero elements in A, b, and c, in the range of values <specify>. • The package must provide the following interfaces for data input and results <specify>. • The package must be numerically stable on computer systems with the following properties <specify>.
digit digit + . E - Formal Specification Using Diagrams Example: Pascal number syntax unsigned integer unsigned number unsigned integer unsigned integer
Formal Specification of Programming Languages Example: Pascal number syntax <unsigned number> ::= <unsigned integer> | <unsigned real> <unsigned integer> ::= <digit> {<digit>} <unsigned real> ::= <unsigned integer> . <digit> {<digit>} | <unsigned integer> . <digit> {<digit>} E <scale factor> | <unsigned integer> E <scale factor> <scale factor> ::= <unsigned integer> | <sign> <unsigned integer> <sign> ::= + | -
Formal Specification using Z ("Zed") Z is a specification language developed by the Programming Research Group at Oxford University around 1980. Z is used for describing and modeling computing systems. It is based on axiomatic set theory and first order predicate logic. Ben Potter, Jane Sinclair, David Till, An Introduction to Formal Specification and Z (Prentice Hall) 1991 Jonathan Jacky The Way of Z (Cambridge University Press) 1997
Example: Specification using Z Informal: The function intrt(a) returns the largest integer whose square is less than or equal to a. Formal (Z): intrt: NN a : N • intrt(a) * intrt(a) < a < (intrt(a) + 1) * (intrt(a) + 1)
Example: Implementation of intrt Static specification does not describe the design of the system. A possible algorithm uses the mathematical identity: 1 + 3 + 5 + ... (2n - 1) = n2
Example: Program for intrt int intrt (int a) /* Calculate integer square root */ { int i, term, sum; term = 1; sum = 1; for (i = 0; sum <= a; i++) { term = term + 2; sum = sum + term; } return i; }
Formal Specification of Finite State Machine Using Z In the previous lecture, we discussed finite state machines as a convenient tool for clarifying requirements in discussions with clients. A finite state machine can also be used as a method of formal specification. It may be the input into automatic program generation.
State Transition Diagram Select field Start Enter Enter (lock off) Beam on Patients Fields Setup Ready Stop (lock on) Select patient
State Transition Table Select Patient Select Field lock on lock off Enter Start Stop Patients Fields Setup Patients Fields Setup Fields Ready Patients Beam on Patients Ready Fields Setup Beam on Ready Setup
Z Specification STATE ::= patients | fields | setup | ready | beam_on EVENT ::= select_patient | select_field | enter | start | stop | lock_off | lock_on FSM == (STATE X EVENT) STATE no_change, transitions, control : FSM Continued on next slide
Z Specification (continued) control = no_change transitions no_change = { s : STATE; e : EVENT • (s, e) s } transitions = { (patients, enter)fields, (fields, select_patient) patients, (fields, enter) setup, (setup, select_patient) patients, (setup, select_field) fields, (setup, lock_off) ready, (ready, select_patient) patients, (ready, select_field) fields, (ready, start) beam_on, (ready, lock_on) setup, (beam_on, stop) ready, (beam_on, lock_on) setup }
Schemas in Z Schema: • The basic unit of formal specification. • Enables complex system to be specified as subsystems • Describes admissible states and operations of a system.
In carefully monitored industrial use, Z has been shown to improve the timeliness and accuracy of software development, yet it is not widely used in practice. Complexity of notation makes communication with client difficult. Few software developers are comfortable with the underlying axiomatic approach. Heavy notation is awkward to manipulate with conventional tools, such as word processors. Z in Practice
Requirements for user interfaces • It is very difficult to specify and comprehend an interactive • interface in a textual documents • Requirement documents benefit from sketches, comparison with existing systems, etc. • Design documents should definitely include graphical elements and often benefit from a mock-up or other form of prototype. • Implementation plans should include evaluation of user factors and time to make changes. • User interfaces must be tested with users, with a willingness to • change the requirements as the result of testing.
The Requirements/Design/Evaluate Loop Design ? Requirements Build Evaluate
Tools for developing usability requirements and evaluation of usability Initial Mock-up Prototype Production Client's opinions Competitive analysis Expert opinion Focus groups Observing users Measurements
Tools for developing usability requirements: Focus group A focus group is a group interview •Interviewer •Potential users Typically 5 to 12 Similar characteristics (e.g., same viewpoint) •Structured set of questions May show mock-ups Group discussions •Repeated with contrasting user groups
Usability:Accessibility requirements Requirements about accessibility (e.g., support for users with disabilities) are most likely to arise in the user interface. You may have a legal requirement to support people with disabilities. Example of requirements specification: The system must comply with Section 508 of the US Rehabilitation Act. See http://www.section508.gov/
Usability: Design Tensions in Networked Systems • Client computers and network connections vary greatly in capacity • Client software may run on various operating systems. It may be current or an earlier version. What assumptions do you make about the user's computer and Web browser? • System designers wish to control client software, e.g., Web browsers; users wish to configure their own environments. This can be a factor in accessibility, e.g., which part of the system determines the font size.
Usability: Device-aware user interfaces • Examples of devices: desk-top computer, fast network connection laptop computer, intermittent connectivity PalmPilot, synchronization smart telephone digital camera, camcorder • Device-aware user interfaces are aware of: => performance of device => limited form factor (display, keyboard) => connectivity
Special Considerations: Computer systems and networks The performance, reliability and predictability of computer systems and networks is crucial to usability • Response time instantaneous for mouse tracking and echo of key stroke 5 seconds for simple transactions • Example: Pipelined algorithm for the Mercury page turner • Quality of Service for real time information
Special Considerations: Usability and Cost • Good usability may be expensive in hardware or special software development • User interface development may be a major part of a software development project Programming environments provide powerful user interface toolkits • Costs are multiplied if a user interface has to be used on different computers or migrate to different versions of systems Web browsers provide a general purpose user interface where others maintain the user interface software