Download presentation
Presentation is loading. Please wait.
Published byGerardo Piercey Modified over 9 years ago
1
1 ECE 18-649 Soda Machine Example Status Update March 26, 2010 Group 7 Justin Ray (other group member names would go here)
2
Group #7Justin Ray2 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
3
Group #7Justin Ray3 Button Control Scenario/Sequence Diagram Use Case U2. Customer pushes a soda button Scenario/SD 2A: push button after paying Customer Button CoinControl VendControl 2a. ButtonLight[s](false) ButtonLight ButtonControl 2b. ButtonLight[s](true) 2a and 2b repeat until 5a. 1a. Button s pressed 1d. mCoinCount(2) 1c. mButton[s](true) 1b. Button[s](true) 16pt Flashing light behavior indicates that a soda vend is in progress. CoinCount==2mVend == False
4
Group #7Justin Ray4 Requirements & Statechart S2.3 VEND S2.1 IDLE DO: ButtonLight On mButton[s] False FlashCounter 0 S2.2 EMPTY DO: ButtonLight Off mButton[s] False FlashCounter 0 S2.4 FLASH_OFF DO: ButtonLight Off mButton[s] TRUE Increment FlashCounter S2.4 FLASH_ON DO: ButtonLight On mButton[s] TRUE Decrement FlashCounter T2.1 T2.2 T2.3 T2.6 T2.7 T2.4T2.5 T2.1 mButton[s] ← True AND mEmpty[s] ← False AND mVend ← False AND mCoinCount ← SODA_COST 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.
5
Group #7Justin Ray5 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;.... State ActionSC to Code Traceability Transition Implementation
6
Group #7Justin Ray6 Unit Testing 3 Unit Tests for ButtonControl 2 unit tests test T2.1 Unit tests (all controllers) found 4 defects ;#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 Injections for Guard Condition Assertions for State Output SC to Test Traceability
7
Group #7Justin Ray7 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
8
Group #7Justin Ray8 Project Statistics Date of Presentation02/1803/26Pres 3 # of Sequence Diagrams77--- # of SD arcs73 --- # of Requirements20 --- # of statecharts44--- # of SC states1618--- # of SC arcs2224--- # of non-comment LOCN/A672--- # of unit testsN/A10--- # of integration testsN/A7--- # of acceptance testsN/A5--- # unresolved defects00--- # of issue log entries717---
9
Group #7Justin Ray9 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
10
10 Any Questions? Team 7 Justin ray – justinr2@ece.cmu.edu …
11
11 Backup Slides
12
Group #7Justin Ray12 Statechart T2.1mButton[s] ← True AND mEmpty[s] ← False AND mVend ← False AND mCoinCount ← SODA_COST T2.2mVend ← True AND mEmpty[s] ← False T2.3mVend ← True AND mEmpty[s] ← True S2.3 VEND S2.1 IDLE DO: ButtonLight On mButton[s] False FlashCounter 0 S2.2 EMPTY DO: ButtonLight Off mButton[s] False FlashCounter 0 S2.4 FLASH_OFF DO: ButtonLight Off mButton[s] TRUE Increment FlashCounter S2.4 FLASH_ON DO: ButtonLight On mButton[s] TRUE Decrement FlashCounter T2.1 T2.2 T2.3 T2.6 T2.7 T2.4T2.5 T2.4FlashCounter > FlashLimit T2.5FlashCounterLimt ← 0 T2.6mEmpty ← True T2.7mEmpty ← False
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.