Peer Personal Code Review results
I. GENERAL INSPECTION
1, the code can run normally, the basic can realize the predetermined function, there is no big logic error.
2, the code structure is very clear, the module is done very well, very good use of object-oriented programming ideas, easy to read and understand.
3, the string matching can be used in the library function of the regular expression, of course, when the string is longer, the regular expression stack overflow, or inefficient.
4. No redundant debug code appears.
5, Code Style comparison specification, indentation, line wrapping, variable naming are subject to general conventions.
Second, security check
1, the input data format is not valid, some times can not be correctly identified.
2, when the command line parameters do not match, throws an exception, to avoid the program crashes.
Iii. Documentation and annotations
1. There is no help document, but there is a brief comment.
2, through the communication with the program author, you can learn the function of each piece of code.
Iv. Testing
1, has the Code test module.
2, the test cases are small, can not cover many extreme situations, code coverage is not high.
V. Known Bugs found
1.
Public Static BOOL operator >(number A, number B) { if (a < b) return false ; Else return true ; }
The conditions in this paragraph are wrong and should be changed to (a < B | | A = = b)
2, can not generate the shape (1 + 2) * (3 + 4) = Such a formula, the problem is not a coding error, but at the level of the algorithm design to proactively circumvent such a situation. The author's intention is to make the suffix expression of a formula, and then convert it to infix expression, the author used a variable t to record the current priority, once the priority reached the two-level priority, the author will no longer generate the + and-symbols, so some legitimate case authors can not be generated. Therefore, it is possible that the extreme situation is that due to the abandonment of certain circumstances, it is impossible to generate enough non-repetitive formulas based on the parameters completely.
3, the author in order to avoid being removed by 0, the limit of all the number is positive, and the topic required to allow the generation of 0.
Vi. optimizations that can be made
New Number (); int tdown = A.down * B.down/ INTNUM.GCD (a.down,b.down); int t1 = b.down/ intnum.gcd (A.down, B.down); int t2 = A.DOWN/INTNUM.GCD (A.down, B.down);
In this section of the Code INTNUM.GCD (a.down,b.down) as a function of the return results, in the three calculation of the value is exactly the same, so you can use a temporary variable to store, avoid three call function, if the code is repeatedly executed, then the efficiency of the optimization will be greatly improved.
Vii. Summary
This program author code style and code logic is very standardized, programming ideas are also very clear, reflecting a higher level of programming, it is worth learning.
Peer Personal Code Review results