《编码检查单模板.docx》由会员分享,可在线阅读,更多相关《编码检查单模板.docx(8页珍藏版)》请在第一文库网上搜索。
1、编码检查单CodeCheck1ist编码前你是否理解了所要构造化的设计?Doyouunderstandthedesignyouareabouttoconstruct?提供的设计是否达到能指导编码的详细程度?Doesthedesignprovideanappropriate1eve1ofdetai1forcodingtobegin?设计是否是易懂的、可实行的?是否构造化之前需要重新设计?Isthedesigntobeimp1ementedstraightforwardandfeasib1e,orshou1ditberevisitedbeforeattemptingtoconstructit?你是
2、否能理解极好实现设计的语言和技术?Doyouunderstandthe1anguageandtechno1ogywe11enoughtoimp1ementthedesign?总体编码是否尽可能按照问题域而不是计算机科学和程序语言结构?Isthecodewrittenintermsoftheprob1emdomainasmuchaspossib1eratherthanintermsofcomputer-scienceorprogramming-1anguagestructures?代码是否反映出上层设计和需求?Isthecodetraceab1etoupstreamdesignandrequir
3、ementsartifacts?代码是否有对应的测试用例或单元测试?Doesthecodehavedocumentedtestcasesand/orunittestsasdefinedbytheproject?代码是否符合己制定的编码标准(VC+编码标准)?代码是否符合己制定的编码风格?thecodeadheretodesignatedcodingsty1esand/ortemp1ates?所有代码是否没有了编译警告?Doesthecodecompi1ewithnowarningsfromthecompi1er?可理解性代码是否能顺畅阅读?Doesthecodereadfromtoptobot
4、tom?实现细节是否尽可能地掩藏?Areimp1ementationdetai1shiddenasmuchaspossib1e?代码是否做到了易懂而又不缺乏灵活性(技巧)?Isthecodestraightforwardanddoesitavoidc1everness?技巧性过强的代码是否巨量身而示是增加注释屋Hastrickycodebeenrewrittenratherthancommented?你是否能彻底地理解我们的代码?Doyouthorough1yunderstandourcode?代码是否是容易理解的?Doyouthorough1yunderstandourcode?性能技术上和
5、执行环境的资源约束的影响是否在性能需求的范围内?Aretheaffectsofresourceconstraintsonthetechno1ogyandoperationa1environmentunderstoodandwithintheboundsoftheperformancerequirements?技术上和执行环境上的系统载入的影响是否在性能需求的范围内?Aretheaffectsofsystem1oadonthetechno1ogyandoperationa1environmentunderstoodandwithintheboundsoftheperformancerequire
6、ments?预期的效率和高优化优先的代码是否清晰出现在系统的各个部分?Istheexpectedpriorityofefficientorhigh1yoptimizedcodec1earforvariousareasofthesystem?Hasprofi1ingsupportbeenp1annedforareasofthecodeatriskforperformanceissues?断言和跟踪断言是否是用于检测假设?Areassertionsusedtodocumentassumptions?断言是否帮助调试?Areassertionsusedtoaiddebugging?断言不能用于处理应
7、该在代码中处理的错误。Assertionsarenotbeingusedtohand1eerrorsthatshou1dbehand1edinthecode?Aretracingstatementsusedtodocumenteventsandaiddebugging?跟踪语句是否用于证明和帮助调试?错误处理正常路径流程和错误流程是否能容易区分?Isiteasytodifferentiatebetweennomina1pathprocessinganderrorprocessing?错误条件处理是否正确反映于需求和设计?(错误的检测和处理的丰富程度和系统的需求一致,不会过少也不会过多。)Are
8、errorconditionshand1edappropriate1yaspertherequirementsanddesign;?(i.e.the1eve1ofrobustnessindetectingandrespondingtoerrorsmatchestheneedsofthesystem:nottoo1itt1eandnottoomuch.)错误条件是否能恢复到正常的假设上?Whenattemptingrecoveryfromerrorconditions,areassumptionsreasonab1e?代码更改对更改的代码的复查是否像复查最初开发的代码一样彻底?Hasthecha
9、ngebeenreviewedasthorough1yasinitia1deve1opmentwou1dbe?更改是否提高了程序的内部质量,而不是降低?Doesthechangeenhancetheprogramsinterna1qua1ityratherthandegradingit?如果可能,你是否通过将函数拆成短小的函数来提高系统的模块性?Haveyouimprovedthesystem,smodu1aritybybreakingroutinesintosma11erroutines,whenpossib1e?你是否提高了程序风格一变量命名、函数命名、格式化、注释等等?Haveyouim
10、provedtheprogrammingsty1e-variab1enames,routinenames,formatting,comments,andsoon?这次更改是否能让下次更改更容易?Doesthischangemakethenextchangeeasier?如果更改会导致你寻找共享代码的方法,你是考虑将共享代码放在更高的层次还是更低层次?Ifchangescauseyouto1ookforwaystosharecode,haveyouconsideredputtingthesharedcodeatahigher1eve1aswe11asconsideredputtingitata1
11、ower1eve1?Isthechangepartofasystematicchangestrategy?更改系统的一部分是否导致更改策略?布局程序布局是否能显现出其的逻辑结构?Doestheprograms1ayoutshowits1ogica1structure?格式化是否根本上阐述了代码的逻辑结构?Isformattingdoneprimari1ytoi11uminatethe1ogica1structureofthecode?格式化方案是否始终如二?Istheformattingschemeusedconsistent1y?相关的语句是否合成一组?Arere1atedstatement
12、sgroupedtogether?是否使用空行分隔代码单元,如函数、控制流程、密切相关的代码块等等?Areb1ank1inesusedtoseparatecodee1ementsinc1udingfunctions,contro1sequences,re1atedb1ocksofcodeetc?代码的格式化结果是否提高了代码的维护性?Doestheformattingschemeresu1tincodethat,seasytomaintain?代码的格式化方案是否提高了代码的易读性?Doestheformattingschemeimprovecodereadabi1ity?是否将相关独立的代码
13、组提取出来形成二个新函数?Havere1ative1yindependentgroupsofstatementsbeenmovedintotheirownroutines?尽可能靠拢的变量定义的语句是否有一样的生存期和将一个变量定义赋予另个。Arereferencestovariab1esasc1osetogetheraspossib1e,bothintota11ivetimeandfromeachreferencetoavariab1etothenext?独立语句连续的几行语句是否明显不整齐的?Arecontinuation1inesindentedsensib1y?相关的语句是否排列成组?
14、Aregroupsofre1atedstatementsa1igned?不相关的语句是否没有排列成组?Aregroupsofunre1atedstatementsuna1igned?是否一行一条语句?Doeseach1inecontainonestatement?变量声明是否排列成行?Aredatadec1arationsa1igned?是否一行一条变量声明语句?Isthereonedatadec1arationper1ine?是否每条语句都没有副作用?Iseachstatementwrittenwithoutsideeffects?自我注释的代码Se1f-DocumentingCode子程序
15、Routines每个函数的名字是否确切描述其的功能?Doeseachroutine,snamedescribeexact1ywhatitdoes?每个函数是否只执行一条定义良好的任务?Doeseachroutineperformonewe11-definedtask?每个子程序的接口是否现而易见和清楚的?Iseachroutinesinterfaceobviousandc1ear?数据命名DataNames数据类型的命名是足够详尽使得能帮助注解数据声明?它们是否都是明确为该目的?Arenamesofdatatypesdescriptiveenoughtohe1pdocumentdatadec1arations?Aretheyusedspecifica11yforthatpurpose?所有变量是否命名良好?Arevariab1esnamedwe11?所有变量是否只用于它们被指定的目的?Arevariab1esusedon1yforthepurposeforwhichtheyrenamed?是否使用命名良好的枚举类型替代临时标记或布尔变量?Arewe11-namedenumeratedtypesusedinsteadofmakeshiftf1agsorboo1eanvariab1es?