当前位置:网站首页>Elevator dispatching (pairing project) ④
Elevator dispatching (pairing project) ④
2022-07-04 10:52:00 【Painting and living~】
List of articles
One 、 software test
1.1 unit testing
In the development process , In order to reduce the logic error in the function, the program will bug Probability , We use JUnit3 Unit test the functions of some classes . The functions for unit testing include GetPeopleIn(), GetPeopleOut(), HasPeopleOut(), GetNearestPsg(), GetMaxFloorPsg() etc. . Here is one of the tests
public void testGetMaxFloorPsg()
{
EleController controller = new EleController();
Passenger passenger1 = new Passenger(100, 2, 6, 1, 1);
Passenger passenger2 = new Passenger(100, 1, 8, 2, 1);
Passenger passenger3 = new Passenger(40, 8, 1, 3, -1);
List<Passenger> passengers = new LinkedList<>();
passengers.add(passenger1);
passengers.add(passenger2);
passengers.add(passenger3);
controller.setPsgRequestList(passengers);
assertEquals(8, controller.getMaxFloorPsg(1, 1, 1));
passengers.remove(0);
controller.setPsgRequestList(passengers);
assertEquals(2, controller.getMaxFloorPsg(1, 1, 1));
passengers.remove(0);
controller.setPsgRequestList(passengers);
assertEquals(1, controller.getMaxFloorPsg(1, 1, 1));
}
The test results are shown in the figure 
1.2 Black box testing
Here is 10 Test cases
| The test case | describe |
|---|---|
| No input | The elevator operates normally |
| weight 70 Starting floor 1 Terminal floor 10 | The elevator receives passengers normally |
| weight 100*5 people | Elevator receives passengers normally in case of multiple requests |
| weight 100*5 people The elevator 2 individual | Pick up passengers normally when there are many elevators |
| weight 100*10 people | Unable to pick up passengers when overweight |
| Starting floor -2 | The starting floor is illegal |
| Terminal floor 21 | The terminal floor is illegal |
| Starting floor 1 Terminal floor -1 | In the passenger carrying state, the elevator does not pick up passengers in the opposite direction of its own operation |
| Starting floor 1 Key floors -1 | No passengers sstf The algorithm changes from uplink to downlink |
| Change any legal elevator parameters | The elevator parameters can be changed and run smoothly |
Two 、 Performance comparison
Because passengers are randomly generated , The values are not necessarily consistent .
The evaluation standard is that the total number of people reaches 50 Number of people served per hour / The total number of
Bus:0.3
SSTF:0.48
LOOK:0.34
3、 ... and 、 Pairing project summary
2.1 The advantages of pair programming
Through pair programming , Developers can urge and encourage each other . meanwhile , The fields that two people are good at can also complement each other , When one of the developers encountered a difficult point , You can also ask another person , This saves development time , Improved development efficiency .
However , Pair programming also has some disadvantages . When the code styles of two developers are not unified , It's easy to find it difficult to understand each other's code , And then affect further development . meanwhile , If the content that a person is responsible for himself appears bug Not familiar enough , It will also lead to other bug.
2.2 Personal strengths and weaknesses
Deng Shengyu
advantage : Involved in Java Language project development , Familiar with the development process . Good code habits .
shortcoming : Procrastination is too serious , Delay the development process .
Cui Wenguang :
advantage : Strong ability to collect data . Good at communication , Fast programming speed, clear thinking , No drag .
shortcoming : Not familiar with multi-threaded development .
2.3 Pairing process
As the development period coincides with the winter vacation , Cuiwenguang and I cannot meet offline , Therefore, online communication is adopted to complete the project development . We are 1 month 27 Finish the discussion on the day , Determine and start the development process . Due to git I'm not familiar with , The initial progress was not submitted to the warehouse on time , Instead, it was used after the medium-term code volume gradually increased git Project management .
In pair development , I finished the definition of the first stage class , And basically completed the second stage bus Scheduling algorithm . Cuiwenguang has improved bus Scheduling algorithm , And completed sstf、look Scheduling algorithm and ui Interface development . meanwhile , I am right. ui The interface logic has been adjusted and improved , Unit test is carried out . Besides , We worked together to complete the writing of blogs and documents .
Because you can only communicate online , We can't provide the offline version of the pair photos they are discussing , So I took a screenshot of the online pairing discussion process and recorded it as follows .


2.4 Technical highlights and difficulties
Technical highlights
- Support real-time display of various information
- The algorithm is efficient
Technical key points
- Using multithreading technology , Prevent the process from crashing
- A lot of unit tests are used , Improve code robustness
Technical difficulties encountered
- Process creation problem
- Synchronization function problem
To be improved
- The interface is chaotic
- The function still needs to be improved
- The front end style can be further beautified
2.5 Other gains
Through this pairing project , I realized that procrastination is a terrible bad habit , It will seriously affect the progress of cooperative development . meanwhile , My ability to collect data has also been improved , Yes java Object oriented design 、 Multithreading 、 The understanding of unit testing has been deepened . On the whole , It has benefited me a lot .
边栏推荐
- Snake (C language)
- [Galaxy Kirin V10] [desktop] printer
- Dichotomy search (C language)
- Canoe the second simulation engineering xvehicle 3 CAPL programming (operation)
- /*Write a loop to output the elements of the list container in reverse order*/
- [Galaxy Kirin V10] [server] KVM create Bridge
- MFC document view framework (relationship between classes)
- [Galaxy Kirin V10] [server] system partition expansion
- What if the book written is too popular? Author of "deep reinforcement learning" at Peking University: then open the download
- 1. Circular nesting and understanding of lists
猜你喜欢

Canoe - the second simulation engineering - xvehicle - 2panel design (principle, idea)

JMeter correlation technology

Occasional pit compiled by idea

Canoe - the third simulation project - bus simulation - 3-2 project implementation

Jianzhi offer 04 (implemented in C language)
![[Galaxy Kirin V10] [desktop and server] FRP intranet penetration](/img/54/7d1b8b7b8226e2820635dd04b92d1c.jpg)
[Galaxy Kirin V10] [desktop and server] FRP intranet penetration

Canoe - the third simulation project - bus simulation-1 overview

Using Lua to realize 99 multiplication table
![[Galaxy Kirin V10] [desktop] can't be started or the screen is black](/img/68/735d80c648f4a8635513894c473860.jpg)
[Galaxy Kirin V10] [desktop] can't be started or the screen is black

VLAN part of switching technology
随机推荐
Sword finger offer 05 (implemented in C language)
Knapsack problem and 0-1 knapsack problem
From programmers to large-scale distributed architects, where are you (2)
Rhcsa - day 13
Huge number multiplication (C language)
JMeter common configuration components and parameterization
[Galaxy Kirin V10] [desktop] printer
Postman interface test
Jemeter plug-in technology
Day7 list and dictionary jobs
The bamboo shadow sweeps the steps, the dust does not move, and the moon passes through the marsh without trace -- in-depth understanding of the pointer
Rhcsa operation
Terms related to hacker technology
TS type gymnastics: illustrating a complex advanced type
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
JMeter correlation technology
MPLS: multi protocol label switching
Using Lua to realize 99 multiplication table
[testing theory] thinking about testing profession
Canoe - the third simulation project - bus simulation - 3-2 project implementation