10
Development Walkthrough Prof H Roumani 1 ADEVELOPMENT WALKTHROUGH PROF HROUMANI Dept of Electrical Engineering & Computer Science THE BMI CALCULATOR PROJECT THE WALKTHROUGH 1. THE PROCESS 2. REQUIREMENT 3. DESIGN 4. THE PROJECT 5. THE VIEW 6. THE CONTROLLER 7. THE MODEL 8. TESTING 9. DEPLOYMENT A. THE MAKING * ADEVELOPMENT WALKTHROUGH PROF HROUMANI Dept of Electrical Engineering & Computer Science THE BMI CALCULATOR PROJECT THE PROCESS

THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 1

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

THEWALKTHROUGH

1.  THEPROCESS

2.  REQUIREMENT

3.  DESIGN4.  THEPROJECT

5.  THEVIEW

6.  THECONTROLLER

7.  THEMODEL

8.  TESTING9.  DEPLOYMENT

A.  THEMAKING*

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

THEPROCESS

Page 2: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 2

•  RequirementAnalysis

•  Design

•  ImplementaFon

•  TesFng

•  Deployment

REQUIREMENTS

DESIGN

IMPLEMENTATION

TESTING

DEPLOYMENT

Thewaterfallmodelcarriesrisks:•  Requirement-change,•  Architectural,and•  Assump3on.

Tomi[gate,•  Implementitera[vely,processwise.•  Incorporatefeaturesincrementally.

Page 3: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 3

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

REQUIREMENT

Page 4: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 4

OverallThePla]ormandtheUI.

InputMechanism,informa[ontype,valida[onrules.

OutputMechanism,informa[ontype,forma^ng.

§ Pla]ormMobile,Android(min=IceCream)

§ Input-Weight(kg)andHeight(m),bothreal-Twotextboxes,prompts,acomputebueon-Novalida[oninthisfirstrelease

§ Output-Theindexroundedto1decimal-Noforma^nginthisfirstrelease

Page 5: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 5

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

DESIGN

OverallAblueprintofhowthesoughtsystemworks.

ComplexityModernsogwaresystemsareverycomplex.Cannotbuildonefromscratchinonelife[me!

StrategyDivide;choreograph;orchestrate.

VIEW CONTROLLER MODEL

ComputeEngines

UIWidgets

LAYOUT ACTIVITY CLASS

XML JAVA JAVA

EventHandlers

LayoutManagers

StylesandThemes

DataAccess

Page 6: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 6

§ AlgorithmGiventheweightwinkgAndtheheighthinmBMI=w/h2

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

CREATING&ARCHIVING

THEPROJECT

CreateProjectname(nospaces).

StructureManifest,Java,andResources

Archiving-Zipthewholefolderorjustapp/src-SavetocloudoraUSBs[ck

Page 7: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 7

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

IMPLEMENTING

THEVIEW

TerminologyTextbox=EditTextLabel=TextView

KeyProper;esid,layout_width=match_parent

XMLEn[reviewrepresentedintext

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

IMPLEMENTING

THECONTROLLER

Page 8: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 8

V-to-CGlue-MethodthattakesaViewparameter-Thebueon'sonClickproperty

C-to-VGlue-findViewById(R.id….)-Casttopropertype-Surroundwithparentheses-Invoke.getText().toString()or.setText(…)

CreateanInstanceofthemodel-BMIModelmodel=newBMIModel(…);-Thisgivesusanobjectreferencemodel

Invokemethodsinthemodel-Stringanswer=model.getBMI();-C-to-M:viatheinvoca[on-M-to-C:viathereturn

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

IMPLEMENTING

THEMODEL

Page 9: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 9

AFributes(thestate)privatesome-typesome-name;

Constructor-publicclass-name(parameters)-Setthestate

Method-publicreturn-typesome-name(…)-Returnsomethingifnotvoid.

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

TESTING

ForVandC•  Physicaldevice•  Framework(e.g.Mokito)

ForM:•  psvm(input=Scanner,output=System.out)•  JUnit

TestCases:Needanoracle.Coverageisimportant.

Page 10: THE BMI CALCULATOR PROJECT THE WALKTHROUGHroumani/walkthrough/Walkthrough.pdf · Mobile, Android (min = Ice Cream) § Input - Weight (kg) and Height (m), both real - Two text boxes,

DevelopmentWalkthrough

ProfHRoumani 10

ADEVELOPMENTWALKTHROUGH

PROFHROUMANIDeptofElectricalEngineering&ComputerScience

THEBMICALCULATORPROJECT

DEPLOYMENT

1. Turndeviceon2. PluginUSBcable3. GrabdeviceinVBox4. Run(greenarrow)5. AllowindeviceNote:Aboveassumesdevicehasdeveloper'smodeon;USBdebuggingallowed;andVBoxacceptsthevendorin/etc/udev/rules.99/.