Understanding of the four cores of extreme programming (i)

Source: Internet
Author: User
Tags coding standards end final functions modify
Programming
The core of extreme programming is four, communication, simplicity, feedback and courage, and these four principles must also be noticed in the process of doing projects in peacetime. But two Masters, Kent Beck and Martin Fowler, were able to bring the four points together so that they could work together to form the ultimate programming this four-wheeled wagon, but it was a big creation.

Here are just some of the things you have to say about your own learning and the simple practice process that you have in your four cores.

First, Exchange

1 communication between the developer and the customer

This is somewhat similar to the traditional software engineering in peacetime, the process of developing software also attaches great importance to communication with customers, especially in the requirements analysis, summary design and acceptance testing, developers and customers effective communication is essential, it will directly affect whether a project can meet customer requirements.

However, in the extreme programming of the customer's development phase is somewhat different, the traditional project development process, the customer only in the first time and the last time need to be with the developers, their responsibility is the business function of Help, But this inevitably leads to a situation where the customer made the wrong or inaccurate request at the beginning of the project, and the project team began to develop, and the customer was not involved in the project for a long period of time, and when the project was checked out, there were errors or modifications, At this point the project team had to pay a lot of time and effort to adapt to customer needs. It's a big waste of time and money. In extreme programming, you need a very business-savvy onsite customer who not only provides business information at any time, but also writes the test code for the business acceptance test, so that the project's direction can be assured to a large extent.

The process of extreme programming is the process of "aiming-" shooting-"adjusting"-"adjusting", do not insist at the beginning of the project to accurately grasp the direction of the project, because there are on-site customers, the direction of the project is constantly adjusted, so that can be a great degree to avoid the project detours.

2. Communication between developers

While we are currently recruiting developers and all other staff, we emphasize teamwork, but in the actual course of our work, we consult others only when there is a problem, and when we solve problems ourselves (I used to be, maybe everyone will be different), Then we can gather together to chat, eat, sing and so on outside the development process activities. These can really make the team to produce a certain cohesion, can let everyone get along, but the real sense of the team still has a certain gap.

The education we have been trained in is an independent problem-solving ability, so when we encounter a problem, most of us think about solving it ourselves, rather than doing it with others.

One of the most important principles in the practice of extreme programming is pairing programming, a principle that seems odd. Because the first thing we think about is getting two people to do something at the same time, isn't that a waste of one's productivity? But not really, the so-called pair programming here is not a person in the programming, the other is looking at, another person also plays a very important role, his brain is also constantly running, he needs to help the coder to find low-level errors, to prevent its coding a directional error, Especially when a person who is coding is not good at solving a problem, he takes the keyboard directly and swaps the role to encode it directly.

The benefits of doing this may only be realized after the practice, it can not only avoid some mistakes, but also through direct discussion to solve some problems that can easily be ambiguous. And two of people's ideas collide with sparks that can solve problems more quickly. Moreover, in the process of communication, everyone's level will also be improved very quickly. The process of pairing programming is also a process of learning together. (Unfortunately I only have one person here, no way to long-term practice, but as long as the opportunity I will work hard)

3 communication between the developer and the management staff

In a project team, the relationship between the manager and the developer is a very important factor affecting the project, and if it is not handled properly, it can lead to a failure of the project directly. and the quality of management personnel is very high. If it is a transformation from the technical staff manager, then his management capacity needs to be greatly improved, otherwise it will be due to lack of management capacity and lead to project chaos. And for a simple person with management skills, how to get the admiration of the technical staff is very important, or simply can not make the developers listen to management, then his position is at stake.

And, if developers can communicate well with managers, then their working environment will be greatly improved, not necessarily a very luxurious room and advanced furniture, only need a very comfortable working environment, you can make a team's combat effectiveness is greatly improved. Moreover, for a project's plan and budget, if the developer can put forward their own ideas, it will avoid the end of the project but ultimately not the profit of the emergence of the situation.

Managers should also take the initiative to listen to the views of developers, many developers are more introverted people, if not to ask them, they will only be in their hearts of discontent buried in the heart, the final result is a sudden outbreak, and then resigned to leave, causing significant losses.

Second, simple

1) Simple design

In the process of extreme programming, a simple design practice is advocated. The reason for this is that too many design documents cause us to waste too much time on it, and the design document is not unmodified, and it may be that at the end of the project we will find that the original design document has already been unrecognizable.

So what we're going to do in our initial design work is to be clear about the most important features we're going to achieve, then design the overall framework and core technology, which will not exceed 10 pages from beginning to end, so that even if there are some changes, we do not need to spend too much time to modify. In particular, we don't need a lot of effort to get the code and documentation in line with the changes.

However, simple design does not mean that these designs are dispensable, on the contrary, the simple pages are more important, because the core content of a project is above, so in the process of writing must be cautious.

2) The Simple coding

The simple expression of coding in the process of iterative, in the process of extreme programming, not to achieve all of the required functionality, and do not need to complete a while before no longer change, on the contrary, change in the extreme programming is advocated. We can simply implement a little bit of functionality, and then add detailed content, after refactoring the program, the final code will be very simple, because after modifying the principle of refactoring, all classes and functions, processes are very short rather than lengthy, and each module completes the function is very clear.

But don't equate simplicity with discretion. Although we want to achieve simple coding, still have to have coding standards, so that all people can easily understand the program we write. Other like attributes to use nouns to define, the process to use the verb to start the standard is also very useful, we should follow.

3) The Simple annotation

In some projects, the annotation requirements are very strict, and even stipulate that the amount of annotation in a program must reach a percentage. This is a very reasonable, because the annotation can let us better understand the function of the program, but think about it, but it is not the same thing.

It has been said that "ordinary programmers can write programs that computers can read, and a real master can write programs that ordinary people can read." Indeed, rather than having annotations explain the program, it's better to use it when it comes to naming variables and processes and functions than you can understand, and even without too many annotations, it's not very difficult for another programmer to read the program you're writing.

So, in the process of writing code should use the code itself as far as possible to illustrate the problem, rather than with the help of annotations, we want to write code, if the inside with too much irrelevant code, on the one hand will waste our time, but also may cause ambiguity On the other hand, complaining about the Microsoft Windows source code is more inappropriate. Those comments are just a distraction for those who read the code.

4) The Simple test

Usually our project is based on waterfall development, the test will be placed after the completion of coding, including monomer testing, integration testing, functional testing and acceptance testing, and so on, and most of the tests are done by hand. So based on experience, if the code uses 20% of the time, the test will take at least 40% more time. And in the process of testing, there are a lot of problems to be modified, which is causing the test to spend a lot of time reasons.

In extreme programming, testing is done by writing test code to automate. Especially in some object-oriented programming environment, we can use the Xunit tool to quickly and effectively test the monomer. And writing these monomer test code can even be before the formal coding. Every time you modify the program, run the test code to see if there is a problem with the program. And for the integration of programs, extreme programming advocates continuous integration, which is the continuous integration of the code modules that have been written through the monomer test into the completed system where the test suit can be tested directly to ensure that the code does not affect the entire system.

As we can see, coding and testing in extreme programming is a small step, which makes it easier for us to discover and modify errors in time. And the automated testing tools ensure the efficiency of our work, so that we avoid too much duplication of 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.