Knot-to-project summary blog

Source: Internet
Author: User

Pair programming

The pair project was done jointly by me and Chen Mou. Here is an image we commissioned to help you with a discussion:

  

Advantages of pairing Programming:

1. To be able to conduct code review between each other, the question and response in code review can help two people to understand each other, better find out the flaws of their procedures.

2. At the development level, pair programming provides better design quality and code quality, and two people are more able to work together to solve problems.

3. For the developers themselves, knot-to-work can bring more confidence, and high-quality output can lead to higher satisfaction.

4. Pairs can communicate more effectively, learn from each other and transfer experiences, and share knowledge.

Disadvantages of pairing programming:

1. For programmers who have different habits, working together can create problems, even contradictions.

2. Sometimes, programmers have their own opinions about a problem, and they have a lot of internal strife.

3. Faced with the novice, experienced veteran may feel very irritable. Inappropriate communication leads to disharmony in the team.

My pros and Cons:

Advantages:

1. Positive enthusiasm for work, always want to be able to complete the fast.

2. Rigorous attitude, to ensure that the necessary requirements can be completed.

3. Optimistic and cheerful, encountered difficult to solve the problem or the process of the bug, less anxious mood.

Disadvantages:

1. The programming level is lower than the partner's, and after reviewing the code of the partner, it is true that the quality is higher than itself.

Companion's pros and Cons:

Advantages:

1. Programming ability is very high, often participate in various competitions.

2. Work attitude is very positive, often ask me to discuss various details about the project.

3. A friendly and peaceful personality, ask him questions he does not understand, he can always patiently answer, there is no impatient mood.

Disadvantages:

1. The timing is not particularly stringent.

Design method:

1.Information hiding

Information hiding is the foundation of structured design and object-oriented design. In the structure of the concept of function and object-oriented packaging ideas are derived from information hiding.

In this project, we have applied this design approach in a number of places:

1. All data members of a class are private, and access to class members requires access to functions that do not directly access and modify member variables.

The 2.Core is accessible through an interface function between the external input and output layers.

2.interface Design

Interface design can effectively improve the efficiency of team work and ensure the synchronization of work.

Our work on this project was done synchronously with the use of interfaces. One person improves the functionality of the core module, another person designs the user interface, and then the two parts are finally connected via an interface.

3.loose coupling

This point in the last semester of the object-oriented class Wu Teng teacher has repeatedly stressed to us, class and class should minimize the degree of coupling, their respective roles. A good loose-coupling method is the interface design between classes and classes. Because of the small size of the project, the class is less, so there is no use of the class interface design. However, the degree of coupling between classes is minimized during the coding process.

Contractual design

This design approach was also mentioned in the object-oriented class last semester, which requires programmers to define a verifiable interface for a program, adding preconditions, post-conditions, and invariant to the abstraction of the data.

The advantages of contract design: class invariant can ensure that the class is always in a normal state, once the class invariant is expressed as false, like the programmer error, to avoid the problem of non-control. The precondition and post condition of the function call can also guarantee the normal operation of the method, and if there is a problem, it can be correctly located to the wrong place. Using contract design, programmers can avoid a lot of anomalies, and in error can locate the location, saving the later debugging time, to ensure the quality of the code.

The disadvantage of contractual design: the design of a well-contracted program requires considerable overhead. Writing a contract takes time, and developers need time to learn the ideas and techniques to write good contracts.

There are two reasons why we did not use the contractual design in this pair project:

1. This pairing code is based on the code of the individual project, and the use of a contractual design requires rewriting the code and increasing the time spent.

2. The scale of the project is small, and contractual programming may instead cost too much effort to write the contract.

Unit Test

We tested the core class and designed a total of 22 test points with a code coverage of 89.35%:

  

UML diagram

  

The key to the algorithm

1. This project is based on the Chen Mou algorithm. His algorithm is different from the majority of us are first infix to the suffix and then evaluated, but directly to the infix expression value.

2. Then the key point is the method of generating an expression:

< expressions > = < items > | < expressions > + < items > | < expressions >-< Items >

< > = < factor > | < > * < factor > | < >/< factor >

< factor > = (< expression >) | I

Through this syntax expression, it can be implemented in a very simple way, and the operation speed is relatively fast.

The feeling of pairing programming

Lucky to be able to divide and Chen Mou a group, in the process of doing the project can learn from him a lot of things. Pair programming Although at the outset there may be some bad communication between the two sides, but after 2 weeks of running-in and joint efforts, can learn from each other's strengths. Now more can understand that sentence: A person walk fast, a group of people go far.

Knot-to-project summary blog

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.