Pairproject -- Pair Programming

Source: Internet
Author: User

Member: 12061162 Wang Yu

12061225 Zhong yiheng

I. Photos during cooperation

,

Ii. Advantages and Disadvantages of Pair Programming

 

Advantages:

 

1) in the programming process, any piece of code is constantly reviewed, and at the same time, the responsibility for writing code is avoided, but it belongs to two people, it helps build a collective awareness of code.

 

2) pairing programming is also a process of mutual supervision. Everyone can supervise and urge the other party's work. Due to this pressure of supervision, both parties can work more seriously and frequently discuss the code of the other party to prevent code leaks and improve the quality of their own code.

 

3) in order to avoid fatigue when a person performs the same job for a long time, two programmers in Pair programming can also switch roles and rotate the roles of drivers and pilots, this ensures high work efficiency for a long time.

Disadvantages:

 

1) if two people spend less time together, they will wait for each other, which affects efficiency. It is a waste of time to use Pair programming.

 

2) if it is a project that requires a long time to study, the adoption of Pair programming will affect a person's thinking, which is counterproductive.

 

3. advantages and disadvantages of each person

Wang Yu

Advantages:

1) Strong coding skills and rich coding experience

2) hard work and perseverance

3) Active logic thinking and innovative ideas

 

Disadvantages:

1) debugging is time-consuming and the code debugging capability needs to be improved.

 

Zhong yiheng

Advantages:

1) diligent and studious, able to learn C # write code at the same time

2) be able to listen to the comments raised by the partner modestly

3) Be careful

 

Disadvantages:

1) The code writing capability is weak, and the writing volume needs to be improved.

 

IV,Read the chapters on Information Hiding, interface design, and loose coupling in textbooks and other materials and explain how to make good use of these design methods.

 

Information Hiding)

 

Each module should conceal its own design decisions for all other modules. In other words, the module should define and design the information contained in the module (algorithms and data) not to be accessed by other modules that do not need the information.

 

Effective modularization can be achieved by defining a series of independent modules. independent modules communicate with each other only the information necessary to implement software functions. You can also enhance the access constraints on the process details in the module and access constraints on any local data structure used by the module.

 

During subsequent software maintenance, errors accidentally generated during the modification process will not be transmitted to other locations of the software.

 

Interface Design)

 

The interface design includes three important elements:

 

1. User Interface (UI)

 

Contains aesthetic elements, human-machine engineering elements, and technical elements. Generally, the UI makes the entire application architecture unique in subsystems.

 

2. External interfaces with other systems, devices, networks, or other information creators or users.

 

Determine the entity for sending and receiving information. In all circumstances, this information must be collected in the requirement project and tested at the beginning.

 

 3. internal interfaces between various design components.

 

The Design and Implementation of the analysis class represents all the operations and information transmission modes, so that different types of operations can communicate and collaborate. Each message must be designed to provide essential information transmission and specific functional requirements that have been requested for operation.

 

Loose coupling (loose coupling)

 

Within the design model, collaboration should be kept within an acceptable minimum range. That is, the design class in a sub-system should only have a limited understanding of the classes in other subsystems. Methods in a class should only send messages to methods in the surrounding class, rather than directly apply the content inside the methods in the surrounding class.

 

Loose coupling means to maintain certain communication and independence between objects. However, in program design, we cannot blindly pursue loose coupling, which will make the program granularity too low, making the program huge and complicated, and counterproductive.

 

In this program design, the scheduler algorithm cannot only apply to test cases. If the number of elevator parts changes and the scenario changes, scheduler does not need to be modified. Therefore, even if we know that the current elevator is 4, we cannot directly use 4 in the algorithm. Instead, we should use the count () value of the elevator. In addition, algorithms cannot only be used in test cases, so they should be more suitable.

 

Although the scheduler and elevator classes are closely related, the two are mainly controlled by communication and are not directly referenced.

 

Describe the advantages and disadvantages of these contractual design practices and how you integrate them into your homework.

 

The proposed contractual design is mainly based on software reliability considerations. Reliability includes correctness and robustness. correctness refers to the ability of the software to execute according to the requirement specification, and robustness refers to the ability of the software to handle situations not stated in the requirement specification.

 

Advantages:

 

  1. Documentation. The document not only contains the signature description, but also the contract description. If the description can be further presented as prompted by Visual Studio, errors may be made in many coding processes.
  2. Testing, debugging, and quality assurance. Nunit is a well-developed assertion testing framework. If the language itself provides contractual design support, we can make the assertion in unit testing more extensive (considering that developers generally do unit testing on their own ), it can help to discover more hidden defects, and the coding of the asserted test code will be more concise.

 

Disadvantages:

 

The contractual design is too rigid, so it is not easy to implement the idea or add new functions, because function functions have been agreed.

 

In our jobs, the application contract design is mainly reflected in receiving user input data. This is like a commercial contract. There is a relatively equal relationship between users and programmers, that is, if the user does not comply with the programmer's rules set at the beginning of the program, then the programmer's program is not obligated to present a satisfactory result to the user.

 

Application of contractual design in this project

 

At the beginning, Chai zehua and I discussed the algorithm and determined the main line of the algorithm. Later, in order to achieve the purpose of contractual design, we further refine the algorithm and almost implement the algorithm in the form of pseudo code. This pseudo code is our contract.

 

In practice, we found that the contractual design makes code compilation a good one. However, the results of this contractual code are not ideal. When we want to make small-scale modifications to it, we find it takes a long time. Finally, I had to re-write the code to get good results.

 

It can be seen that although the contractual design ensures the correctness, it is not applicable to the development that constantly adapts to the new external environment, as well as the exploration and innovation development. The environment currently faced by software development is a constantly changing environment, and contractual design may gradually become inapplicable.

 

V,Screenshots show how you use unit test of Vs to ensure the quality of the classes you write. Show unit test's coverage for your written class


Unit test results:

 

Class coverage:

The final coverage rate reaches 92.50%.

 

6. Draw a UML diagram to show the relationships between entities

 

 

VII,

Implement your algorithm and describe the key of your algorithm (without listing the source code), as well as its uniqueness.

 

Key Algorithms:

Optimize the bus algorithm and scan all the commands that have entered the queue, find the nearest stopover floor (that is, the floor where a passenger sends a request from outside the floor or sends an instruction to the floor within the elevator), and then judge that if the floor is an elevator, set the next floor of the elevator to be docked to this floor.

 

Then, because the initial value of the most recent docked floor is 21 or-1, if the value does not change after the command is scanned, it indicates that there is no need to dock the floor in the current direction, then, the Operation direction of the elevator is changed and the next docked floor is searched.

 

Uniqueness:

First, the definition of the floors to be docked in the recent Shun Road makes the elevator closer to the actual situation. If there is no floor to be docked in the current direction of the elevator, the Operation direction of the elevator changes, this greatly reduces the waiting time of passengers and represents a qualitative leap in improving performance.

 

Pairproject -- Pair Programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.