1 / 11

ECE 18-649 Soda Machine Example Status Update

ECE 18-649 Soda Machine Example Status Update. February 19, 2010 Group 7 Justin Ray READ THE SLIDE NOTES FOR COMMENTARY ON THIS EXAMPLE. Overview. ButtonControl Design Process Use case: pressing the button Scenarios, Sequence Diagrams, Requirements Statecharts: to nest or not to nest

ginger
Download Presentation

ECE 18-649 Soda Machine Example Status Update

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. ECE 18-649Soda Machine ExampleStatus Update February 19, 2010 Group 7 Justin Ray READ THE SLIDE NOTES FOR COMMENTARY ON THIS EXAMPLE

  2. Overview • ButtonControl Design Process • Use case: pressing the button • Scenarios, Sequence Diagrams, Requirements • Statecharts: to nest or not to nest • Design revisions • Missing inputs • Incorrect flashing behavior • Project Statistics • Lessons Learned Justin Ray

  3. ButtonControl: Use Case and Scenario • U2. Customer pushes a soda button • Primary use case for soda vending • U4. Observe soda availability • Deals with the behavior of the button light • Scenario 2A: push button after paying • Precondition: 2 coins inserted • Scenario • The Customer pushes soda button ‘s’. • The light on the soda button ‘s’ begins flashing. • … (vend cycle) • The light on the soda button s stops flashing. • Postcondition: A soda has been vended. Justin Ray

  4. Sequence Diagram 2A Button Customer ButtonLight VendControl CoinControl ButtonControl CoinCount==2 mVend == False 1a. Button s pressed 1b. Button[s](true) 1c. mButton[s](true) 16pt 1d. mCoinCount(2) Flashing light behavior indicates that a soda vend is in progress. 2a. ButtonLight[s](false) 2b. ButtonLight[s](true) 2a and 2b repeat until 5a. Note: Subset of the SD 2A relevant to the controller behavior. Justin Ray

  5. Requirements • 6 Requirements total • R2.4 indicates a vend cycle is in progress • If • Button[s] True AND • mEmpty[s] False AND • mCoinCount equals SODA_COST AND • mVend False, • then • R2.4a. ButtonState shall be set to True. • R2.4b. ButtonLight[s] shall be commanded to blink with a period of 1s. Justin Ray

  6. Statechart • Nested statechart avoids duplicating T2.2 and T2.3 • Early work on Proj 5  nested statechart is hard to implement S2.1 IDLE DO: ButtonLightOn mButton[s]  False FlashCounter  0 S2.3 VEND T2.1 S2.4 FLASH_OFF DO: ButtonLightOff mButton[s]  TRUE Increment FlashCounter T2.2 T2.6 T2.7 S2.2 EMPTY DO: ButtonLightOff mButton[s]  False FlashCounter  0 T2.3 T2.4 T2.5 S2.4 FLASH_ON DO: ButtonLightOn mButton[s]  TRUE Decrement FlashCounter T2.1 mButton[s] ← True AND mEmpty[s] ← False AND mVend ← False AND mCoinCount ← SODA_COST …. Justin Ray

  7. Project Statistics Justin Ray

  8. Lessons Learned & Open Issues • Problems that you have already solved • CoinControl missing a VEND state • Identified in reviews  mVend input unused • ButtonControl defects • Identified in reviews  incorrect flashing behavior • Team strategies • Sort out tools early • Only let one person edit a document at a time • Open issues • Refactor the ButtonControl statechart? • Decide between • more complex statechart that matches the code better • less complex statechart with duplicated transitions in code Justin Ray

  9. Any Questions? Team 7 Justin ray – justinr2@ece.cmu.edu …

  10. Backup Slides

  11. Statechart S2.1 IDLE DO: ButtonLightOn mButton[s]  False FlashCounter  0 S2.3 VEND T2.1 S2.4 FLASH_OFF DO: ButtonLightOff mButton[s]  TRUE Increment FlashCounter T2.2 T2.6 T2.7 S2.2 EMPTY DO: ButtonLightOff mButton[s]  False FlashCounter  0 T2.3 T2.4 T2.5 S2.4 FLASH_ON DO: ButtonLightOn mButton[s]  TRUE Decrement FlashCounter Justin Ray

More Related