Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document...

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

Transcript of Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document...

Page 1: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Founda'onsofSo,wareEngineering

Lecture6–Requirements(3/3)ClaireLeGoues

1

Page 2: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

REFLECTIONSONREFLECTIONS

ExamplesadaptedarbitrarilyfromprioryearswithoutidenCfyinginformaCon!

Page 3: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Reflec'ondocuments

Shallow•  Recitefactsaboutwhat

happenedwithoutaddinganything.

•  RecitestatementsfromclasswithoutconnecCngtoexperience.

•  Statelessonslearnedwithoutanyreasonwhy.

Good•  Extrapolatefromthefactstoaddinsight.

•  Meaningfullyconnectpriorexperienceorclassmaterialtoassignmentexperience.

•  Supportlessonslearnedwithevidence.

Page 4: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Also

•  Thehomeworkdocumentincludesbulletedlistsandproseoutliningwhata“goodsoluCon”lookslike.•  Considercheckingyoursubmissionagainstit,attheveryleastbeforesubmiOng,ifnotsooner.

Page 5: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Learninggoals•  DifferenCatebetweenverificaConandvalidaCon.

•  ExplainthepurposeofrequirementsdecomposiCon,allocaCon,andflowdown.

•  IdenCfystrategiesfordealingwithconflicts.•  Understandriskanditsroleinrequirements,specificallyhowitcanbemodeled,analyzed,andthenmiCgated/handledinsystemdesign.

Page 6: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Verifica'onvs.Valida'on•  VerificaCon–isthesoXwarecorrect?– DoesthesoXwaresaCsfythespecificaCon?– IsthespecificaConcorrectwithrespecttotherequirements,assumingthedomainproperCeshold?

•  Valida'on–aretherequirementscorrect?– Aretherequirementscomplete?Dotheyaccuratelyreflecttheclient’sproblem?– Aretherequirementsconsistent?

Page 7: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Valida'on walkthroughsReadingInterviewsReviewsChecklistsModelstocheckfuncConsandrelaConshipsScenariosPrototypesSimulaConFormalinspecCon

Verifica'on Cross-referencingSimulaConConsistencychecksCompletenesschecksChecksforunreachablestatesortransiCons(cf.Modelchecking)MathemaCcalproofs

Page 8: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Requirementsshouldbe1.  Correct2.  Consistent3.  Unambiguous4.  Complete5.  Feasible6.  Relevant7.  Testable8.  Traceable

8

Accordingtoboththeengineerandthecustomer

InthattherearenoconflicCngrequirements.Qualityrequirements

areparCcularlydangerous.Ambiguous:mulCplereaderscanwalkawaywithdifferentbutvalid

interpretaCons.Coversallrequiredbehaviorandoutputforallinputsunderall

constraints.Canitbedoneatall?Again,quality/non-funcConalreqsareparCcularly

vulnerable.

Acceptancetestsandmetricsarepossible/obvious.

Organized,uniquelylabeled.

Page 9: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

ManagingInconsistency

•  Informal–recognizingwhentworequirementsarenotmutuallysaCsfiable

•  HeurisCc–employingsystemaCc,manualtechniquestosurfaceconflicts

•  Formal–usingformalmodelstoexpressandreasonaboutpotenCalconflicts

Page 10: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Gainingcoherence•  IdenCfyactors:users,othersystems

–  Primaryusers,support,administraCon–  Externalhardware,soXwaresystems

•  IdenCfyscenarios–  DetailednarraCvescenariosoftypicalfuncConality–  Concreteexamples

•  Canbethebasisfortestcases•  CanbeabasisforcommunicaConwithstakeholders/users

•  IdenCfyusecases–  Representmorecompletepicturesofthesystemincontext–  AbstracConofallcases,derivedfromparCcularscenarios

•  Analyzeandrefineusecases–  ConsiderexcepCons,errors,securityissues–  Addressothernon-funcConalrequirements

•  Relateusecases–  Createaconsolidateduse-casemodel

