XP: Extreme Programming in Practice


In recent years, among software developers has become a popular technology called "extreme programming" or XP. Writes about this mass of papers and books that give the concept of the theoretical foundations of this methodology. I would like to tell you how it looks in practice, and what advantages and disadvantages

First of all, what is XP? On the Internet you can find lots of definitions and descriptions of the term. In principle, each of them more or less adequately reflects the essence of the phenomenon, but a variety of definitions can confuse the developer. However, please realize that XP is a set of techniques developed for what would be subordinate to the software development process four basic principles. Namely:

  • communication;
  • simplicity;
  • feedback;
  • courage.

Typically, the materials on XP, these procedures are specified. Here are the most typical of their list:

  • Planning Game;
  • Testing prior to development;
  • Pair programming;
  • Continuous processing;
  • Ease of development;
  • Collective code ownership;
  • The ongoing integration;
  • Customer on-site;
  • Quick-release versions;
  • Forty working week;
  • Coding standards;
  • The metaphor of the system.

I will comment only some of the techniques, since the meaning of most of them quite clear from the title and described in detail in the literature. Some of these techniques seem quite logical to some, by contrast, is puzzling.

Planning Game. The idea of this technique is quite simple. The developers, together with our customers get together and play some possible situations (ideally all) that may occur when solving problems in life. It is desirable to arrange such meetings before the design of each subsystem, that is to do it regularly throughout the development process. This allows us not to engage in the development of rigid plan, and promptly adapt to changes in the subject area.

Testing prior to development. It is assumed that prior to the development of a program fragment written test for him. This has some advantages. First, it so happens that a change in one code snippet entail errors in the other. This approach to testing allows you to instantly identify such situations. Secondly, the customer is easier to see clearly that the test works, than to read large volumes of documentation. That’s why the result of a test to visualize.

The metaphor of the system. The products developed or code snippets are compared to any similar products or events. Constructed metaphors. This simplifies the understanding of the problem and, consequently, accelerates the development.

But it is also necessary to understand that if by any reason any of these techniques are starting to go against the basic principles of XP, but such situations are quite possible, then it should be eliminated.

Frankly, despite the fact that before these events, I had a general idea of extreme programming, but in the process of developing an application that I want to tell you, consciously follow the methods of XP I have not tried. Nevertheless, in my opinion, this is a typical example of XP. In any case, the positive result was achieved.

Now let’s look at how HR approaches can be used in practice in our conditions. One of my tasks at work is to automate the learning process. Actually, I have for quite a great length of time engaged in writing the application, (at least to the author:)) a comprehensive solution to this problem. The budget for the project scanty, and the amount of work – decent. Another, almost decisive factor was the constant modification of the domain. Regularly changing the form of reporting documentation, and methods of their production. A situation when the project ceased to keep pace with user requirements. And once the moment has come when, for objective and subjective reasons, the development could be safely buried. However, suddenly in front of me was a specific task a loaded fund classroom for a semester. At this point the three participants of the project I was left alone, and this subsystem has not been realized and its realization is not even standing in the nearest future development of the project. On such trifles as competent formulation of the problem, the calculation of labor intensity, additional resources nobody even thought. To complete the task was given to two weeks. In this case, my arguments regarding the impossibility of this task were not considered in principle. My first decision was to look for a different employer, as the two weeks I had to write not only the analysis module load fund classroom, but also entry system timetables, control pads and more. Offline, this problem is not solved in principle – we need the original data. And not just raw data, and correct the source data, from which all of the above tasks. Nevertheless, I do not know why, but I tackled this problem.

Naturally, the talk about the development of classical methods, in this case was inappropriate. Here are some useful approaches and XP. Overview of the problem I’ve had, but there were plenty of nuances that could potentially significantly increase the amount of work. I started working with that dialed the Training Division, and fell asleep snyavshego up a lot of questions, the answers to which I could not find on their own or in which I was not sure.

I have run the Rational Rose and has begun compiling a model. By the end of the day I jotted down the model seemed to me more or less adequate. After work I took another step, corresponding to the ideology of XP. I pulled his friend working in the academic department to drink beer. In this process, an important event in all respects, I told him his vision of the program’s interface and logic work. He, in turn, was taken to talk about the need to address some of the local subproblems. By evening I had a clear understanding of what still needs to be done under this project (I have no doubt that the problem should be treated as a separate project). Nevertheless, has not been resolved yet another not unimportant question – the choice of development tools. When the events described occurred, I began to actively explore the MDA technology. In short, the essence of it is as follows: fragments of the application code and data structures are generated automatically from UML models that can significantly reduce development time. In this article I will describe in detail the principles of MDA, but I want to focus your attention on the fact that this technology fully meets the "spirit of XP». This is due to the fact that one of the conditions under which the XP method will work successfully, it is reducing the cost of modifications to the application in the later stages of development. Among the factors that contribute to achieving this is not unimportant is the use of a variety of new programming technologies. I note that it is easy to refactor MDA applications is one of the main advantages of this technology. In general, today there are many implementations of MDA, I opted for the Bold for Delphi.

