Founda’ons of Soware Engineering

53
Founda’ons of So,ware Engineering Lecture 5 – Requirements (1/3) Claire Le Goues 1

Transcript of Founda’ons of Soware Engineering

Page 1: Founda’ons of Soware Engineering

Founda'onsofSo,wareEngineering

Lecture5–Requirements(1/3)ClaireLeGoues

1

Page 2: Founda’ons of Soware Engineering

Administrivia

•  CanvasOK?– VsPiazza?

2

Page 3: Founda’ons of Soware Engineering

Learninggoals•  ExplainwithexamplestheimportanceofrequirementsinsoHwareengineering.

•  ExplainhowandwhyrequirementsarMculatetherelaMonshipbetweenadesiredsystemanditsenvironment.

•  DisMnguishbetweenandgiveexamplesof:funcMonalandnon-funcMonalrequirements;informalstatementsandverifiablerequirements.

•  IdenMfysystemstakeholdersanddevelopapproachesonhowtointerviewthem.

3

Page 4: Founda’ons of Soware Engineering

Healthcare.gov

4

Page 5: Founda’ons of Soware Engineering

FredBrooks,onrequirements.•  Thehardestsinglepartofbuildingaso3waresystemisdecidingpreciselywhattobuild.

•  Nootherpartoftheconceptualworkisasdifficultasestablishingthedetailedtechnicalrequirements...

•  Nootherpartoftheworksocripplestheresul=ngsystemifdonewrong.

•  Nootherpartisasdifficulttorec=fylater. —FredBrooks

5

Page 6: Founda’ons of Soware Engineering

Aproblemthatstandsthetestof'me…A1994surveyof8000projectsat350companiesfound:31%ofprojectscanceledbeforecompleted;9%ofprojectsdeliveredonMme,withinbudgetinlargecompanies,16%insmallcompanies.

–  Similarresultsreportedsince.Causes:

1. Incompleterequirements(13.1%)2. Lackofuserinvolvement(12.4%)3. Lackofresources(10.6%)4. UnrealisMcexpectaMons(9.9%)5. LackofexecuMvesupport(9.3%)6. ChangingrequirementsandspecificaMons(8.7%)7. Lackofplanning(8.1%)8. Systemnolongerneeded(7.5%).

6

Page 7: Founda’ons of Soware Engineering

Overlysimplifieddefini'on.

Requirementssaywhatthesystemwilldo(andnothowitwilldoit).

7

Page 8: Founda’ons of Soware Engineering

WHYISTHISHARD?

8

Page 9: Founda’ons of Soware Engineering

Communica'onproblem

Goal:figureoutwhatshouldbebuilt.Expressthoseideassothatthecorrectthingisbuilt.

9

Page 10: Founda’ons of Soware Engineering

FourKindsofDenial•  Denialbypriorknowledge–wehavedonethisbefore,soweknowwhatisrequired

•  Denialbyhacking–ourfascinaMonwithmachinesdominatesourfocusonthehow

•  DenialbyabstracMon–wepursueelegantmodelswhichobscure,removeordownplaytherealworld

•  Denialbyvagueness–imply(vaguely)thatmachinedescripMonsareactuallythoseoftheworld

MichaelJackson,“TheWorldandtheMachine,”Interna=onalConferenceonSo3wareEngineering,pp.283-292,1995.

Page 11: Founda’ons of Soware Engineering

Lesssimplifieddefini'on.•  Stories:ScenariosandUseCases

“AHerthecustomersubmitsthepurchaseinformaMonandthepaymenthasbeenreceived,theorderisfulfilledandshippedtothecustomer’sshippingaddress.”

•  OptaMvestatementsThesystemshallnoMfyclientsabouttheirshippingstatus

•  DomainProperMesandAssumpMonsEveryproducthasauniqueproductcodePaymentswillbereceivedaHerauthorizaMon

11

Page 12: Founda’ons of Soware Engineering

Whatisrequirementsengineering?

•  Knowledgeacquisi'on–howtocapturerelevantdetailaboutasystem?– Istheknowledgecompleteandconsistent?

•  Knowledgerepresenta'on–oncecaptured,howdoweexpressitmosteffecMvely?– Expressitforwhom?– Isitreceivedconsistentlybydifferentpeople?

•  YoumaysomeMmesseeadisMncMonbetweentherequirementsdefini=onandtherequirementsspecifica=on.

12

Page 13: Founda’ons of Soware Engineering

Func'onalRequirements•  Whatthemachineshoulddo–  Input– Output–  Interface– Responsetoevents

•  Criteria– Completeness:Allrequirementsaredocumented– Consistency:Noconflictsbetweenrequirements– Precision:Noambiguityinrequirements

13

Page 14: Founda’ons of Soware Engineering

