Twinning projects generate four arithmetic -java

First, the blog links

Twinning members blog links: 192401 Ban Chen Chuancheng

https://www.cnblogs.com/meethigher/

Two, GitHub link

RandomFormula:https://github.com/Chenchuancheng/RandomFormula

Third, code review

192 401 classes Chen Zhuancheng code review table

Code review Review Form
Summary section Code in line with the needs and specifications it? meets the
If the code thoughtful design? Yes
How to code readability? Easy to understand, straightforward words such as
Code is easy to maintain it? Not easy
Each line of code execution and examine it, huh? , The compiler 0 errors, 0 warnings
Design Specification It is designed to comply with known design patterns or items commonly used mode? No, the class implements a single function
There are no hard-coded or strings / numbers, etc. exist? No, method or variable values ​​are obtained by
There is no code that depends on a certain platform, whether it will affect the future of transplantation? As long as there is java environment, run everywhere
Developers write new code to be able to use the existing Library / SDK / Framework in functions to achieve? Whether there is a similar function in this project can call without having to re-implement all? Have. Yes
There are no unused code can be cleared? No, already had a streamlined
Code Specification Modify the code in line with standard parts and style? Variable naming method is hump nomenclature. Programming style is used in Kernighan style
DETAILED code portion There is no error processing? For external function call, check the return value or exception handling? Have. Yes
Parameter passing for errors, length of the string is the length of the byte or character, is zero or 1 count start counting? No error. Length is the length of the string of characters, to start counting 0
How boundary conditions are treated? How default branch switch statement is processed? Is it possible to loop an infinite loop? Boundary conditions, say bottom of the stack, in order to prevent the bottom of the stack is empty, an error in the bottom of the stack stores a #.
There is no use assertion (Assert) to ensure that we really believe that the same conditions are met? Buyer No
Use of resources, is where to apply, where to release? Whether there may be a resource leak? There is no room for optimization? ooxxooxx
There are no less than the data structure elements with? There, stored in the bottom of the stack #
efficacy How the code performance? The worst case is what? The worst time complexity T = O (n)
Code, especially if a significant portion of the cycle can be optimized No
Whether for system and network of call time out? How to deal with? No, useless to call the system or network
readability How to code readability? Is there enough comments? Straightforward and easy to understand such words. Comments than actual code
Testability If the code needs to be updated or create a new unit test? Do not need

192,401 class Shen Jiadong code review table

Code review Review Form
Summary section Code in line with the needs and specifications it? meets the
If the code thoughtful design? Yes
How to code readability? Good readability
Code is easy to maintain it? easily
Each line of code execution and examine it, huh? , The compiler 0 errors, 0 warnings
Design Specification It is designed to comply with known design patterns or items commonly used mode? No
There are no hard-coded or strings / numbers, etc. exist? No, method or variable values ​​are obtained by
There is no code that depends on a certain platform, whether it will affect the future of transplantation? As long as there is java environment, run everywhere
Developers write new code to be able to use the existing Library / SDK / Framework in functions to achieve? Whether there is a similar function in this project can call without having to re-implement all? Have. Yes
There are no unused code can be cleared? No
Code Specification Modify the code in line with standard parts and style? Variable naming method is hump nomenclature. Programming style is used in Kernighan style
DETAILED code portion There is no error processing? For external function call, check the return value or exception handling? Have. Yes
Parameter passing for errors, length of the string is the length of the byte or character, is zero or 1 count start counting? No error. Length is the length of the string of characters, to start counting 0
How boundary conditions are treated? How default branch switch statement is processed? Is it possible to loop an infinite loop? Cycle is not dead
There is no use assertion (Assert) to ensure that we really believe that the same conditions are met? Buyer No
Use of resources, is where to apply, where to release? Whether there may be a resource leak? There is no room for optimization? ooxxooxx
There are no less than the data structure elements with? No
efficacy How the code performance? The worst case is what? The worst time complexity T = O (n)
Code, especially if a significant portion of the cycle can be optimized No
Whether for system and network of call time out? How to deal with? No, useless to call the system or network
readability How to code readability? Is there enough comments? Readability is good, there is
Testability If the code needs to be updated or create a new unit test? Do not need

Four, pair programming

1. Basic coding specification

  1. Code name can not begin or end with a special character (such as an underscore, $ # symbol).
  2. 代码中的命名严禁使用拼音与英文混合的方式,更不允许直接使用中文的方式。
  3. 类名使用UpperCamelCase风格,必须遵从驼峰形式。
  4. 方法名、参数名、成员变量、局部变量都统一使用lowerCamelCase风格,必须遵从驼峰形式。
  5. 常量命名全部大写,单词间用下划线隔开,力求语义表达完整清楚,不要嫌名字长。
  6. 抽象类命名使用Abstract或Base开头;异常类命名使用Exception结尾;测试类命名以它要测试的类的名称开始,以Test结尾。

2. 结对编程的感受

  • 一个人编写代码,总是有种灯下黑的现象。可能你自己犯的很微小的错误,你花了大把大把的时间,还是搞不出来。而另一个人只需要看一下就能指出,这提高了复审效率。
  • 可以不断从别人那里学习,提高自己的水平。这次结对编程,我们互相学到了很多,比如良好的代码风格,清晰的编码思路,以及熟练的调试技巧等
  • 通过两个人的讨论,更好的解决问题等。

3. 结对场景照片

左陈传诚 右申佳栋

五、实现新增需求

增加的需求:

  1. 考虑数据异常处理问题,如在输入题目生成范围的数据时,输入了“abc“等字符数据,程序如何处理。
  2. 增大算式生成数的范围(如整数存不下的数),程序如何处理。

对于1,2两个需求,如果不满足输入的条件,捕获异常之后,重新进行输入。

Guess you like

Origin www.cnblogs.com/matrixjd/p/11728004.html