1 / 83

Sequence Enumeration A technique for specifying software intensive systems

Sequence Enumeration A technique for specifying software intensive systems. Specifying a System. If the systems planners and customer do not Specify what is expected in all types of interactions with the system, i.e. the behavior of the system, someone else will. That someone else is most

cale
Télécharger la présentation

Sequence Enumeration A technique for specifying software intensive systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sequence EnumerationA technique for specifying software intensive systems

  2. Specifying a System If the systems planners and customer do not Specify what is expected in all types of interactions with the system, i.e. the behavior of the system, someone else will. That someone else is most likely the programmer when he or she is coding the ELSE option of some IF statement. There is a very low probability that the programmer’s guesses as to the expected behavior will be what The customer expects. -- James Kowal, “Behavior Models: Specifying User’s Expectations”

  3. Set of behaviors Requirements Specifications Program Software design is deductive Progressive reasoning from the general (user requirements to the specific (software design)

  4. Complete, consistent, correct • “Complete” All possible stimulus histories have been mapped to their corresponding responses. • “Consistent” No history has been mapped to more than one response or one set of responses. • “Correct” The domain, range, and mapping have been properly specified in the judgement of the domain experts.

  5. A Quick Overview of Function Theory

  6. Two Sets B A b w x d a c z y e A X B = { <a,b> | a  A, b  B } = <a,x>, <a,w>, <a,y>, <a,z>, <b,x>, <b,w>, <b,y>, <b,z>, <c,x>, <c,w>, <c,y>, <c,z>, <d,x>, <d,w>, <d,y>, <d,z>, <e,x>, <e,w>, <e,y>, <e,z>

  7. A relation between two sets B A b w x d a c z y e

  8. A relation between two sets that qualifies as a function B A b x d a w c z y x

  9. A complete function B A b x d a w c z y e

  10. A Mapping Rule mapping rule All possible results (co-domain) All possible scenarios of use (domain) Correct results (range)

  11. Specification Steps • Behavior • Shows relationship between input and output • State • Shows how stimulus history affects the output • Implementation • Shows how the state box information is implemented

  12. Behavior view • Defines required external behavior for all possible circumstances of use • Receives stimulus, S, from environment and produces response, R to environment • Response depends on current stimuli and history of stimuli received so far • No knowledge of internal behavior • State free and procedure free • Mathematically, SH  R

  13. The Black Box; Behavior view Description may be mathematical or a Natural language Description of functionality SH R SH  R

  14. A calculator example • What is the effect of pressing 6 ? • It depends • Stimulus history 1 • SH: Clear 7 1 3 • S: 6 • Response: Display 7136

  15. A calculator example • What is the effect of pressing 6 ? • It depends • Stimulus history 2 • SH: Clear 7 1 3 * • S: 6 • Response: Display 6

  16. State view • Defines the state space • Encapsulate stimulus history as state data (procedure free) • (old state, stimulus)  (new state, response) • Preserves black box specification • Several possible state implementations of the black box

  17. Invent State Data; data view state machine S R black box ( OS, S )  ( NS, R )

  18. State machine description of the Calculator 0..9/add digit to display 0..9/add digit to display clear +,-,*,/ store operand1 store op; clear display store operand 2 display operand1 op operand2

  19. The Clear Box view • Defines processing required to implement the defined state behavior • Computer program that accepts stimulus, S, and, using the state data defined, produces response, R • Several possible implementations • (old state, stimulus)  (new state, response), by procedure

  20. Implementation; A Clear box view state machine R S ( OS, S )  ( NS, R ) by procedure

  21. Sequence-based Specification Process • Stepwise construction of complete, consistent, correct specifications • All possible sequences of stimuli are enumerated systematically in strict order • Stimulus sequences of length zero, length one, length two, etc • Each sequence mapped to its correct response

  22. Sequence-based Specification Process • Equivalent sequences identified by applying a reduction rule • Enumeration process terminates when the system has been defined completely and consistently • Makes a tractable problem of the large number of use cases arising from the combinatorial use of S/W

  23. Steps to Defining Behavior • Tagged requirements • System boundary definition • Sequence enumeration • Canonical sequence analysis

  24. Tagged requirements • Requirements are tagged for use in verifying the correctness of each element of subsequent work products • Methodical consideration of sequences in the enumeration process forces exposure of ambiguities and omissions in the requirements

  25. System Boundary Definition • Determines which components are inside and outside the system • Entities outside are sources of stimuli and destination of responses • Identification begins are the atomic level • Abstractions invented to simplify the enumeration process • Used to hide well-known details • Reflect natural partitions in the product • Reduce a large set of elements to a smaller set

  26. Sequence Enumeration • Sequences are enumerated in order of length and evaluated; • Sequences that are impossible are marked “illegal”, not considered further • Correct response traced to requirement or a “derived” requirement formed • Two sequences are “equivalent” if their responses to further stimuli are identical (only extend the shorter)

  27. Sequence Enumeration • Enumeration stops when all sequences of a given length are illegal or equivalent to a shorter sequence • Completed enumeration is mathematically complete (all sequences mapped to a response) and consistent (each sequence mapped to only one response)

  28. Canonical Sequence Analysis • Legal sequences in the enumeration that are not equivalent to any previous sequence are canonical • Represent unique conditions of system usage • Analysis reveals the state space for the system (at current level of abstraction) • Variables invented to encapsulate conditions in each sequence of stimuli • Can represent state data for the system

  29. 1 2 3 Example – Specification of a Security Alarm SET 4 5 6 7 8 9 CLEAR

  30. Tagged Requirements for the Security System

  31. Security Alarm Stimuli

  32. Security Alarm Stimuli • Trip, Set, Clear are atomic stimuli • GoodDigit and BadDigit are abstractions • Represent correct and incorrect behavior of digits in a three-digit code • Abstraction serves the purpose of hiding well understood atomic level details (whether a digit is good or bad)

  33. Security Alarm Responses

  34. software system System Boundary Diagram Trip Light On Set Light Off Clear Alarm On GoodDigit BadDigit Alarm Off

  35. Security Alarm Responses • Two additional responses used in sequence enumeration • Null response; occurs when there is no external system response • System ignoring stimuli • System accumulating stimuli • Illegal response; sequence is impossible (e.g. stimuli presented before invocation)

  36. Sequence Enumeration Carry to Next level

  37. Sequence Length Five Each entry has an equivalence – Therefore we can stop enumerating!!!

  38. Sequence-based Specification Process • A sequence represents a scenario of use • Sequence enumeration reveals; • Possible scenarios • Impossible scenarios • Intended uses • Erroneous use • Reducible sequences • Irreducible sequences

  39. Irreducible Sequences • Canonical sequences; basis for precise specification of software behavior; • Mathematically correct; literal enumeration of sequences – all combinations mapped to response • Consistent; orderly enumeration of sequences ensures that a given scenario of use only appears once • Traceable correct; every element of sequence based specification traced to requirements origin

  40. Enumeration complete • Every scenario has been mapped to a response (complete) • Every scenario has been mapped to only one response (set), (consistent) • Requirements can now confirm that assumptions and derived requirements are correct

  41. Canonical Sequence Analysis • State data encapsulates and retains the components of stimulus history that must be preserved for the system to produce the correct response • Canonical sequence; sequences that are not equivalent to any previous sequence • Invent state variables to represent the canonical sequences

  42. Canonical S tate Value Value sequence Variables before after current current stimulus stimulus Empty N/A S; The user has Device OFF ON pressed the Set button to activate the device S T; The device Device ON ON has been set and the trip Alarm OFF ON signal has occurred, setting off the alarm S B; The device Device ON ON has been set the user has Code NONE ERROR entered an invalid digit

  43. State Variables

More Related