Understanding of four cores of extreme programming (1)

Source: Internet
Author: User
Tags coding standards

There are four core components of extreme programming: communication, simplicity, feedback, and courage. You must have noticed these four principles during the project process. However, the two masters Kent Beck and Martin Fowler can combine these four points so that they can join in extreme programming, which is a great creation.

Next, I will only talk about some of my understanding of these four core issues in my learning and simple practices.

I, Communication

1)
Communication between developers and customers

This is similar to the traditional software engineering. In the process of developing software, we also pay great attention to communicating with customers, especially in demand analysis, outline design, and acceptance testing, effective communication between developers and customers is essential, which will directly affect whether a project can meet the requirements of customers.

However, in extreme programming, the development stages of the customers are somewhat different. In the traditional project development process, the customers only need to be with the developers at the beginning and end, their responsibility lies in the help of business functions, but this inevitably leads to the following situation: at the beginning of the project, the customer raised wrong or inaccurate requirements, and then the project team began development. The customer did not intervene in the project for a long time, during project acceptance, the project team had to spend a lot of time and energy to adapt to the customer's needs. This is a great waste of time and money. In extreme programming, a field customer who is very proficient in business needs to not only provide business information at any time, but also compile the test code for business acceptance testing, in this way, the project direction will not be wrong to a great extent.

The process of extreme programming is the process of "aiming-" shooting-"adjustment-" adjustment ". It is not mandatory to accurately grasp the direction of the project at the beginning of the project, due to the presence of on-site customers, the project direction is constantly being adjusted, which can greatly avoid project detours.

2)
Communication between developers

Currently, when recruiting developers and all other staff members, we emphasize team spirit. However, in actual work, apart from problems, in addition, I will ask for advice only when I solve the problems I encountered. (I used to do this. Maybe everyone will be different ), then we can get together to chat, eat, sing, and other activities outside the development process. The above can indeed bring about a certain degree of cohesion in the team, so that everyone can get along in harmony, but there is still a certain gap from the true team.

The education we receive has always been to cultivate an independent ability to solve problems. Therefore, when we encounter problems, we often think of solving them by ourselves rather than working with others.

A very important principle in the practice of extreme programming is Pair programming, which seems a bit strange. Because the first question we thought was to let two people do one thing at the same time. Isn't it a waste of productivity? But this is not actually the case. The so-called Pair programming is not a person programming, the other is watching, and another person also plays a very important role, and his brain is constantly running, he needs to help the coding personnel find low-level mistakes to prevent their code from getting wrong in direction, especially when there is a problem that the encoding person is not good at solving, he will directly take the keyboard and exchange roles with him for encoding.

The benefits of doing so may be realized only after practice. It not only avoids some errors, but also solves some problems that are prone to ambiguity through direct discussion. In addition, the ideas of the two people come together to solve the problem more quickly. In addition, in the process of communication, the level of everyone will be improved quickly. The process of Pair Programming is also a process of learning together. (Unfortunately, I only have one person here, but I will try my best if I have the opportunity)

3)
Communication between developers and management personnel

In a project team, the relationship between managers and developers is a very important factor affecting the project. If the problem is not handled properly, it may directly lead to a project failure. The quality of management personnel is extremely demanding. If a manager is transformed from a technician, his management capability needs to be greatly improved. Otherwise, project confusion will occur due to lack of management capability. However, it is very important for a person with management skills to be admired by technical personnel. Otherwise, developers cannot follow the management, then his position is in danger.

In addition, if developers can communicate well with management personnel, their work environment will be greatly improved, not necessarily very luxurious rooms and advanced furniture, only an environment that can work comfortably can greatly improve the combat capability of a team. In addition, if developers can put forward their own ideas on the plan and budget of a project, they will avoid the occurrence of the final win of the project but the final profit will not be obtained.

Management personnel should also take the initiative to listen to the opinions of developers. Many developers are relatively introverted. If they do not ask them, they will only bury their dissatisfaction in their hearts, the final result is a sudden explosion, and then resign and leave, causing significant losses.

II, Simple

1)
Simple Design

In the process of extreme programming, we advocate a simple design practice. The reason for this is that too many design documents will waste us a lot of time, and the design documents are not modified, maybe at the end of the project, we will find that the original design documents have already been completely invisible.

Therefore, what we need to do in our initial design work is to clarify the most important functions we need to implement, and then design the overall framework and core technologies, these documents will not exceed 10 pages from start to end, so even if there are some changes, we do not need to spend too much time to modify them. Especially after modification, we do not need to make great effort to make the code and documentation completely consistent.

However, a simple design does not mean that these designs are dispensable. On the contrary, simple pages are even more important, because the core content of a project is on top, therefore, you must be careful when writing.

2)
Simple coding

The simplicity of coding is manifested in the iterative process. In the extreme programming process, it is not necessary to implement all the required functions at once, nor do it need to be completed at once without changing it. On the contrary, changes are promoted in extreme programming. We can simply implement some functions first, then add detailed content, and then refactor the program. The final code will be very simple, because after modification according to the refactoring principle, all classes, functions, and procedures are very short rather than lengthy. The functions completed by each module are very clear.

However, do not equate simplicity with randomness. Even if we want to implement simple coding, we still need coding standards so that everyone can easily understand the programs we have compiled. Other elephant attributes should be defined using nouns. It is also very useful to use verbs to start the process. We should follow them.

3)
Simple Annotation

In some projects, the annotation requirements are very strict, and even the comments in a program must reach a percentage. This first day seems very reasonable, because annotations allow us to better understand the functions of the program, but it is not the same thing to think about it.

Someone once said, "A general programmer can compile programs that computers can understand, and a real expert can compile programs that ordinary people can understand ". It is true that, rather than making comments to explain the program, it is better to give everyone an understanding when naming variables, procedures, and functions, even if there are not many comments, another programmer is not very difficult to understand the program you write.

Therefore, we should try to use the Code itself to describe the problem during code writing, instead of using the help of comments. We need to write the code, if there are too many irrelevant code in it, on the one hand, it will waste our time and may lead to ambiguity; on the other hand, it will not be necessary to comment to the Windows source code filled with complaints. Comments only bring distracting effects to those who read the code.

4)
Easy to test

Normally, if our projects are developed in waterfall mode, all tests will be placed after coding, including standalone testing, integration testing, function testing, and acceptance testing, in addition, most tests are performed manually. Therefore, based on experience, if the encoding takes 20% of the time, the test should take at least 40% of the time. In addition, many problems need to be modified during the test, which is also the reason that the test takes a lot of time.

In extreme programming, testing is automated by writing test code. Especially in some object-oriented programming environments, we can use xunit tools to quickly and effectively perform standalone testing. In addition, you can write the standalone test code before the code is officially coded. After each program is modified, run the test code to check whether the program is faulty. In addition, for program integration, eXtreme Programming advocates continuous integration, that is, continuous integration of compiled code modules that have passed the standalone test into the compiled system, the test suit integration test can be conducted directly to ensure that the Code does not affect the entire system.

We can see that encoding and testing in extreme programming are carried out in a small step, so that we can promptly discover and modify the errors. The automated testing tool ensures the efficiency of our work and avoids repeated work.

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.