Pair programming project (except for additional questions) development process

Source: Internet
Author: User

Pair programming project (except for additional questions) development process

Pair Companion: Li Yuntao

First, photos

Pairs of companions at home, and so on back to the school.

Two, pair programming evaluation

Advantages:

1, two people's programming ideas, algorithms, code style can learn from each other and learning, for two people's programming level of improvement are very helpful.

2, two people can write different independent modules to speed up the development progress.

3, the bug of their own program may not find themselves how to find, and their peers can quickly find.

Disadvantages:

Some work has to be done by two people, while both are free time is not too much, many times need to communicate through the line, resulting in delays in work.

My own merits: work conscientiously, have perseverance, have the study spirit.

My own disadvantage: The coding style is poor.

Each other's advantages: coding ability is very strong, professional foundation solid, the proposal is very pertinent.

Each other's shortcomings: relatively busy, sometimes do not have time to do knot pairs of items.

Third, information hiding, interface design, the use of loose coupling design method

These three design methods are essentially the same: the information belonging to their own class or module maintenance is protected by the private property, not visible to the outside, the operation and maintenance of these data is done independently by this module. In order for the external function module to use the service of this module, it is implemented by providing an external set of normalized function call interfaces, and the external module only needs to understand the prototype of each function or method and its specifications to use these services correctly. The advantage of this is that each module functions independently of each other, and that their internal implementations do not depend on the external modules, which means that the modules of the same function written by different people should be interchangeable.

These three kinds of ideas are actually the embodiment of the object-oriented thought.

As far as our programming is concerned: The core module, the test module, the user interface module is three completely independent modules, therefore, we can completely independently develop these three modules, provided by the core module to the test module and the user interface module certain interface, both need to input parameters (generate, check, Calc), you can invoke the corresponding code of the core module to execute. If you want to optimize the user interface later, you only need to change the user interface module, greatly reducing the amount of maintenance.

Four, contract-type programming

Contractual design (English: Design bycontract, abbreviated as DbC), a method of designing computer software. This approach requires software designers to define formal, accurate, and verifiable interfaces for software components, which adds a priori, posteriori, and invariant to the traditional abstract data types. The "contract" or "contract" used in the name of this method is a metaphor, as it is somewhat similar to a commercial contract. (Transfer from Wikipedia)

My understanding: The so-called contractual programming, is the module user and module implementation of a common convention: the module user guarantees that the parameters passed to the module's implementation are in accordance with the method of the module implementation of the pre-conditions, the module implementation to ensure that the precondition is satisfied with the situation, The parameters passed back to the caller of the module are subject to the post condition, and if certain external variables are changed during the execution of the method, the module caller must be shown to be aware.

The advantage of this programming design is that the caller does not have to care about the implementation details of the implement, just understand the specifications given to use each method correctly, for example, we write the program in Java, each method of the string class will give a prototype of this method and a simple explanation, We do not know how Java source code implements these methods, but this does not prevent us from working properly. Similarly, for a module caller, he does not need to worry about how the caller will use his or her own method, he only needs to focus on implementing the specification's functionality. The benefit is that the independence between the various modules of the program is enhanced and more conducive to maintenance and expansion.

The disadvantage of this method is that if one party does not abide by the contract, then it may have serious consequences, such as the caller's incoming data does not meet the preconditions, and the implementation of the failure to check, and the code after the execution of a long time before the appearance, then the workload will be a huge amount of troubleshooting.

Unfortunately, we did not use such a design (time is tight), for the next project to be corrected.

V. Unit Testing

In the case of a basicnum class we wrote, the class has three methods: floatcmp, GCD, power, we have written a test file basicnumtests, respectively, to test the three methods, as follows:

By the way, three methods were tested and the code coverage of the class was 100%.

Vi. UML Sequence Diagrams

Seven, the key to the algorithm

We want to achieve three functions: to generate a calculation of their own calculations, check whether others calculation is correct, calculate the result of a calculation. Therefore, we abstracted these independent function modules: Generating calculation module, calculation module, input and output module, reading analysis module. Among them, the generating formula module randomly generates various numbers, operators and parentheses by random function, and calls the Reading Analysis module to convert infix expression to suffix expression, calculate the module read-in suffix expression to calculate the result, if the result is valid (non-negative and not 0), then record this calculation and answer, Returns the build calculation module to generate the next calculation, and regenerate if it is not valid. This is the ability to generate a calculation for yourself. For the examination of other people's calculations and results, only need to read into the calculation to analyze, calculate the results, and the answer match. For pure compute modules, the analysis module and the compute module are called directly. The input and output module completes the interaction with the other modules.

One detail: Because we want to support fractions, all of our data is represented by a number type, and since all input and output data are rational numbers, we all convert the number of components to process, reset the arithmetic and relational operators under fractions, and the final result is represented by fractions or decimals as needed. This will not result in loss of precision due to floating-point arithmetic.

Viii. Summary

The first pair programming project, a seemingly simple program packaged into a usable software, which encountered a lot of problems, such as the test file how to write? How does the UI write? C # syntax is not very familiar with, and so on, but also because not familiar with VS2015 programming environment and busy long time, but finally made out of the software despite the green unfamiliar, after all, is the perfectly formed, can independently develop a software, or a sense of accomplishment.

Pair programming project (except for additional questions) development process

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.