2018 Spring OO second stage summary

Analysis of program structure based on metrics

fifth assignment

sixth assignment

The seventh homework

Analyze bugs in your program

When the java regular expression library is used for the first time, the document is not queried in detail. When the input string is too long, the regular expression library will burst the stack and throw an Error. And I only caught Exception in the outermost layer, which caused the program to crash.

No bug was found in the second assignment.

The third assignment misunderstood the INVALID format in the instruction book, because a format error caused all the illegal inputs of the public beta to hang up (10 test points), which is a little regrettable. Other bugs have not been found.

Analyze the strategies used by others to find bugs

The first homework found two other bugs. In the second homework, I found that someone else would crash the program ( however, he complained that my input was invalid, and the bug was deleted by the teaching assistant. I don't understand the instruction book "crash should not occur under any circumstances" and his README who higher priority ). The third homework found two bugs of others.

My strategy is mainly to read other people's code twice by myself first, generally I can find all the functional and boundary bugs after one read, and read it a second time just to be sure. At the same time, I will also create some random data, run my program with his program, and compare the results. However, this step is generally useless, and bugs are usually found when reading the code.

experience

For the first two assignments, I only spent about 1 hour on Tuesday night, which led to some deviations in the estimation of the difficulty of the third assignment, and I did not spend enough time to read the instruction book. Although the third job had no functional problems, it was a pity that 10 public beta points were hung up due to a format error.

Through three assignments, I have a deeper understanding of the object-oriented design method of java, and I am familiar with inheritance, interfaces, overloading, and overriding. Although this method of java sometimes feels a little cumbersome and does not have the fun feeling of writing C++, it is very helpful for many people to cooperate on a large project.

When writing an object-oriented program, we must design the overall level of the program, the inheritance relationship of the class, and the interface in advance, and also analyze the requirements and consider the extensibility.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325190296&siteId=291194637