cs 520hconboy/class/2021spring/cs... · 2021. 3. 2. · cs 520 theory and prac2ce of so4ware...
TRANSCRIPT
CS520TheoryandPrac2ceofSo4wareEngineering
Spring2021
So#warerequirements
March2,2021
In-classexercise1:AdvancedusesofGit
• Due:WednesdayMarch3,2021,9AMEDT
• Submission:– Couldeitherworkcollabora2velyasagroup(onyourownvideocall)
– Alterna2vely,couldworkindividuallyandwriteupasashareddocument(e.g.,overemail,GoogleDrive)
2
Homework1:ThreeinaRowgameapp
• Due:ThisSaturdayMarch6,9PMEDT• Codereview:OOdesignprinciples,bestprogrammingprac2ces
• Architecture:MVC(Model-View-Controller)paRern
• Design:ObserverpaRern• Officehours:ThisThursdaya4erlecture,ThisFriday9:30–10AM
3
Today
• RequirementsEngineering• Specifica2on– Naturallanguage– FiniteStateAutomata(FSAs)– Specifica2onpaRerns
• Finalproject
4
RequirementsEngineering:Stakeholders
• “individualsandorganiza2onswhoareac2velyinvolvedintheproject,orwhoseinterestsmaybeposi2velyornega2velyaffectedasaresultofprojectexecu2onorsuccessfulprojectcomple2on”
5
[ProjectManagementIns1tute(PMI®),1996]
Example:ThreeinaRowgameapp(fromHomework1)
6
Example:ThreeinaRowgameapp(fromHomework1)
• Gameappplayers• Gameappcompany:Developers,uppermanagement,usersupport,beta(user)testers
• UIexperts:Humanfactors,HCI(Human-ComputerInterac2on)
• Appstorecompany:Developersupport,Accoun2ngdepartment
• Federalagencies:ADA(AmericanswithDisabili2esAct)
7
RequirementsEngineering:Whatisaso#warerequirementsspecificaPon?
• Documentstheassump2onsabout,featuresrequested,andbehaviorofagivenso4wareapplica2onexceptedbytheusers
• Definesasetofrequirementsthatmustbesa2sfiedbytheso4wareapplica2on
8
RequirementsEngineering:Twokeytypesofrequirements
• Non-funcPonalrequirement:Aqualityconstraintontheso4wareapplica2on– e.g.,extensibility,scalability,usability
• FuncPonalrequirement:Anintended(orunintended)behavioroftheso4wareapplica2on– e.g,TheThreeinaRowgamemustusetheMVCarchitecturepaRern.
9
NOTE)Thereareothertypesofrequirementstodescribeassump1ons,features,andusagescenarios(e.g.,UMLusecases).
RequirementsEngineering:Twokeytypesofrequirements
• Non-funcPonalrequirement:Aqualityconstraintontheso4wareapplica2on– e.g.,extensibility,scalability,usability
• FuncPonalrequirement:Anintended(orunintended)behavioroftheso4wareapplica2on– e.g,TheThreeinaRowgamemustusetheMVCarchitecturepaRern.
10
NOTE)Thereareothertypesofrequirementstodescribeassump1ons,features,andusagescenarios(e.g.,UMLusecases).
RequirementsEngineering:Phases
1. Elicita2on2. Specifica2on3. Analysis4. Management
11
Requirement Design Implementa2on
RequirementsEngineering:Phases
1. Elicita2on2. Specifica2on3. Analysis4. Management
12
Requirement Design Implementa2on
RequirementsEngineering:Phases
1. Elicita2on2. SpecificaPon3. Analysis4. Management
13
Requirement Design Implementa2on
Example:ThreeinaRowgameapp(fromHomework1)
• ApplytheMVC(Model-View-Controller)architecturepaRern
• FollowThreeinaRowgamerules
14
SpecificaPon:Naturallanguage
• Elicita2ono4enproducesrequirementswriReninnaturallanguage
• Sample:1. The‘ThreeinaRow’gameappmustusetheMVC
architecturepaRern.a. Theremustbeasinglegamemodel.b. Oncethenewgamemodeliscreated,thatmodelcanhaveits
statechanged.c. Ifthegamemodelhasastatechange,thenitsgameviewmust
beupdated.d. …
2. …15
SpecificaPon:Disadvantagesofnaturallanguage
• Naturallanguageiso4enambiguous• Suchambiguitycanleadtohumanmisunderstandings
• Theambiguityalsomeansverifica2on&valida2oncannotbecarriedoutbyapplyingautomatedtools,e.g.,– Tes2ng,modelchecking
16
SpecificaPon:Disadvantagesofnaturallanguage
• Naturallanguageiso4enambiguous• Suchambiguitycanleadtohumanmisunderstandings
• Theambiguityalsomeansverifica2on&valida2oncannotbecarriedoutbyapplyingautomatedtools,e.g.,– Tes2ng,modelchecking
17
ThereforemathemaPcalnotaPons(e.g.,finitestateautomata)arecommonlyusedbecausetheyarerigorouslydefined
SpecificaPon:Finitestateautomaton(FSA)
18
Eventsequenceoveranalphabet(meaningasetofevents)
Finitestateautomaton(FSA)
accept reject
or
FSA:Sample1a
19
1 2
viol
gameModelNew
Theremustbeasinglegamemodel.
gameModelNew
gameModelNew
FSA:Sample1a
20
1 2
gameModelNew
Theremustbeasinglegamemodel.
FSA:Sample1a
21
1 2
gameModelNew
Theremustbeasinglegamemodel.
Eventsequence:[gameModelNew,gameModelNew]
FSA:Sample1a
22
1 2
gameModelNew
Theremustbeasinglegamemodel.
Eventsequence:[gameModelNew,gameModelNew]
reject
FSA:Sample1a
23
Eventsequence:[gameModelNew]
1 2
gameModelNew
Theremustbeasinglegamemodel.
FSA:Sample1a
24
Eventsequence:[gameModelNew]
accept
1 2
gameModelNew
Theremustbeasinglegamemodel.
FSA:Sample1a
25
Eventsequence:[]
1 2
gameModelNew
Theremustbeasinglegamemodel.
FSA:Sample1a
26
Eventsequence:[]
1 2
gameModelNew
Theremustbeasinglegamemodel.
reject
FSA:Sample1b
27
1 3
gameModelNew gameModelStateChange
2
gameModelStateChange
FSA:Sample1b
28
1 3
gameModelNew gameModelStateChange
Someeventsequencesthatareaccepted(i.e.posi2veexamples)?
2
gameModelStateChange
FSA:Sample1b
29
1 3
gameModelNew gameModelStateChange
Someeventsequencesthatareaccepted(i.e.posi2veexamples)?[gameModelNew][gameModelNew,gameModelStateChange]
2
gameModelStateChange
FSA:Sample1b
30
1 3
gameModelNew gameModelStateChange
Othereventsequencesthatarerejected(i.e.nega2veexamples)?
2
gameModelStateChange
FSA:Sample1b
31
1 3
gameModelNew gameModelStateChange
Othereventsequencesthatarerejected(i.e.nega2veexamples)?[][gameModelStateChange][gameModelNew,gameModelNew]
2
gameModelStateChange
FSA:Sample1b
32
1 3
gameModelNew gameModelStateChange
Oncethenewgamemodeliscreated,thatmodelcanhaveitsstatechanged.
2
gameModelStateChange
FSA:FormaldefiniPonRepresentedasa5tuple:• E:Thealphabetasasetofevents• S:Thesetofstates• T:Thesetoftransi2onswhereeachtransi2onisadirectededgefromasourcestatesoneventetotargetstatet
• s0:Thestartstate• A:Thesetofaccep2ngstates
33
NOTE)Canbeautoma2callyconvertedtoaregularexpression
FSA:Disadvantages
• NaturallanguageisgenerallymoreaccessiblethanFSAs
• Handwri2ngFSAscanbeerrorproneand2meconsuming
34
FSA:Disadvantages
• NaturallanguageisgenerallymoreaccessiblethanFSAs
• Handwri2ngFSAscanbeerrorproneand2meconsuming
35
SpecificaPonpa[ernshavebeenidenPfiedofcommonlyoccurringintended(orunintended)behaviorsofso#wareapplicaPons
PropertyspecificaPonpa[ern:FormaldefiniPon
• Consistsofa:– Scopecapturespartsofthetracewherethebehaviormustbesa2sfied(e.g.,Global)
– Behaviorcapturesoccurrenceororderofevents/proposi2ons(e.g.,BoundedexistenceofgameModelNew)
• Providesmappingtovariouspropertyspecifica2onlanguages(e.g.,RegularExpressions,inthiscasegameModelNew)
36[hRps://maRhewbdwyer.github.io/psp/]
PropertyspecificaPonpa[ern:Scopes
37
PropertyspecificaPonpa[ern:Behaviors
38
Behavior
Occurrenceofevent/proposi2onA
Orderofevents/proposi2onsAandB (Chained)Response
(Chained)Precedence
Absence
Universality
(Bounded)Existence
PropertyspecificaPonpa[ern:Behaviors
39
Behavior
Occurrenceofevent/proposi2onA
Orderofevents/proposi2onsAandB (Chained)Response
(Chained)Precedence
Absence
Universality
(Bounded)Existence
40
PropertyspecificaPonpa[ern:PrecedencedescripPon
41
PropertyspecificaPonpa[ern:Precedenceregularexpressions
42
PropertyspecificaPonpa[ern:Precedenceregularexpressions
Propertypa[ernspecificaPon:Sample1b
43
1 3
gameModelNew gameModelStateChange
Oncethenewgamemodeliscreated,thatmodelcanhaveitsstatechanged.
2
gameModelStateChangeBehavior:gameModelNewmustprecedegameModelStateChangeScope:Globally
PropertyspecificaPonpa[erns:Disadvantages
• Use80/20rule– MayneedtohandwriteFSAs
• Don’tprovidesupportforreal-2meorprobabilis2cconstraints– Hasbeenextended[SeehRp://ps-paRerns.wikidot.com]
• Designedforexperts– CanbedifficultfornovicestoselectamongpaRernsandcustomizethem
44
PropertyspecificaPonpa[erns:Disadvantages
• Use80/20rule– MayneedtohandwriteFSAs
• Don’tprovidesupportforreal-2meorprobabilis2cconstraints– Hasbeenextended[SeehRp://ps-paRerns.wikidot.com]
• Designedforexperts– Canbedifficultfornovicestoselectamongpa[ernsandcustomizetheselectedpa[ern
45
PROPELtool:What?
• Buildsonthepropertyspecifica2onpaRernsspecifiedasfinitestateautomata
• ProvidesguidancetoselectamongthepaRernsandcustomizethatpaRern
46[hRp://laser.cs.umass.edu/tools/propel.shtml]
PROPELtool:Userinterface
47[AvailablefromhRp://laser.cs.umass.edu/release/]
Scope
Behavior
PROPELtool:DemonstraPon
Specifythefollowing:“Ifthegamemodelhasastatechangethenitsgameviewmustbeupdated”
48
PROPELtool:SampleFSA1c
49
Behavior:gameModelStateChangemusthaveresponsegameViewUpdateScope:Globally
PROPELtool:SampleDNL1c
50
Finalproject:GroupandtopicselecPon
• Formteamof4or5students• Selectoneofthefollowing4topics:
1. MSRminingchallenge:2020or20212. Replica2onstudy3. MLdevelopmenttoolkit4. EleNa:Eleva2on-basednaviga2on5. Proposedyourowngroupproject
• Due:ThursdayMarch4,20219:00PMEDThRps://people.cs.umass.edu/~hconboy/class/2021Spring/CS520/finalProject.pdf