But in my situation was somewhat "sticky points". First, recognizing that MDA provides certain advantages, I still do not quite confident, possessed this technology and virtually had no experience writing MDA-applications. Secondly, I realized that some pieces of code will be problematic to implement a standard means of MDA, and have a lot of "hand coding", which in this case will have specific features.

An alternative was to write "normal» Delphi application. I run ICQ and wrote a message to your friend – Adept Bold. After I briefly explained to him the essence of the problem, I asked how he would have done in my place. He replied something like: "Either dive headlong into the Bold, or you’ll never learn it. Make a major project – the best way to learn technology. " Actually, another answer I did not expect.

In the morning I took an existing model and began to build the application. Namely, to build. The coding I did not start, but simply sketched the user interface, many elements of which are almost immediately earned. On a smoke break, I tried to leave the company staff training department, it allows me to pull another "victim" to the screen of your monitor, and (not without a certain amount of pride) showed intermediate results. Thus, realizing the principles of feedback. You can rightly noted: "And how pair programming?". Yes, indeed, as a programmer involved in the project I am one. But I mention yet another happy coincidence. At that time, when there were the events described, I, together with a group of developers – enthusiasts development of internet projects, dedicated, namely MDA. So when I went to the most difficult place in its development, this project has brought unexpected results.

Within a few days I wrote the procedure code that implements the mapping of classes on the screen. Standard controls were not allowed to display all data in the form in which they normally appear. I also like that would be the end user at least roughly understand what the program does and how to work with her. I wrote a component, based on the regular TStringGrid. I was not sure that it was a good decision, but the code worked. In the forum of our project I set out its decision, expecting to get some estimate for a sufficiently long period of time. However, just 15-20 minutes later came the first reply. Proposed alternative solutions, and after 10 minutes came a test case, but not one, but two, from two authors. If you think about why the developers, so enthusiastically started to solve somebody else’s problem, then we can come to a simple conclusion. Firstly, it was just interested to find a universal solution, which can then be used in their projects. And secondly, he was interested in the process of communication. It should be noted that with the same enthusiasm to solve other problems at various levels of complexity. Of course, this is not pair programming in the usual sense. Rather, it is a surrogate, but nevertheless, this has its pluses. Say, all expressed thoughts and ideas are automatically documented, and it could turn at any moment.

On tests, I would like to stay alone. As recommended in his book "Extreme Programming Kent Beck, the tests must be written in advance. Moreover, the author, it looks like this. There is a special program written by the developer, when you click on one of the buttons that run all the tests, and finally appears on the screen the green "light" in the case of a positive result, and red otherwise. I have a description of some discouraging. Agree, it’s hard to imagine how you can write a program that simulates the user’s actions, in absolutely all situations.

As I said before, I did not try to adhere strictly to the techniques of extreme programming. And in the books I read unequivocally stated that the writing test – one of the most important moments in XP, and without that other methods of work should not. Why, in the end, I reached a positive outcome? Everything was simple enough. To answer this question helped me to this particular example with green and red lights. The fact that the Bold has a chance to show consistent – whether this object model. And this is done just by using these "bulbs". Literally two lines that I almost immediately put in the application code allows me to see in what place is the discrepancy (if any). This is what replaced my testing. It is possible that such an approach is not entirely consistent with the original idea of "testing prior to development, but it worked.

Within a week I had almost finished the application. During the second week, I made two versions, which substantially expand the functionality as well as to import the majority required for the operation of data from other operating systems. The problem was solved, and largely through the use of techniques of XP. The meaning of the above, I see only in the fact that this example has proven performance of extreme programming.

In conclusion, I want to make one more remark. Extreme programming, in my opinion, is not a panacea. And to use his method can not be taken for any project. In principle, the draft, in some respects served as a time in the category of projects where the use of XP is not recommended. However, a more flexible approach using extreme programming techniques can yield a very surprising results. When reading books by foreign authors on the subject, the domestic reader might get the opinion that the techniques of XP can not in principle be used in our conditions. And not only that the relationship between developers and customers, as well as relations in the team of developers in the examples described in the books, are based on somewhat different principles. The point rather in the difference in mentality. However, adapting XP to our conditions is quite possible, and this can give very impressive results.

See Also

    Advertising

    Archives