任务说明:
一、结对,找到一个伙伴进行结对;(在作业中标注自己的伙伴博客链接)
伙伴陈振业博客地址:http://www.cnblogs.com/ChenZhenYe1215/p/8576211.html
二、各自对自己的伙伴上周进行的“单元测试”练习所完成的代码进行复审,形成“代码复审检查表”。
代码复审核查表 |
||
概要部分 |
代码符合需求和规格说明么? |
基本符合 |
代码设计是否考虑周全? |
代码设计基本考虑周全,但是身份证的前六位号码未进行检验 |
|
代码可读性如何? |
良好 |
|
有冗余的或重复的代码吗? |
无 |
|
代码的每一行都执行并检查过了吗? |
已检查过,不存在问题 |
|
设计规范部分 |
设计是否遵从已知的设计模式或项目中常用的模式? |
遵从 |
有没有硬编码或字符串/数字等存在? |
无硬编码的存在,存在字符串和数字 |
|
代码有没有依赖于某一平台? |
不依赖 |
|
有没有无用的代码可以清除? |
无 |
|
代码规范部分 |
修改的部分符合代码标准和风格么? |
基本符合 |
具体代码部分 |
数据结构中有没有用不到的元素? |
无 |
对于调用的外部函数,是否检查了返回值 |
无调用的外部函数 |
|
效能 |
代码的效能如何? |
良好 |
循环中是否有明显可优化的部分? |
无 |
|
可读性 |
代码可读性如何?有没有足够的注释? |
代码可读性不错,也有基本的注释 |
可测试性 |
是否需要更新或创建新的单元测试 |
需要 |
代码复审感想:小伙伴的代码简单易懂,也有适当的注释,在复审小伙伴的代码的过程中,也能提升自己的代码阅读理解能力,也能通过他的代码及错误来发现自身代码的不足及错误。例如:我的代码没有做好注释,而且有点冗长,判断力度不够等等。通过代码的审查,不仅是为了学习小伙伴的思维优点,还是对自身代码规范的一个重要提升。