10

Page 11: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Decomposi'on

Stakeholderrequirements

System

System

SubsystemA SubsystemB SubsystemC

Ini'aldecomposi'on

High-levelplan

Page 12: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Why?

•  DecomposiConintoahierarchyhelpsestablishtraceability,whichidenCfiesrelaConshipsbetweenrequirements.•  Defini&on?•  Traceabilityisimportantforwhenrequirementschange.•  DecomposiConalsohelpsbothvalidateandverifytherequirements.

Page 13: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Alloca'onandflowdown

•  Grouping(e.g.,bybusinessfuncCon)enablesanalysis

•  AllocaConistheassignmentofrequirementstosubordinatesystems

•  FlowdownisthediscoveryofaddiConalrequirementsfromtheallocatedrequirements

Page 14: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Groupbybusinessfunc'onBusinessfuncConsprovidelogicalgroupsforusecases

•  MarkeCng

•  HumanResources

•  ProducCon•  Sales•  DistribuCon

HiringandRecruitmentBenefitsPerformanceReviewsPromoConReCrement

ShippingReceivingInventory

Page 15: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Groupbysuperordinatesystem•  Superordinatesystemscutacrosssubordinatesystems,suchasbusinessfuncCons

AdverCseproduct

Buildsystem

Receiveorder

Scheduledelivery

MarkeCng ProducCon Sales DistribuCon

AsuperordinatesystemthattracesaproductfrommarkeCngtodistribuCon.Theanalystcannowfocusondevelopingtheinterfaces

betweentheseusecases

Page 16: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Alloca'onandflowdown

Superordinateusecase Subordinatesystems

AllocateusecasestosubordinatesystemsFlowdowndiscovers“derivedrequirements”tofulfillthe

allocatedrequirements

Superordinateusecases

candriveflowdown

Page 17: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Alloca'onandflowdown

Receiveorder

Sales

Checkinventory

Processpayment

DistribuCon

Processorder

Superordinateusecase Subordinatesystems

AllocateusecasestosubordinatesystemsFlowdowndiscovers“derivedrequirements”tofulfillthe

allocatedrequirements

Scheduledelivery

Beforeweprocessapayment,weshould…

Page 18: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Pre-andpost-condi'ons•  Pre-condiCons:truebeforetheusecasebegins•  Post-condiCons:trueattheendoftheusecase•  Shouldbewrijenatthesame“levelofdetail”astheusecase

•  Applytothestateofthesystem,nottheenvironmentoutsidethesystem[Armour&Miller]– Thebookhasastatusofborrowed– Thepatronisfreetoleavethelibrarywiththebook

18

Page 19: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

DependencyStreams

•  Dependencystreamsdescribeusecasesthatdependoneachother

– Matchingpre-andpost-condiCons

– PerformingacConsinparallel

– HighlightinterfacesbetweenbusinessfuncCons

Page 20: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Matching pre- and post-conditions

20

Selectproduct

Purchaseorder

Post-condition: Customer has selected products

Pre-condition: Customer is ready to check out

Page 21: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Tracingscenariosthroughcases

Receiveorder

Processpayment

Scheduledelivery

Placeorder

Assump'on:deliveryoccursovertheweekend

Assump'on:productsareallinstock

Assump'on:orderingisautomatedintheevening

Stuplaceshisorder…

Thisscenariocutsacrossbusinessfunc&onstotest

theinterfacesbetweenusecases

Checkinventory

Thisisaderivedrequirement

Page 22: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Modifyingusecasesforscenarios

Scheduledelivery

Assump'on:deliveryoccursovertheweekend

Placeorder

Stuplaceshisorder…

Receiveorder

Processpayment

Confirmorder

NoCfydelay

Assump'on:productsareallinstock

Checkinventory

<<extends>>

Page 23: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Logicalconflicts

• Whenshouldthetraindoorsbeopen?– ThetraindoorsremainclosedbetweenstaCons

