Object-Oriented Course Phase II Summary

-------------Flag fell down QAQ

fourth assignment

 

 


review

  This homework is the first Java multi-threaded program written by the author, and the effect is good. Before starting, the author carefully read the chapter on multithreading in the Java language programming (advanced) of the Machinery Industry Press, and had a basic understanding of Java multithreading related knowledge, and then I couldn't wait to get started. Since this assignment only slightly changed the previous elevator rules and added a multi-threading mechanism, the author mistakenly thought it was not too complicated, but when I started writing, I found out that, my God, it doesn't seem to be very easy to do... Because Before writing the code, the author did not build a clear architecture and had some misunderstandings about multi-threading, which led to many changes to the architecture, especially in terms of thread interaction and the use of locks. There are many wrong designs. A program that can run. Later, in the process of taking pictures with my classmates, I found an extremely stupid "hand error". After making corrections, I continued to test vigorously, and ended the homework after it was basically correct.

  The public beta was all passed, and a bug was forked in the mutual test. After communicating with the testers, the author found that if the machine executes the relevant thread designed by the author in a special way, it will indeed trigger the bug and cause an elevator thread to fall into a deadlock, which is weird. Yes, no matter how I test on my own machine, I can't find the bug, so I came to the conclusion that after confirming the eyes, I met the right machine = =. . . It's a bit pitted, but after modification, the author's code finally successfully avoided bugs on the tester's machine. Here, the author would like to sincerely thank the tester for his serious and responsible testing. Thanks to Ta's test, the author has deepened his understanding of multithreading. .

  The author used black box testing to test the test task, and finally found two bugs in the subject, one was the omission of the rules, the other was a small probability bug, there is nothing to say


fifth assignment

  

 


review

   Regarding this guide book, the word "imaginative" can be said to be very appropriate. Since I have not been able to clarify the relevant rules of this assignment, the author only started construction on Tuesday afternoon, so it was dawn the next day, and I wrote a single-threaded code that can run and ended this assignment. , no other tests were performed. What I want to say is that writing code overnight is really inefficient. After sitting for two or three hours, I actually wrote a few minutes of code. In addition, the author still adopts the practice of first getting started and then considering the specific architecture, resulting in additional time overhead. At this point, the Flag, which was established at the beginning of the semester, was pulled up without dignity and thrown to the ground T_T......

  The public beta was all passed, and the testees of the mutual test found a very simple bug. After the author reproduced it, I found that one line of For statement in the 800 lines of code judged that there was one less '=' added. The reason is that the code was copied in the middle of the night and then When modifying the conditions, I missed one modification, OMG, this is a suffocating operation.

  The author continued to use the black box test to test the test task, and finally found two behavioral bugs of the testee. Later, after communication, it was found that it was the same reason, so one of the bug declarations was finally cancelled.


sixth assignment

  


review

      The author is slack about this assignment, plus some personal reasons, the final result is very unsatisfactory. In terms of design, the author still adopts the practice of getting started first and then considering the specific architecture, which eventually leads to more time overhead and an omission.

    In this design, the author first processes the map information, and BFS calculates the shortest path and all paths of all sources under the complexity of O(n^4). Car thread and scheduler (polling implementation), request thread.

  There is nothing to say about this public beta. In the mutual test, two bugs were found by the other party. After reproducing, the author found that a certain IF statement had a wrong variable name, and when I wrote it before, I thought about adding "For a car, If the instruction has just been allocated in the first few instructions, it should be BAN" in the allocation of subsequent instructions, and somehow I forgot to add it. . .

  The requirement report of the test task is written in starfish, and the code is also well written. After typing a +3, it will be a Buddha.


Three homework design strategies and their changes

  In the multi-thread implementation of elevators, the author wakes up the scheduler by inputting requests and the elevator completes tasks, and then chooses whether to wake up the relevant waiting elevators after processing. The author believes that the multi-thread scheduling of elevators fully practices the interaction between threads, etc. The operation has deepened the understanding of multi-threading very well; the next two jobs are not designed to be so complicated, and all tasks can be completed by simply polling.


experience

  Through the author's observation, it is found that every time the code is written when the state is not very good, there must be at least one zz error, and this kind of error can often be found after a simple test, so no matter what the next homework is, a simple functional test is still Necessary, no regrets. The last thing I want to say is that you must actively take each assignment seriously, and design a more detailed framework for the program in advance, otherwise you will be thankless and waste a lot of time, isn't it a waste of life?

 


reference books

 

To be continued...

Guess you like

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