Quality/Non-func'onalrequirements•  SpecifynotthefuncMonalityofthesystem,butthequalitywithwhichitdeliversthatfuncMonality.•  CanbemorecriMcalthanfuncMonalrequirements– CanworkaroundmissingfuncMonality– Low-qualitysystemmaybeunusable

•  Examples?

14

Page 15: Founda’ons of Soware Engineering

Here’sthething…•  Whoisgoingtoaskforaslow,inefficient,unmaintainablesystem?

•  Abeqerwaytothinkaboutqualityrequirementsisasdesigncriteriatohelpchoosebetweenalterna=veimplementa=ons.

•  QuesMonbecomes:towhatextentmustaproductsaMsfytheserequirementstobeacceptable?

15

Page 16: Founda’ons of Soware Engineering

Func'onalrequirementsandimplementa'onbias

Requirementssaywhatthesystemwilldo(andnothowitwilldoit).

16

Page 17: Founda’ons of Soware Engineering

EnvironmentandtheMachine

•  Thepilotshalldecreaseairspeedandlowerthelandinggearpriortodecisionheight

•  Theplaneshalllowerthewingflapsto30°forlanding

MachineDomainEnvironmentalDomain

RequirementsDomainKnowledge

ComputersSoHwarePrograms

SpecificaMons

PamelaZave&MichaelJackson,“FourDarkCornersofRequirementsEngineering,”ACMTransac=onsonSo3wareEngineeringandMethodology,6(1):1-30,1997.

17

Page 18: Founda’ons of Soware Engineering

18

Page 19: Founda’ons of Soware Engineering

Avoidingimplementa'onbias•  Requirementsdescribewhatisobservableatthe

environment-machineinterface.•  Indica=vemooddescribestheenvironment(as-is)•  Opta=vemoodtodescribetheenvironmentwiththe

machine(to-be).

Whatothermodelsoftheworlddomachinesmaintain?

Ac'onsofanATMcustomer:withdrawal-request(a,m)Proper'esoftheenvironment:balance(b,p)

Ac'onsofanATMmachine:withdrawal-payout(a,m)Proper'esofthemachine:

expected-balance(b,p)

19

Page 20: Founda’ons of Soware Engineering

Domainknowledge•  RefinementistheactoftranslaMngrequirementsintospecifica=ons(bridgingthegap!)

•  Requirements:desiredbehavior(effectontheenvironment)toberealizedbytheproposedsystem.

•  AssumpMonsordomainknowledge:exisMngbehaviorthatisunchangedbytheproposedsystem.–  CondiMonsunderwhichthesystemisguaranteedtooperatecorrectly.

–  Howtheenvironmentwillbehaveinresponsetothesystem’soutputs.

20

Page 21: Founda’ons of Soware Engineering

Assump'ons?

21

Page 22: Founda’ons of Soware Engineering

Assump'ons?

22

Page 23: Founda’ons of Soware Engineering

Grounding,or:Reality•  Able:Twoimportantbasictypesarestudentandcourse.ThereisalsoabinaryrelaMonenrolled.

•  Baker:Doonlystudentsenrollincourses?Idon’tthinkthat’strue.

•  Able:Butthat’swhatImeanbystudent!•  DesignaMon:themeaningofaprimiMve.– Willbeexplainedinformally,butshouldsMllbeprecise,recorded,andmaintained.

23

Page 24: Founda’ons of Soware Engineering

Designa'onsgroundformalspecifica'ons.•  SpecificaMonsarelogicalexpressionsofsharedacMonsattheinterfaceofthemachine

•  ThisincludeslinkingdomainproperMesandagentacMonsaspre-andpost-condiMons

∀s∀c(enrolled(s,c)⇒student(s)∧course(c))

Page 25: Founda’ons of Soware Engineering

Somegapsmustremain…•  UnsharedacMonscannotbeaccuratelyexpressedinthemachine– Peoplecanjumpovergates(enterwithoutunlocking)– Peoplecanstealormisplaceinventory

•  Futurerequirementsarealsonotdirectlyimplementable– Phonesystem:“AHeralldigitshavebeendialed,doring-back,busy-toneorerror-tone.”– …howdoyouknowtheuserisdonedialing?

25

Page 26: Founda’ons of Soware Engineering

Lu,hansaFlight2904-1•  TheAirbusA320-200airplane

hasasoHware-basedbrakingsystemthatconsistsof:–  Groundspoilers(wing

platesextendedtoreduceliH)

–  Reversethrusters–  Wheelbrakesonthemain

landinggear•  Toengagethebrakingsystem,

thewheelsoftheplanemustbeontheground.

26

IsthisasharedoranunsharedacMon/condiMon?

Page 27: Founda’ons of Soware Engineering

