1 ECE 18-649 Soda Machine Example Status Update March 26, 2010 Group 7 Justin Ray (other group member names would go here)

Slides:



Advertisements
Similar presentations
Java Control Statements
Advertisements

Switch code for Lab 4.2 switch (input) { /* input is a variable that we will test. */ case 'M': printf("The prefix is equal to 1E6.\n"); break; case 'k':
GAME:IT Junior Learning Game Maker: The Control Tab.
While Loops and If-Else Structures
1 ECE Soda Machine Example Status Update February 19, 2010 Group 7 Justin Ray READ THE SLIDE NOTES FOR COMMENTARY ON THIS EXAMPLE.
Objectives Using functions to organize PHP code
Loops (Part 1) Computer Science Erwin High School Fall 2014.
Finite state machines.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Advanced Digital Circuits ECET 146 Week 9 Professor Iskandar Hack ET 221B,
PHP Functions and Control Structures. 2 Defining Functions Functions are groups of statements that you can execute as a single unit Function definitions.
Lecture 7: PLC: Review Questions
Chapter 15 Design, Coding, and Testing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Design Document The next step in the Software.
1 ECE Mini-Report #1 Starting Point Month Day, 2010 Group #N Member Name 1 Member Name 2 Member Name 3 Member Name 4.
6. More on the For-Loop Using the Count Variable Developing For-Loop Solutions.
1 ECE Mini-Report #2 Starting Point Month Day, 2010 Group #N Member Name 1 Member Name 2 Member Name 3 Member Name 4.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
CONTROL STATEMENTS Lakhbir Singh(Lect.IT) S.R.S.G.P.C.G. Ludhiana.
ECE Mid-Term Project Presentation
chipKit Sense Switch & Control LED
Review Review Review. Concepts Comments: definition, example, different types of comments Class: definition, example Object: definition, example Data.
Agenda Control Flow Statements Purpose test statement if / elif / else Statements for loops while vs. until statements case statement break vs. continue.
A453 Exemplar Password Program using VBA
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
For Loops. Challenge: Racer ● Simulate a race that says “Now on lap X” for 10 laps. ● Make X vary, so it says 1, then 2, then 3 ● Use only one output.
C++ for Everyone by Cay Horstmann Copyright © 2012 by John Wiley & Sons. All rights reserved For Loops October 16, 2013 Slides by Evan Gallagher.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
Software Transition Testing Presented By: Varun Phanda
1/8/ L20 Project Step 8 - Data Path Copyright Joanne DeGroat, ECE, OSU1 State Machine Design with an HDL A methodology that works for documenting.
PHP Programming with MySQL Slide 4-1 CHAPTER 4 Functions and Control Structures.
Compunet Corporation1 Programming with Visual Basic.NET While, Do and For – Next Loops Week 5 Tariq Ibn Aziz.
Chapter 2 Functions and Control Structures PHP Programming with MySQL 2 nd Edition.
Chapter 5 Loops. Overview u Loop Statement Syntax  Loop Statement Structure: while, for, do-while u Count-Controlled Loops u Nested Loops u Loop Testing.
Chapter 04 Control Statements: Part II. OBJECTIVES In this part you will learn: if…else Double-Selection Statement. while Repetition Statement.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Control Statements I.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
JavaScript, Fourth Edition
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
1 b Boolean expressions b truth tables b conditional operator b switch statement b repetition statements: whilewhile do/whiledo/while forfor Lecture 3.
Selection statements Repetition statements. Lesson plan Main concepts Practice session –If- then –Switch –Nested if.
1 ECE Final Project Report Starting Point December zz, 2015 Group # gg Member Name 1 Member Name 2 Member Name 3 Member Name 4 SPEAKER NAME GOES.
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
1 ECE Final Mini-Report Starting Point Month Day, 2010 Group #N Member Name 1 Member Name 2 Member Name 3 Member Name 4.
1 Chapter 4 - Control Statements: Part 1 Outline 4.1 Introduction 4.4 Control Structures 4.5 if Selection Structure 4.6 if/else Selection Structure 4.7.
Slides by Evan Gallagher
Slides by Evan Gallagher
STOCK TRADING SIMULATION SYSTEM
REPETITION CONTROL STRUCTURE
European Robotic LABoratory
ITM 352 Flow-Control: Loops
Agenda Control Flow Statements Purpose test statement
Problem Solving and Programming CS140: Introduction to Computing 1 8/21/13.
Object Oriented Analysis and Design
While Loops and If-Else Structures
Coding Concepts (Basics)
Linked Lists.
Topics: Programming Constructs: loops & conditionals Digital Input
While Loops and If-Else Structures
While Loops and If-Else Structures
While Loops and If-Else Structures
CISC101 Reminders All assignments are now posted.
Program Flow.
While Loops and If-Else Structures
While Loops and If-Else Structures
While Loops And If-Else Structures
Lesson 3. Controlling program flow. Loops. Methods. Arrays.
Presentation transcript:

1 ECE Soda Machine Example Status Update March 26, 2010 Group 7 Justin Ray (other group member names would go here)

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

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

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.

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

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

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

Group #7Justin Ray8 Project Statistics Date of Presentation02/1803/26Pres 3 # of Sequence Diagrams77--- # of SD arcs # of Requirements # of statecharts44--- # of SC states # of SC arcs # of non-comment LOCN/A # of unit testsN/A10--- # of integration testsN/A7--- # of acceptance testsN/A5--- # unresolved defects00--- # of issue log entries717---

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 Any Questions? Team 7 Justin ray – …

11 Backup Slides

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