– Thetraindoorsremainopenduringemergencies

– Thetraindoorsremainclosedwhilethetrainismoving

Page 24: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Terminologyconflicts•  StudentsshallhaveaccesstolibraryfaciliCes

•  Whatisastudent?– Astudentisenrolledinacoursepastthedropdate– Astudentisenrolledinadegreeprogram– Analumnusoralumnashouldhavelibraryaccess

•  Howdowereconcilethesedifferences?

Page 25: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Whydoconflictsarise?•  Differentactorsformulategoals–  Limitedborrowingperiods(staff)– Borrowingforaslongasneeded(patrons)

•  Goalboundariesarevague– DoorsremainclosedbetweenstaCons– DoorsopenwhentrainstopsandevacuaConalarm

•  TwosoXgoalsprescribeanincreaseanddecreaseinthesamequanCty

Page 26: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Strongversusweakconflicts•  Strongconflictscannotbereconciled– RetaincreditcarddataforeasierfuturetransacCons– DonotretaincreditcarddataaXercompleCngatransacCon

•  Weakconflictscanbereconciled– ThetraindoorsremainclosedbetweenstaCons– Thetraindoorsremainopenduringemergencies– Thetraindoorsremainclosedwhilethetrainismoving

Page 27: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Goalconflicts

•  Conflictsarisebetweengoalsatdifferentlevelsinthegoalhierarchy

“Lightningbolt”Indicatesaconflict

AvoidVoterIDCapture

RegisteredVoterVerified

MaintainSecretBallots

MaintainTrustedElecCons

VoterIDCaptured

Page 28: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Weakeninggoalstoresolveconflicts

AvoidVoterIDCapture

VoterIDCaptured

AvoidVoterIDLinking

AvoidVoterIDTransfer

MaintainSecretBallots

RegisteredVoterVerified

Page 29: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Transfertheconflictoutside

AvoidVoterIDCapture

RegisteredVoterVerified

VoterIDCaptured

VoCngMachine StaConAjendant

VoterIDVerified

MaintainSecretBallots

Page 30: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Priori'zingUseCases•  AssigningaprioritytoausecasetoincreaseordecreasetheacCvity’simportance.

•  WhataresomeopCons?– Customerpriority– Risk– Complexity– Dependencies– CorefuncConality– User-facingacCviCes– Uncertainty(sameasrisk?)

30

Page 31: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Prioritize by risk •  AriskisanuncertainfactorthatmayresultinalossofsaCsfacConofacorrespondingobjecCve

Forexample…

–  SystemdeliversaradiaConoverdosetopaCents(Therac-25,Theratron-780)

– MedicaConadministraConrecord(MAR)knockout

– PremierElecConSoluConsvote-dropping“glitch”

31

Page 32: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Riskanalysisinsafety-cri'calsystems•  Safetyrequirementsarenotderivedfromstakeholders.• Whynot?

Page 33: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

TheSwisscheesemodelRegulatorynarrowness

Incompleteprocedures

Mixedmessages

ProducConpressures

ResponsibilityshiXing

Inadequatetraining

AjenCondistracCons

Deferredmaintenance

Clumsytechnology

InsCtuConalOrganizaCon

Profession&Team

Individual Technical

ModifiedfromReason,1999,byR.I.Crook

Page 34: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Howtoassessthelevelofrisk?

•  RisksconsistofmulCpleparts:– Likelihoodoffailure– NegaCveconsequencesorimpactoffailure– Causalagentandweakness(inadvancedmodels)

•  Risk=LikelihoodxImpact

Page 35: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Likelihoodvs.ImpactSeverity

50%

20%

70%

4

9

3

012345678910

0%

10%

20%

30%

40%

50%

60%

70%

80%

Risk#1 Risk#2 Risk#3

Severityoffa

ilure

Likelih

oodoffa

ilure

Likelihood Impact

Page 36: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

CVSSV2.10ScoringTheCommonVulnerabilityScoringSystemconsistsof:

