1 / 12

ECE 18-649 Soda Machine Example Status Update

ECE 18-649 Soda Machine Example Status Update. March 26, 2010 Group 7 Justin Ray (other group member names would go here). Overview. ButtonControl Design Process Recap Use Case, Scenarios, Sequence Diagrams Requirements, Statecharts Implementation Unit Testing

brone
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 March 26, 2010 Group 7 Justin Ray (other group member names would go here)

  2. Overview • ButtonControl Design Process • Recap • Use Case, Scenarios, Sequence Diagrams • Requirements, Statecharts • Implementation • Unit Testing • Integration and Acceptance Testing • Design revisions • Project Statistics • Lessons Learned Justin Ray

  3. Flashing light behavior indicates that a soda vend is in progress. Button Control Scenario/Sequence Diagram • Use Case U2. Customer pushes a soda button • Scenario/SD 2A: push button after paying 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) 2a. ButtonLight[s](false) 2b. ButtonLight[s](true) 2a and 2b repeat until 5a. Justin Ray

  4. Requirements & Statechart • R2.4 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. 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

  5. State Action SC to Code Traceability Transition Implementation Implementation • Switch statements on state variable • Actions before transitions switch (currentState) { case IDLE: doIdle(); //#transition 'T2.1' if (localButton.pressed == true && mEmpty.getValue() == false && mVend.getVendState() == false && mCoinCount.getCoinCount() == SodaMachine.SODA_COST) { newState = State.VEND; //#transition 'T2.6' } else if (mEmpty.getValue() == true) { log("T2.6"); newState = State.EMPTY; } break; .... Justin Ray

  6. Unit Testing • 3 Unit Tests for ButtonControl • 2 unit tests test T2.1 • Unit tests (all controllers) found 4 defects SC to Test Traceability Injections for Guard Condition ;#transition 'T2.1‘ 1.0s I EMPTY_PER N EMPTY_CAN_ID Empty 2 = false 1.0s I COIN_COUNT_PER N COIN_COUNT_CAN_ID CoinCount = 2 1.0s I VEND_PER N VEND_CAN_ID Vend = false 1.0s I BTN_PER F Button 2 = true ;#state 'S2.4 FLASH_OFF' 1.41s A F Light 2 : lighted == false 1.41s A N BUTTON_CAN_ID Button 2 : getButtonState == true Assertions for State Output Justin Ray

  7. Integration and Acceptance Testing • 7 integration tests (1 per controller) • SD1C and SD2a integration test transition T2.1 • Integration tests (all controllers) found 2 defects • Acceptance Tests • Tests test T2.1  customers press buttons • All tests pass • One 10-customer test • Four 100-customer tests Justin Ray

  8. Project Statistics Justin Ray

  9. Lessons Learned & Open Issues • Problems that you have already solved • Nested statecharts • Keep the nested statecharts • Collapse states in implementation • CoinControl - CoinOut timing • Simulation framework wont always deliver one period pulse • Added RETURN_STRETCH and OVERPAY_STRETCH states • Strategies • Assign one person to integrate portfolio • Scripts to automate testing are very useful • Rerun the tests after every design change/bug fix • Open issues • None Justin Ray

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

  11. Backup Slides

  12. 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