软件工程实践者的研究方法答案.docx
《软件工程实践者的研究方法答案.docx》由会员分享,可在线阅读,更多相关《软件工程实践者的研究方法答案.docx(12页珍藏版)》请在冰豆网上搜索。
![软件工程实践者的研究方法答案.docx](https://file1.bdocx.com/fileroot1/2023-2/1/023028f9-a7b7-40ff-bbba-3835cc1d9f1d/023028f9-a7b7-40ff-bbba-3835cc1d9f1d1.gif)
软件工程实践者的研究方法答案
软件工程实践者的研究方法答案
【篇一:
外文翻译--《软件工程-实践者的研究方法》】
areengineering-apractitioner’sapproachwrittenbyrogers.pressman,ph.d.(p.340-p.343)
13.3designprinciples
softwaredesignisbothaprocessandamodel.thedesignprocessisasequenceofstepsthatenablethedesignertodescribeallaspectsofthesoftwaretobebuilt.itisimportanttonote,however,thatthedesignprocessisnotsimplyacookbook.creativeskill,pastexperience,asenseofwhatmakes“good”software,andanoverallcommitmenttoqualityarecriticalsuccessfactorsforacompetentdesign.thedesignmodelistheequivalentofanarchitect’splansforahouse.itbeginsbyrepresentingthetotalityofthethingtobebuilt(e.g.,athree-dimensionalrenderingofthehouse)andslowlyrefinesthethingtoprovideguidanceforconstructingeachdetail(e.g.,theplumbinglayout).similarly,thedesignmodelthatiscreatedforsoftwareprovidesavarietyofdifferentviewsofthecomputersoftware.
basicdesignprinciplesenablethesoftwareengineertonavigatethedesignprocess.davissuggestsasetofprinciplesforsoftwaredesign,whichhavebeenadaptedandextendedinthefollowinglist:
?
thedesignprocessshouldnotsufferfrom“tunnelvision.”agooddesignershouldconsideralternativeapproaches,judgingeachbasedontherequirementsofthetheresourcesavailabletodothejob,andthedesignconceptspresentedinsection?
thedesignshouldbetraceabletotheanalysismodel.becauseasingleelementofthedesignmodeloftentracestomultiplerequirements,itisnecessarytohaveameansfortrackinghowrequirementshavebeensatisfiedbythedesignmodel.
?
thedesignshouldnotreinventthewheel.systemsareconstructedusingasetofdesignpatterns,manyofwhichhavelikelybeenencounteredbefore.thesepatternsshouldalwaysbechosenasanalternativetoreinvention.timeisshortandresourcesarelimited!
designtimeshouldbeinvestediepresentingtrulynewideasandintegratingthosepatternsthatalreadyexist.
?
thedesignshould“minimizetheintellectualdistance”
betweenthesoftwareandtheproblemasitexistsintherealworld.thatis,thestructureofthesoftwaredesignshould(wheneverpossible)mimicthestructureoftheproblemdomain.
?
thedesignshouldexhibituniformityandintegration.adesignisuniformifitappearsthatonepersondevelopedtheentirething.rulesofstyleandformatshouldbedefinedforadesignteambeforedesignworkbegins.adesignisintegratedifcareistakenindefininginterfacesbetweendesigncomponents.
?
thedesignshouldbestructuredtoaccommodatechange.thedesignconceptsdiscussedinthenextsectionenableadesigntoachievethisprinciple.
?
thedesignshouldbestructuredtodegradegently,evenwhenaberrantdata,events,oroperatingconditionsareencountered.welldesignedsoftwareshouldnever“bomb.”itshouldbedesignedtoaccommodateunusualcircumstances,andifitmustterminateprocessing,dosoinagracefulmanner.
?
designisnotcoding,codingisnotdesign.evenwhendetailedproceduraldesignsarecreatedforprogramcomponents,thelevelofabstractionofthedesignmodelishigherthansourcecode.theonlydesigndecisionsmadeatthecodingleveladdressthesmallimplementationdetailsthatenabletheproceduraldesigntobecoded.
?
thedesignshouldbeassessedforqualityasitisbeingcreated,notafterthefact.
avarietyofdesignconcepts(section13.4)anddesignmeasures(chapters19and24)areavailabletoassistthedesignerinassessingquality.
?
thedesignshouldbereviewedtominimizeconceptual(semantic)errors.thereissometimesatendencytofocusonminutiaewhenthedesignisreviewed,missingtheforestforthetrees.adesignteamshouldensurethatmajorconceptualelementsofthedesign(omissions,ambiguity,inconsistency)havebeenaddressedbeforeworryingaboutthesyntaxofthedesignmodel.
whenthesedesignprinciplesareproperlyapplied,thesoftwareengineercreatesadesignthatexhibitsbothexternalandinternalqualityfactors.externalqualityfactorsarethosepropertiesofthesoftwarethatcanbereadilyobservedbyusers(e.g.,speed,reliability,correctness,usability).internalqualityfactorsareofimportancetosoftwareengineers.theyleadtoahigh-qualitydesignfromthetechnicalperspective.toachieveinternalqualityfactors,thedesignermustunderstandbasicdesignconcepts.
13.4designconcepts
asetoffundamentalsoftwaredesignconceptshasevolvedoverthepastfourdecades.althoughthedegreeofinterestineachconcepthasvariedovertheyears,eachhasstoodthetestoftime.eachprovidesthesoftwaredesignerwithafoundationfromwhichmoresophisticateddesignmethodscanbeapplied.eachhelpsthesoftwareengineertoanswerthefollowingquestions:
?
whatcriteriacanbeusedtopartitionsoftwareintoindividualcomponents?
?
howisfunctionordatastructuredetailseparatedfromaconceptualrepresentationofthesoftware?
?
whatuniformcriteriadefinethetechnicalqualityofasoftwaredesign?
m.a.jacksononcesaid:
thebeginningofwisdomfora[softwareengineer]istorecognizethedifferencebetweengettingaprogramtowork,andgettingitright.fundamentalsoftwaredesignconceptsprovidethenecessaryframeworkforgettingitright.
13.4.1abstraction
whenweconsideramodularsolutiontoanyproblem,manylevelsofabstractioncanbeposed.atthehighestlevelofabstraction,asolutionisstatedinbroadtermsusingthelanguageoftheproblemenvironment.atlowerlevelsofabstraction,amoreproceduralorientationistaken.problem-orientedterminologyiscoupledwithimplementation-orientedterminologyinanefforttostateasolution.finally,atthelowestlevelofabstraction,thesolutionisstatedinamannerthatcanbedirectlyimplemented.wassermanprovidesausefuldefinition:
thepsychologicalnotionofabstractionpermitsonetoconcentrateonaproblematsomelevelofgeneralizationwithoutregardtoirrelevantlowleveldetails;useofabstractionalsopermitsonetoworkwithconceptsandtermsthatarefamiliarintheproblemenvironmentwithouthavingtotransformthemtoanunfamiliarstructure...
eachstepinthesoftwareprocessisarefinementinthelevelofabstractionofthesoftwaresolution.duringsystemengineering,softwareisallocatedasanelementofacomputer-basedsystem.duringsoftwarerequirementsanalysis,thesoftwaresolutionisstatedintermsthatarefamiliarintheproblemenvironment.aswemovethroughthedesignprocess,thelevelofabstractionisreduced.finally,thelowestlevelofabstractionisreachedwhensourcecodeisgenerated.
aswemovethroughdifferentlevelsofabstraction,weworktocreateproceduralanddataabstractions.aproceduralabstractionisanamedsequenceofinstructionsthathasaspecificandlimitedfunction.anexampleofaproceduralabstractionwould
bethewordopenforadoor.openimpliesalongsequenceofproceduralsteps(e.g.,walktothedoor,reachoutandgraspknob,turnknobandpulldoor,stepawayfrommovingdoor,etc.).
adataabstractionisanamedcollectionofdatathatdescribesadataobject
chapter12).inthecontextoftheproceduralabstractionopen,wecandefineadataabstractioncalleddoor.likeanydataobject,thedataabstractionfordoorwouldencompassasetofattributesthatdescribethedoor(e.g.,doortype,swingdirection,peningmechanism,weight,dimensions).itfollowsthattheproceduralabstractionopenwouldmakeuseofinformationcontainedintheattributesofthedataabstractiondoor.
manymodernprogramminglanguagesprovidemechanismsforcreatingabstractdatatypes.forexample,theadapackageisaprogramminglanguagemechanismthatprovidessupportforbothdataandproceduralabstraction.theoriginalabstractdatatypeisusedasatemplateorgenericdatastructurefromwhichotherdatastructurescanbeinstantiated.
controlabstractionisthethirdformofabstractionusedinsoftwaredesign.likeproceduralanddataabstraction,controlabstractionimpliesaprogramcontrolmechanismwithoutspecifyinginternaldetails.anexampleofacontrolabstractionisthesynchronizationsemaphoreusedtocoordinateactivitiesinanoperatingsystem.theconceptofthecontrolabstractionisdiscussedbrieflyinchapter14.
13.4.2refinement
stepwiserefinementisatop-downdesignstrategyoriginallyproposedbyniklauswirth.aprogramisdevelopedbysuccessivelyrefininglevelsofproceduraldetail.ahierarchyisdevelopedbydecomposingamacroscopicstatementoffunction(aproceduralabstraction)inastepwisefashionuntilprogramminglanguagestatementsarereached.anoverviewoftheconceptisprovidedbywirth:
ineachstep(oftherefinement),oneorseveralinstructionsofthegivenprogramaredecomposedintomoredetailedinstructions.thissuccessivedecompositionorrefinementofspecificationsterminateswhenallinstructionsareexpressedintermsofanyunderlyingcomputerorprogramminglanguage...astasksarerefined,sothedatamayhavetoberefined,decomposed,orstructured,anditisnaturaltorefinetheprogramandthedataspecificationsinparallel.
everyrefinementstepimpliessomedesigndecisions.itisimportantthat...theprogrammerbeawareoftheunderlyingcriteria(fordesigndecisions)andoftheexistenceofalternativesolutions...
refinementisactuallyaprocessofelaboration.webeginwithastatementof
function(ordescriptionofinformation)thatisdefinedatahighlevelofabstraction.thatis,thestatementdescribesfunctionorinformationconceptuallybutprovidesnoinformationabouttheinternalworkingsofthefunctionortheinternalstructureoftheinformation.refinementcausesthedesignertoelaborateon