Three derivative work thoughts

I, on the third derivative work

  The first three jobs is a derivation to the practiced hand from simple and easy to match the regular expression for the introduction, we are thinking to guide the transition from the face of the object-oriented process. JAVA learned not to contact with the students leave enough time to build object-oriented sense, and can work in conjunction with the three progressive learning theory.

  Three job consists of simple univariate polynomial derivation to add trigonometric functions, to the infinite nesting, both can use some thought the last job, they can be combined into inheritance and interfaces to the split factor expression can be a good show the role of objects and classes.

Second, program analysis

(A) analyzing the structure

  (1) First Job

    FIG class as follows:

    

    Complexity as follows:

    

    Coupling follows:

    

 

   Visible, my first job program still has a very serious problem faces the process, the main part of the program in the main function, although the Pattern and Matcher, also abandoned the traditional array, clarified the thinking, but for the two methods use but not good, serious repeat-create the wheel. ,

 

  (2) a second operation

     FIG class as follows:

     

    Complexity as follows:

     

    Coupling follows:

     

   The main function of the second job is still long, I found that there is a big problem with their own ideas - I still modeled on the first job, regular use of large, will directly match the entire regular expression is big, and for the expression split process item was written on the inside of the main function, which is equivalent to class just a decoration, not a good use of a class, and the use of large regular match means that Matcher method will still repeat-create the wheel, so read someone else's after the code, I started using small regular match respectively in the third operation.

  (3) The third operation

    FIG class as follows:

    

    Complexity as follows:

    

      Coupling follows:

     

  The third operation is recursive derivation, Taisho the match is no longer viable, I started using small regular recursive partitioning, I began to see in the programming process, in addition to the recursive nature of the other and the second is not much difference. After the experience of the previous two, my class will have an integrated approach is reasonable, small regular use, so that I do not repeat create the wheel, the code style of the first time has been greatly improved.

  (B) BUG analysis

  The first job because relatively simple, and there is no problem, just because the sign is negative in terms of a multi-output minus sign.

  The second job is plagued by power index range for some time, we can see instructions need to read carefully, many bug appeared in the details of the provisions.

  The third work appeared second question, after listening to other students talked, I learned first item on the pretreatment will be disposed of in front of the sign on the second discussion class, or to items own unified treatment can not handle all situations.

  (C) Mutual Testing Policy

  (1) after writing program, I will first test the program on their own, the choice of a normal test sample to ensure the normal, robust selection of samples to ensure full coverage, I will test each other when these sample tests others, such as the constant term is -0000, considering the border situation, referring to instructions requirements listed constraint point, for testing.

  (2) When more robust test sample can not be found BUG, ​​others began to read the code, compare with others their ideas and consider a variety of different situations, in order to determine their own or other people's problems in accordance with the ideas.

  (Iv) Description reconstruction

  The second job because I did not take into account a term can be expressed as a triple type, and no reconstruction work on time, and the third time I am working hard to achieve a recursive, or the use of the expression for the split entry, and then after the split factor of strategy, but did not know how to use the interface to which my code structure and suitable interfaces, and later asked the other students, I learned that need interfaces multiply and subtract two classes.

Third, the summary

   (1) three times a job I thought would gradually reverse over process-oriented, able to encode and combine theory class

  (2) For the optimization, I do not good, especially in the third operation, excessive nesting results are particularly jumbled and guide books to read

  (3) I spent the whole idea of ​​the time structure of the program at the beginning of fewer jobs, often with the idea to start, but gave up halfway methods, and there will be a complete change when dbug, and the impact of other matches

Guess you like

Origin www.cnblogs.com/wdd00/p/12536651.html