Lu,hansaFlight2904-2Therearetwo“onground”condiMons:1.  Eithershockabsorberbearsaloadof6300kgs2.  Bothwheelsturnat72knots(83mph)orfaster

•  GroundspoilersacMvateforcondiMons1or2•  ReversethrustacMvatesforcondiMon1onbothmainlandinggears

•  WheelbrakeacMvaMondependsupontherotaMongainandcondiMon2

27

Page 28: Founda’ons of Soware Engineering

Expressingqualityrequirements

•  Requirementsserveascontracts:theyshouldbetestable/falsifiable.

•  Informalgoal:ageneralintenMon,suchaseaseofuse.– MaysMllbehelpfultodevelopersastheyconveytheintenMonsofthesystemusers.

•  Verifiablenon-funcMonalrequirement:AstatementusingsomemeasurethatcanbeobjecMvelytested.

28

Page 29: Founda’ons of Soware Engineering

Examples•  Informalgoal:“thesystemshouldbeeasytousebyexperiencedcontrollers,andshouldbeorganizedsuchthatusererrorsareminimized.”

•  Verifiablenon-func'onalrequirement:“ExperiencedcontrollersshallbeabletouseallthesystemfuncMonsaHeratotaloftwohourstraining.AHerthistraining,theaveragenumberoferrorsmadebyexperiencedusersshallnotexceedtwoperday,onaverage.”

29

Page 30: Founda’ons of Soware Engineering

Webvideoscenario•  Youworkforacustom

soHwaredeveloperasarequirementsengineer.

•  Client’sstatedrequirement:“Wewanttosellvideosontheweb.”

•  Youmustnowengagetheclienttoelaboratethestatedrequirement–  Howwillyouproceed?–  Howshallweexpresswhatwelearn?

30

Page 31: Founda’ons of Soware Engineering

RequirementsmetricsProperty Measure

31

Page 32: Founda’ons of Soware Engineering

Webvideoscenario•  Youworkforacustom

soHwaredeveloperasarequirementsengineer.

•  Client’sstatedrequirement:“Wewanttosellvideosontheweb.”

•  Youmustnowengagetheclienttoelaboratethestatedrequirement–  Howwillyouproceed?–  Howshallweexpresswhat

welearn?•  Step1:talktotherelevant

stakeholders

32

Page 33: Founda’ons of Soware Engineering

Ques'on

• Whoisthesystemfor?•  Stakeholders:– Endusers– Systemadministrators– Engineersmaintainingthesystem– Businessmanagers– …whoelse?

33

Page 34: Founda’ons of Soware Engineering

Stakeholder

•  Anypersonorgroupwhowillbeaffectedbythesystem,directlyorindirectly.•  Stakeholdersmaydisagree.•  RequirementsprocessshouldtriggernegoMaMontoresolveconflicts.– (Wewillreturntoconflicts).

34

Page 35: Founda’ons of Soware Engineering

Definingactors/agents

•  AnactorisanenMtythatinteractswiththesystemforthepurposeofcompleMnganevent[Jacobson,1992].– Notasbroadasstakeholders.

•  Actorscanbeauser,anorganizaMon,adevice,oranexternalsystem.

35

SalesSpecialist

MarkeMng GPSReceiver

InventorySystem

Page 36: Founda’ons of Soware Engineering

Stakeholderanalysis:criteriaforiden'fyingrelevantstakeholders•  RelevantposiMonsintheorganizaMon•  EffecMveroleinmakingdecisionsaboutthesystem

•  LevelofdomainexperMse

•  Exposuretoperceivedproblems

•  Influenceinsystemacceptance

•  PersonalobjecMvesandconflictsofinterest36

Page 37: Founda’ons of Soware Engineering

CHALLENGES?

37

Page 38: Founda’ons of Soware Engineering

Stakeholders,aNASAexample

From HSI NAP 11893

Page 39: Founda’ons of Soware Engineering

Interviews•  Goal:understandfuncMonal

requirements,idenMfyandlearndomain-specificconcepts,prioriMzequalityaqributes.

•  EffecMveinterviewers:–  BeginconcretelywithspecificquesMons,

proposals,orworkingthroughaprototype.–  Areopen-mindedandwillingtoexplore

addiMonalissuesthatarisenaturally,butstayfocusedonthesystem.

•  Stories,scenarios,usecases(informal),hypothe'cals,examples.

•  Understand/contrastwithcurrentsystem(ifapplicable).

39

Page 40: Founda’ons of Soware Engineering

Interviewbenefitsvsdrawbacks

•  Strengths– Whatstakeholdersdo– Howtheyinteractwiththesystem– Challengeswithcurrentsystems

•  Weaknesses– Capturingdomainknowledge–  Familiarity– Technicalsubtlety– OrganizaMonalissues,suchaspoliMcs– Completeness

40