–  6basemetrics(accessvector,complexity,confidenCalityimpact,…)–  3temporalmetrics(exploitability,remediaCon,…)–  5environmentalmetrics;allqualitaCveraCngs(collateraldamage,…)

BaseScore=round_to_1_decimal(((0.6*Impact)+(0.4*Exploitability)–1.5)*f(Impact))

Impact=10.41*(1-(1-ConfImpact)*(1-IntegImpact)*(1-AvailImpact))

Exploitability=20*AccessVector*AccessComplexity*AuthenCcaCon

f(impact)=0ifImpact=0,1.176otherwise

Page 37: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Avia'onfailureimpactcategories•  Noeffect–failurehasnoimpactonsafety,aircraXoperaCon,orcrew

workload

•  Minor–failureisnoCceable,causingpassengerinconvenienceorflightplanchange

•  Major–failureissignificant,causingpassengerdiscomfortandslightworkloadincrease

•  Hazardous–highworkload,seriousorfatalinjuries

•  Catastrophic–lossofcriCcalfuncContosafelyflyandland

DO-178b,SoXwareConsideraConsinAirborneSystemsandEquipmentCerCficaCon,RTCA,1992

Page 38: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Faulttreeanalysis

•  Top-downanalysistechniquetomodel,reasonabout,andanalyzerisk.•  DecomposeaparCculartypeoffailureintoconsCtuentpotenCalcausesandprobabiliCes.•  DefinescopeofsystemresponsibiliCes,idenCfyunacceptableriskcondiConsthatshouldbemiCgated.

Page 39: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Top-levelorintermediateevent

Undevelopedevent

Basicevent

Orgate

Andgate

Transfergate

Page 40: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Faulttreestoquan'fyriskDooropenswhiletrainmoving

SoXwarecontrollerfails

Dooractuatorfails

Speedometerfails

Passengerforcesdoors

open

Wrongrequirements

WrongassumpCon

WrongspecificaCon

WrongimplementaCon

Trainismoving OR

OR

AND

Page 41: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Riskmi'ga'on/responsestrategies

•  Accepttherisk–forlowlikelihoodorlowimpactrisks,orwherecostofmiCgaConprecludessystem

•  Transfertherisk–pushtheriskoutsidethesystemboundary

•  MiCgatetherisk–introduceacCvecountermeasures–  Reducelikelihoodoffailure–  Reduceseverityofimpact–  Changeorstoands!

•  Avoidtherisk–redesignsothatriskcannotoccur

Page 42: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Exercise!

•  Unacceptablesystemfailure:agivenCMUstudentfailsamidterm.

Page 43: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Top-levelorintermediateevent

Undevelopedevent

Basicevent

Orgate

Andgate

Transfergate

Page 44: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Wrap-up:day1•  ExplainwithexamplestheimportanceofrequirementsinsoXwareengineering.

•  ExplainhowandwhyrequirementsarCculatetherelaConshipbetweenadesiredsystemanditsenvironment.

•  DisCnguishbetweenandgiveexamplesof:funcConalandnon-funcConalrequirements;informalstatementsandverifiablerequirements.

•  IdenCfysystemstakeholdersanddevelopapproachesonhowtointerviewthem.

44

Page 45: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Wrap-up:day2

•  Developusecases.•  UnderstandthechallengesofinternaConalizaConinthecontextofthechallengesofrequirementselicitaCon.

45

Page 46: Founda’ons of Soware Engineeringckaestne/15313/2016/07-20-sep...Also • The homework document includes bulleted lists and prose outlining what a “good soluon” looks like. •

Wrap-up:day3•  DifferenCatebetweenverificaConandvalidaCon.

•  ExplainthepurposeofrequirementsdecomposiCon,allocaCon,andflowdown.

•  IdenCfystrategiesfordealingwithconflicts.•  Understandriskanditsroleinrequirements,specificallyhowitcanbemodeled,analyzed,andthenmiCgated/handledinsystemdesign.