Extreme programming and agile development
Xu Jingzhou
After reviewing the life cycle of software development in accordance with my understanding, I got a conclusion that the only software document that meets the engineering design standard is the source code list.
- Jack Reeves
Introduction
In 2001, in order to solve many companies' software teams fall into the rushing process quagmires, a group of industry experts summarize some values and principles that allow the software development team to have fast work, respond to change capabilities, and they call themselves as an agile alliance. Amgegility development process is a lot, mainly: Scrum, Crystal, Feature Drive Software Development (FDD), Adaptive Software Development, ASD, and the most important limit programming, Abbreviation XP). Extreme Programming (XP) was first advocated by the Master Character Kent Beck in the SmallTalk community in 1998.
Extreme programming
Design and programming are people's activities. Forget this, you will lose everything.
- Bjarne Stroustrup
Extreme Programming (XP) is the most famous one in agile methods. It consists of a series of simple but-dependent practice. These practices are combined together to form a whole.
Here is an effective practice of extreme programming:
1, complete team
All participants of the XP project (developers, customers, testers, etc.) work together in an open place, they are members of the same team. The walls of this place are randomly hanging on a large, significant chart, and some other things that show their progress.
2, plan game
The plan is sustained and step-by-step. Every 2 weeks, the developer will estimate the cost of the candidate characteristics in the next 2 weeks, while the customer selects the characteristics you want to achieve based on cost and business value.
3, customer test
As part of each desired characteristic, customers can define auto acceptance tests based on scripting languages to indicate that this feature can work.
4, simple design
The team maintains design just matches the current system function. It passes all the tests, does not contain any repetition, expressing all the writers want to express, and contain as little code as possible.
5, pair programming
All product software is built from two programmers and placed together on the same machine.
6, test driver development
Writing unit test is a verification behavior, a design behavior. Similarly, it is a behavior of writing documents. Write unit tests Avoid a considerable number of feedback cycles, especially feedback cycles in software functionality. The programmer works in a very short cycle period, they first add a failure test and pass it.
7, improve design
Use the reconstruction method to improve the corrupt code at any time, keep the code as clean and expressive.
8, continuous integration
The team always integrates the system completely. After a person is dismantled (Check IN), other owner's liability code is integrated.
9, collective code ownership
Any pair of programmers can improve any code at any time. No programmers are responsible for any particular module or technology, each can participate in any other development.
10, coding standard
All the code in the system seems to be written by one person alone.
11, metaphor
Global views of the entire system together; it is a future image of the system, which makes the position and appearance of all individual modules to be obviously intuitive. If the appearance of the module does not match the entire metaphor, then you know that the module is wrong.
12, sustainable speed
The team only has the hope of winning. They work hard to work for a long time, they save energy, they see the project as a marathon, not full speed.
Extreme programming is a simple, specific practice, which combines these practices to form an agile development process. Extreme programming is an excellent, universal software development method, project team can use directly, or add some practices, or to modify some of them. Agile development
The interaction between people and people is complex, and their effect is difficult to expect, but it is the most important aspect of work.
- Tom Demacro and Timothy Lister
Agile Software Development Declaration:
n individual and interactive process and tools
n The software that can work is better than the side of the document.
N Customers cooperation over contract negotiations
n Response change is better than planning
Although the right item is also valuable, we think the left item has greater value.
The principle of agile declaration followed:
n The best thing we have to do is to satisfy our customers through as early as possible, sustained delivery.
n Even later, it is also welcome to change demand. Agile process uses changes to create competitive advantages for customers.
n Recorded software that can be done, the delivery interval can be delivered from several weeks to a few months, the shorter the time interval delivered, the better.
n During the development of the entire project, business people and developers must work together every day.
n Founded around the individual being embraced to build a project. Give them the required environment and support and trust them to complete the work.
n The most effectively and efficient delivery information is the face-to-face conversation.
The software of the job is the primary schedule metric.
n Agile process promotes sustainable development speed. Responsible persons, developers and users should be able to maintain a long-term, constant development speed.
n Constantly paying attention to excellent skills and good designs will enhance agile ability.
n Simple is the most fundamental.
n The best architecture, demand and design for self-organizing teams.
n Each time, the team will reflect on how to make more effective work, and then adjust it accordingly.
When the software development is changed, the software design will have a bad way. When any of the smells appear in the software, it indicates that the software is corrupt.
n Reline: It is difficult to change the system because each change will force many other changes to the rest of the system.
n Vulnerability: The change of the system will cause problems in many places where the system and changes are conceptually understood.
n firmness: It is difficult to unlock the system's entanglement, making it some components that can be reused in other systems.
N viscosity: Do the right thing is difficult than doing mistakes.
N 3B unnecessary complexity: The design contains the infrastructure that does not have any direct benefits.
N unnecessary repetition: The designs include repetitive structures, and the repeated structure can be unified using a single abstraction.
n 性: It is difficult to read, understand. Not well expressed.
The agile team relies on changes to get vitality. The team is hardly designed, so there is no need for a mature initial design. They are more willing to maintain design as clean, simple, and use many unit tests and acceptance tests. This maintains the flexibility of design and is easy to understand. The team uses this flexibility, continuously improves the design so that the system each iterative ends is most suitable for the designs of the iteration.
In order to change the corrodation flavor in the above software design, agile development has taken the following face-to-object design principles to avoid, these principles are as follows:
N Single Responsibilities (SRP)
In a case, there should be only one reason that caused it.
N Open - Closed Principles (OCP)
Software entities should be extended, but they cannot be modified.
N Liskov Replacement Principles (LSP)
The subtype must be able to replace their base types.
N-dependent inversion principle (DIP)
Abstract should not depend on the details. Details should depend on abstraction.
N Interface Isolation Principles (ISP)
It should not force customers to rely on how they don't need. The interface belongs to the customer and does not belong to the class hierarchy.
N Reuse Publishing Equivalence Principles (REP)
The granularity of the reuse is the particle size released.
n commonly closed principles (CCP)
All classes in the package should be commonly closed for changes in the same type of nature. A variation will have an impact on a package, which will have an impact on all classes in the package, and no impact on other packets.
n Joint Reuse Principles (CRP)
All classes in a package should be commonly reused. If you reuse a class in the package, you have to reusable all classes in the package.
N-ringless dependence principle (ADP)
There is no loop in the redeemed diagram of the package.
N Stable Dependence (SDP)
During the steady direction.
N Stable Abstract Principle (SAP)
The degree of abstraction of the package should be consistent with its stability.
The concept of the above package is that the package can be used as a container that is inclusive, by organizing the class, we can understand the design on a higher level abstraction, we can also manage software development and release . The purpose is to divide the class in the application based on some principles, and then assign those classified classes to the package.
The following example of a simple design problem mode and principles application:
problem:
The software is selected to run in the simple barlight, and the table lamp consists of a switch and a lamp. You can ask the switch to open or close, you can also turn the light open or close.
Solution 1:
Below 1 is a simplest solution that can poll the status of the real switch, and can send the corresponding Turnon and Turnoff messages to Light.
Solution 2:
The above design violates two design principles: Dependency Implementation Principles (DIP) and Open Closed Principles (OCP), DIP principles tell us to prioritize the abstract class, while Switch rely on specific class Light, the violation of OCP is in any It is necessary to bring Light on the place where Switch is required, so you can't easily extend Switch to manage other objects outside Light. In order to solve this solution, an interface can be used in the Abstract Server mode, which enters an interface between Switch and Light, which allows Switch to control anything that implements this interface, which also meets the DIP and OCP principles. As shown in Figure 2 below:
Solution 3:
The solutions shown above are set out of the Single Responsibilities (SRP), which binds Switch and Light, and they may change due to different reasons. This problem can be solved by Adapter mode. The adapter is derived from switchable and delegates to light. The problem is solved, and now Switch can control any objects that can be turned on or off. But this also needs to be exchanged for time and space. As shown in Figure 3 below:
Agility design is a process, not an event. It is a process of continuous application principles, patterns, and practices to improve the structure and readability of the software. It is dedicated to maintaining system design as simple, clean and featured.
references
Design mode - can be used for object-oriented software based on object-oriented software - Li Yingjun and other translations
Reconstruction - Improves the design of existing code - Houjie and other translation
Agile Software Development - Principle, Model and Implementation - Deng Hui Translation