Page 41: Founda’ons of Soware Engineering

•  Yai:non-profit;mostemployeesinsocialworkfield•  CurrentlysellstrainingDVDsforcompaniesonissuesrelatedtoindividualswithdevelopmentaldisabiliMes.•  “Doyouknowhowwecansellcoursematerialsonline?”

41

Page 42: Founda’ons of Soware Engineering

•  Humans:beqeratrecognizingwhetherasoluMoniscorrectthansolvingtheproblemfromablankpage.

•  Mock-ups/prototypeshelpexploreuncertaintyintherequirements.– Validatethatwehavetherightrequirements.– Elicitrequirementsatthe“borders”ofthesystem.– AssertfeasibilityofsoluMonspace.– GetfeedbackonacandidatesoluMon.– AlsogoodforquesMonsaboutUI.

•  “I’llknowitwhenIseeit”ßscary.

42

Page 43: Founda’ons of Soware Engineering

High-vslow-fidelitymockups

43

Page 44: Founda’ons of Soware Engineering

Rapidprototyping

•  Throw-away:developedtolearnmoreaboutaproblem,notintendedforactualuse.

•  EvoluMonary:intendedtobeincorporatedintothefinalproduct.

44

Page 45: Founda’ons of Soware Engineering

Storyboardingandscenarios

45

Page 46: Founda’ons of Soware Engineering

Story

• Whotheplayersare• Whathappenstothem•  Howithappensthroughspecificepisode• Whythishappens• Whatifsuchandsuchaneventoccurs• Whatcouldgowrongasaconsequence

46

Page 47: Founda’ons of Soware Engineering

•  Storyboardsillustratescenarios:atypicalsequenceofinteracMonamongsystemcomponentsthatmeetsanimplicitobjecMve.–  Storyboardsexplicitlycoveratleastwho,what,andhow.

•  Differenttypes:–  PosiMvevsnegaMve(shouldandshouldnothappen)–  Normalvsabnormal

•  AspartofelicitaMon:–  Learnaboutcurrentorproposedsystembywalkingthroughreal-lifeorhypotheMcalsequences

–  CanaskspecificquesMons–  ElicittheunderlyingobjecMves,generalizeintomodelsofdesiredbehaviors.

–  IdenMfyandresolveconflicts•  Pluses:Concrete,supportnarraMvedescripMon•  Minuses:inherentlyparMal.

47

Page 48: Founda’ons of Soware Engineering

48

Page 49: Founda’ons of Soware Engineering

Scenarios•  QuesMonstoconsider

–  Whattasksdoestheactorperform?–  WhatinformaMonisaccessedandmodified,andwheredoesitcomefrom?

–  WhatareobligaMonsontheactortoinformthesystem?–  WhatareobligaMonsofthesystemtoinformtheactor?

•  HeurisMcs–  VerMcal–oneworked-outspecificscenario,tounderstandhowtoengagetheuser/stakeholder

–  Horizontal–mulMple,less-detailedscenarios,toassessscopeandcontext

–  Mock-ups–  AlternaMves–  Canbepassiveorac've.

Testcases

49

Page 50: Founda’ons of Soware Engineering

Wheredowefindscenarios?

•  ReflecMve– Elicitscenariosfromstakeholders– Analyzereportsandcasestudiesofsimilarsystems

•  ProspecMve–InstanMatetheusecase

Don’tonlyfocusontheposiMve–includefailures,too

50

Page 51: Founda’ons of Soware Engineering

Usecases•  Wetalkaboutmanytypes,atdifferentgranulariMes:–  Fullusecasemodel(whole-system,higher-level)–  “Agile”usecase:small,concretepiecesofsystemfuncMonalitytobeimplemented(someMmesconflatedwith“userstories”)

•  UsedatmulMplestages:–  RequirementselicitaMon(illustrated,validate,requirements;highlightconflicts,prioriMzerequirements,etc).

–  RequirementsdocumentaMon.–  Concretedesign:UMLdiagrams.

51

Page 52: Founda’ons of Soware Engineering

Usecases

•  Textstoriesofanactorusingasystemtomeetgoals.•  Usecasesarenotdiagrams,theyaretext.•  PrimarilyserveasfuncMonalrequirements(bycontrast/inconjuncMonwith“thesystemshall”statements.)

52

Page 53: Founda’ons of Soware Engineering

Learninggoals•  ExplainwithexamplestheimportanceofrequirementsinsoHwareengineering.

•  ExplainhowandwhyrequirementsarMculatetherelaMonshipbetweenadesiredsystemanditsenvironment.

•  DisMnguishbetweenandgiveexamplesof:funcMonalandnon-funcMonalrequirements;informalstatementsandverifiablerequirements.

•  IdenMfysystemstakeholdersanddevelopapproachesonhowtointerviewthem.

53