![Page 1: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/1.jpg)
1
COMP61511(Fall2017)SoftwareEngineeringConcepts
InPracticeWeek4
BijanParsia&ChristosKotselidis< , @manchester.ac.uk>
(bugreportswelcome!)bijan.parsia christos.kotselidis
![Page 4: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/4.jpg)
3.2
WhatIsConstruction?Adefinition:
Software construction is the creation, assembly, ormodification of executable programs typically viamodificationofthesourcecode.
![Page 5: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/5.jpg)
3.3
AbstractionHierarchyOfASystem
Nottheonlyformulationofsuchahierarchy!
![Page 6: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/6.jpg)
3.4
ArchitectureVs.Construction
![Page 7: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/7.jpg)
3.5
CodingAsProblemSolvingSoftwareengineeringisproblemsolving
Hence,thefoundationalnatureofproblemdefinitionWritingormodifyingcode
IsalsoaformofproblemsolvingWehopesmallerproblems.
Protip:Alwaysknowtheproblemyou'resolving!
![Page 8: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/8.jpg)
3.6
TheBigFour(PlusTwo)Fourprimaryactivities1. Creating
Weneedfunctionality2. Debugging
Weneedcorrectness3. Refactoring(lastweek!)
Weneedcomprehensibility4. Optimising
Weneedefficiency(wrttosomeresource)Plustwo
Testing&Reading
![Page 9: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/9.jpg)
3.7
TestingIsEverywhereAllprimaryactivitiesinvolvetesting
WhetherformalorinformalE.g.,Creation(whethertestfirstornot)
![Page 10: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/10.jpg)
3.8
ReadingIsEverywhereReadingcodeisakeyskill
Otherpeople'scodethatyouareusingthatyouaremodifying
Yourowncode!whetherusingormodifying
"Reading"(understanding)systemsisakeyskillGraspingtheproblem,requirements,architectureRelatingcodetothose
![Page 11: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/11.jpg)
3.9
10 lines of code = 10 issues.
500 lines of code = "looks fine."
Code reviews.10:58 AM - Nov 5, 2013
106 8,033 4,409
I Am Devloper @iamdevloper
Follow
Reviews
![Page 13: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/13.jpg)
4.2
WhatIs(Code)Creation?Code creation (or coding) is the addition of newfunctionality by the generation of new code and units ofcode
Keyactivity!Oftendirectlymeasured
ProductivityasLOC/day(Though,deletingcodemightbebetter!)
DoesnothavetobeexnihiloCut-paste-modifyreusecountsReusecounts!
![Page 14: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/14.jpg)
4.3
PrerequisitesRememberthe !
What'syouroverallproblemdefinitionWhatpartareyoutackling
WhatarethepertinentrequirementsUnderstandthearchitecture
AndhowyourcurrentcodefitsinKnowthelocalstandards
E.g.,codeformattingstyle
prerequisites
![Page 15: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/15.jpg)
4.4
ArchitectureAgoodarchitectureshould:1. helpyoudeterminewhereyourcodeshouldgo2. constrainhowfunctionalityisdivvyedup3. determineyourcommunicationchannels4. giveyouasenseofthingsfittingtogether
thatissharedCode-Architectureconflictsindicate
AproblemwithoneortheotherAlimit
![Page 16: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/16.jpg)
4.5
TechnologyChoicesDifferenttechnologychoicesaffectcode
LanguageMono-vs.poly-glotTypingregime"Batteries"Mindshareetc.
Frameworks,libraries,OSs,etc.
![Page 17: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/17.jpg)
4.6
ToolsDevelopmentenvironments
EditorsIDEsSourcecontrol
DynamictoolsCompilersDebuggers&TestersProfilers
StatictoolsLint,syntax,stylecheckersetc.
![Page 18: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/18.jpg)
4.7
AwarenessesSituationalAwareness
YourperceptionofthecurrentpertinentfactorsfordecisionmakingGoodsituationalawareness
Tracksallpertinentfactorstotherightdegreeinamannertodriveappropraitereactionsatlowcost
DrivestacticsandthusactionUnderstanding
YoursystematicgraspofallfactorsrelatedtodecisionmakingResultsfromsensemakingMorecognitive(indirectlydrivesaction)
![Page 19: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/19.jpg)
4.8
GettingInTheZoneGivenaproblem,oursolvingcanbe
focusedwehavetightsituationalawarenessthe"situation"istheproblemandsolutionspacewereactratherthanact
unfocusedourawarenessisscattered
distracted/multitaskingdisengagedconfused
The"zone"isamuchhigherproductivitystate
![Page 20: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/20.jpg)
4.9
AdminRecord-keepingisextremelyhelpful
Andsometimesrequired,e.g.,billablehoursTrackinghelps!(alotcanbeautomated)
TimeEffort(andsenseofeffort)Whatwasdone(andwhy,bywhome)MoodDiscussionsanddecisions
Someisbetterthannone;enoughisbetterstill;thereistoomuch
![Page 21: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/21.jpg)
4.10
ProgrammerCredosThree Virtues
AccordingtoLarryWall(1),theoriginalauthorofthePerlprogramminglanguage,therearethreegreatvirtuesofaprogrammer;Laziness,ImpatienceandHubris
1. Laziness: The quality that makes you go to great effortto reduce overall energy expenditure. It makes you writelabor-saving programs that other people will find usefuland document what you wrote so you don't have toanswer so many questions about it.
2. Impatience: The anger you feel when the computer isbeing lazy. This makes you write programs that don'tjust react to your needs, but actually anticipate them. Orat least pretend to.
3. Hubris: The quality that makes you write (andmaintain) programs that other people won't want to saybad things about.
(1)Quotedfrom"ProgrammingPerl",2ndEdition,O'Reilly&Associates,1996
![Page 22: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/22.jpg)
5.1
Debugging
—GraceHopper'sBugReport
![Page 23: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/23.jpg)
5.2
DefectsAgainRecall:
A defect in a software system is a quality level (for somequality)thatisnotacceptable.
Wefocuson defectsprimarily
ThoughrobustnessisalsokeyMorestability,i.e.,doesn'tcrash
functionalCorrectness
![Page 24: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/24.jpg)
5.3
WhatIsDebugging?Debugging is the modification of code to remove (ormitigate)correctnessdefects.
Wedon'tcountmissingfunctionalitydefectsDebuggingstartsafterapurporteddetection
Input:aresultoftestingorabugreportWeallowmitigation
NotproperlyfixingthebugButenoughsoit'slessdamagingMuststillinvolvecodemodification
Otherworkaroundsdon'tcount!
![Page 25: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/25.jpg)
5.4
FunctionalLandscape(Enhanced)
![Page 26: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/26.jpg)
5.5
DebugCycleInput:Anindicationofadefect
Stabilise—MakereliabilyrepeatableIsolate(orlocalise)—TothesmallestunitExplain—What'swrongwiththecodeRepair—ReplacethebrokencodeTest—Verifythefix
CheckforRegressionsMaskedbugsNearbybugs
![Page 27: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/27.jpg)
5.6
IndicationAnindicationofadefectisatangiblerecordofabehaviourcontrarytothe(explicitorimplicit)functionalspecificationinadesignatedsituation.
Keyparts:Situation
Preferably,sufficientlydescribedforreplicationExpectedBehaviourWitnessedBehaviour
Typicallywithsomeexplanationwhyit'swrongOftenveryvague
![Page 28: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/28.jpg)
5.7
Indication?Oftenveryvague
Programcrashedsometimeduringthistest
Actually,onlyon !OpenOfficeonUbuntuwon'tprint
Tuesdays
FromJohnRegehr," "ClassicBugReports
![Page 29: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/29.jpg)
5.8
StabiliseBugsareoftenverysituationdependent
Preciseinput+stateOS,hardwareSequenceofactionsLengthofoperating
Astabilsedbugisreliablyrepeatablepreferrablywithminimalsufficientconditions
![Page 30: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/30.jpg)
5.9
Isolate(Localise)Bugsareoftenverylocal
SingleLOCSingleroutineParticularclass
Theydon'thavetobe!Communicationpointsarevulnerable
Adefectisisolatedifyouhaveidentifiedtheminimumsubsystemnecessarytoexhibitthedefectforantriggerinputandsitutation
![Page 31: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/31.jpg)
5.10
Explain&RepairExplainingthebug
YoucanarticulatethemechanismofthebugYourbugtheory
YoucanmanipulatethebugTriggeroravoiditProducevariantsPredictitsbehaviourFixit
RepairingthebugModifyingthecodesothedefectiseliminatedMaynotbepossible!
![Page 32: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/32.jpg)
5.11
TestPostfix
YouneedtoverifyYourtheoryYour*executionofthefix
YouneedtoguardagainstUnintendedconsequences!
"New"bugsariseBugsinthefix
ThefixisincompleteThefixtriggersaregression
Maskedbugs
![Page 33: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/33.jpg)
5.12
CheckNearbyBugscomeinfamilies
SimilarmistakesYoudiditonce,youmighthavedoneittwicePersistentmisunderstandingwithmultiplemanifestations
ClusteredmistakesSomebugshidden
AcrashconcealsmuchSomeroutinesarebroken
Lotsofdebt!Abugisapredictorofmorebugs!
![Page 34: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/34.jpg)
5.13
BugReportsToWONTFIXSometimes,afixisn'tgoingtohappen
ThebugistoosmallOrinsignificantOrambiguous
ThebugistoobigItwouldchangetoomuchbehavior
WhichsomepeoplerelyonOtherdebtincreasestherisk
Thebutistoohard
![Page 36: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/36.jpg)
6.2
ResourcesSize
RunningspaceAtalllevesl
PersistenceandtransmissionCode
TimeResponsevs.thourghput
Instantvs.OverallWall/CPUTime/Instructions
![Page 37: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/37.jpg)
6.3
WhatIsOptimisation?Optmisiationisatransformationofcodeintosufficientlyfunctionally equivalent code that has "better" resourceutilisation.
"Sufficientlyfunctionallyequivalent"Userobservable/desirablebehaviourispreservedUptosomepointItmaybespecialisedtoacertainparticularscenario
ResourceutilisationTypeandPatternmustbespecified
![Page 38: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/38.jpg)
6.4
Where?
![Page 39: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/39.jpg)
6.5
TuningTrade-OffsTimeforSpace(andthereverse)PerformanceforReadability(andthereverse)
AndothercomprehensionqualitiesNotalwaysatradeoffforalgorithmicimprovements
OrfatremovalPerformanceforCorrectnessPerformanceforCost
![Page 40: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/40.jpg)
6.6
TuningAlternativesBuyMoreandFasterHardwareUsetheOptimiserBettercompilers/frameworks/librariesInputmanipulation
"It'sslowwhenIdothis""Don'tdothat!"
![Page 41: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/41.jpg)
6.7
TuningSafetyTuningisrisky
Evenoptimisationcanberisky!It'seasytomakecodefast
BymakingitincorrectIt'seasytomodifythecodealot
AndnotimproveperformancemuchOrmakeworse
![Page 42: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/42.jpg)
6.8
TuningAs(Performance)DebuggingInput:Anindicationofaperformancedefect
Stabilise—MakereliabilyrepeatableIsolate(orlocalise)—Tothesmallestunit
USEAPROFILER!TESTCASESARECRITICALExplain—What'swrongwiththecode
Repair—Replacethe"slow"codeTest—Verifytheimprovements
CheckforSufficiency(Wasthatenough?)Trade-offs(e.g.,spaceconsumption)(Correctness)Bugs
![Page 44: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/44.jpg)
8.1
Boehm'sEvidence
FollowingslidesderivedfromMakingSoftware,Chapter10
![Page 45: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/45.jpg)
8.2
ReadingPapersThesepapersarechallenging!
EvenmassagedabitforthepractitionerLotsoftechnicaljargonandtechniquesSummarizingavastliteratureChallengingstatsandpresentations
Don'tpanic!ThesearereadandrereadFirstreadingshouldfocusonkeypointsLaterreadingsshouldfocusontheevidence
![Page 46: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/46.jpg)
8.3
TheRoleOfArchitectureKeychallenge(Boehm,MakingSoftware,Chp10)
Howmuchshouldyouinvestinarchitecture?Analogytobuilding
Wepaythearchitect10%ofthecostofabuildingWeshouldspend10%oftheprojectbudgetonarchitecture
Isthisenough?Howwouldweknow?
Note:statisticallygeneralconclusionsmaynotapplyinyourcase!
![Page 47: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/47.jpg)
8.4
Bohem'sResearchQuestions:"Byhowmuchshouldyouexpectthecostof
makingchangesorfixingdefectstoincreaseasafunctionofprojecttimeorproductsize?"
"Howmuchshouldyouinvestinearlyarchitectingandevidence-basedprojectreviewsbeforeproceedingintoproductdevelopment?"
![Page 48: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/48.jpg)
8.5
EconomiesCommoditymanufacturingexhibitseconomiesofscale
Making1chipmaybemuchmoreexpensivethan1000Theunitcostdiminishesasthenumberofunitsincreases
Softwareend-unitcostsare(canbe)zeroCheaptomakeacopy!
Installation&configurationmaynotbeSofocusonlinesofcodeorbitsoffunctionality
SoftwareexhibitsdiseconomiesofscaleTheunitcostrisesasthenumberofunitsincreases
Potentiallyexponential!Pgs166-167esp.useful
![Page 49: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/49.jpg)
8.6
CostRatiosWhat'stheratioofcosttofixearlyvs.late?
1970s1inrequirementsto≈100postdelivery
19811:100forlargecodebases
But1:5forsmall(2,000-5,000LOC)1996survey
(70-125):12000s
Someevidenceofreductionfrom1:100to1:20Orevenflat(for1millionlinecodebase)
![Page 50: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/50.jpg)
8.7
CostRatios(ForCoursework!)What'stheratioofcosttofixearlyvs.late?
Thinkofyourcoursework!Beforedeployment(akasubmission)
SmallfixesarecheapEsp.inthecurrencyofthecourse,i.e.,points
Afterdeployment(akasubmission)Even"small"fixesareexpensive(orimpossible)
Courseworkbuildsoverthesemester!Soproblemscanbuildup
![Page 51: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/51.jpg)
8.8
TwoStrategiesAvoidlatebugsMakefixinglatebugscheaperFailuretodobothkillstheproject
FailuretodoonemaybemitigatedbytheotherAllouractivitiesshouldaimforthis
Thuswewantarchitecturesthatprecludesomebugsconfinetheeffectsofallbugs
![Page 52: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/52.jpg)
8.9
TwoArchitectureBreakers(Pg376)"20%ofthedefectsaccountfor80%ofthecosts"
"these20%are...duetoinadequatearchitecture..."Twosortsofcosts
DirectcostsOpportunitycosts
TwoexamplebigfailurestheOSarchitecturedidn'tsupportfail-overwhenprocessorsfailed
lackedakeyfunctionalityassumingallmessagesareshort
thusborkingon1millioncharactermessages
![Page 53: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/53.jpg)
8.10
TradeOffsMoreupfrontarch
Costs!Runsriskofoverruns
SincelesstimeforeverythingelsePotentially,gettingarchright
Reducesreworktime
Note,changingrequirementscankillgettingitright
![Page 54: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/54.jpg)
8.11
SweetSpots
![Page 55: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/55.jpg)
8.12
Summary(Pg403)"...thegreatertheproject'ssize,criticality,andstability,the greater the need for validated architecture feasibilityevidence.
"veryverysmalllow-criticalityprojectswithhighvolatility,thearchitectingeffortsmakelittledifference"
Note:Thereareothercostdrivers;checktheassumptions!
![Page 57: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/57.jpg)
9.2
MargaretHamilton
NexttotheApolloprojectnavigationsoftwarecode
![Page 58: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/58.jpg)
9.3
AbstractDataTypes(1)Adatatypeis
asetofvalueswithassociatedoperations
Anabstractdatatypeisadatatypecharacterisedentirelybytheoperations
independentofimplementationdetailsAconcretedatatype(orimplementationofanADT)is
arepresentationofasetofvalueswithparticularimplementationsoftheoperations
![Page 59: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/59.jpg)
9.4
ADTExample:Lists
![Page 60: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/60.jpg)
9.5
ADTExample:IntegersIntegers
AbstractValues:All(orfinatesubsetsof)integersOperations:+,-,*,/,<,=,>
Concrete(representation)32bit2s-complementor64bit2s-complementorarraysorfloats(Javascript)or
![Page 61: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/61.jpg)
9.6
ADTExample:DatabasesCRUD
Create-Read-Update-DeleteVeryabstract!
SomeMappings(from ):Operation SQL HTTP DDSCreate / writeRead(Retrieve) read/takeUpdate(Modify) / writeDelete(Destroy) dispose
Wikipedia
INSERT PUT POSTSELECT GETUPDATE PUT PATCHDELETE DELETE
![Page 62: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/62.jpg)
9.7
WhyADTs?Separateinterfaceandimplementation
TheclientonlyneedstothinkabouttheinterfaceUptoapoint!Abstractionsleak
SimplerandclearerFocusesonthesemanticsofthetype
Tellsyouthecriticalfunctionality
![Page 63: COMP61511 (Fall 2017) Software Engineering Concepts In ...syllabus.cs.manchester.ac.uk/pgt/2017/COMP61511/... · We allow mitigation Not properly fixing the bug ... Some routines](https://reader035.vdocument.in/reader035/viewer/2022071218/60525c45f99c6e572a5f4fe0/html5/thumbnails/63.jpg)
9.8
UnitsOfCreationA code unit is a syntactically complete(able) chunk of aprogramthatenactssomebehavior.
LineofCodeBlockorcontrolstructureRoutines/procedures/functions/methods/operationsClasses/modulesPackages/modules
Individualroutinesandclassesarewhatgetunittested