|
8楼
楼主 |
发表于 2004-2-7 13:03:00
|
只看该作者
Managing XP 管理XP
One area in which XP (at least as articulated in Beck's book) falls short is management, understandable for a practice oriented toward both small project teams and programming. As Beck puts it, "Perhaps the most important job for the coach is the acquisition of toys and food." (Coaching is one of Beck's components of management strategy.) 对于针对小型项目以及编程而言,在XP(至少是Beck的书中)里对管理的欠缺是可以理解的,。就如Beck写的,"对于教练(coach)来说,或许最重要的工作就是获得玩具同食物"(指导是Beck的管理战略中的一个组成部分)
With many programmers, their recommended management strategy seems to be: get out of the way. The underlying assumption? Getting out of the way will create a collaborative environment. Steeped in the tradition of task-based project management, this assumption seems valid. However, in my experience, creating and maintaining highly functional collaborative environments challenges management far beyond making up task lists and checking off their completion. 同许多的程序员一样,他们推荐的管理策略像是:躲避。下面的假定呢?躲避会建立一个协作的环境,在传统的基于任务的管理里,这个假定是有效的。然而,根据我的经验,创造并维持一个协作的环境会挑战管理远离编制任务列表以及检查。
Figure 1 -- Historical lifecycle change costs.
Figure 2 -- Comtemporary lifecycle change costs.
|
The Cost of Change 变化的代价
Early on in Beck's book, he challenges one of the oldest assumptions in software engineering. From the mid-1970s, structured methods and then more comprehensive methodologies were sold based on the "facts" shown in Figure 1. I should know; I developed, taught, sold, and installed several of these methodologies during the 1980s. Beck从他的早期的著作开始,就不断向那些软件工程中的一些"古训"发出挑战。从19世纪70年代中期的结构化方法,以至后来的那些更复杂的方法,他们都基于如图1所示的那个"事实",在整个80年代,我必须了解、使用、讨论、实施这些方法。
Beck asks us to consider that perhaps the economics of Figure 1, probably valid in the 1970s and 1980s, now look like Figure 2 - that is, the cost of maintenance, or ongoing change, flattens out rather than escalates. Actually, whether Figure 2 shows today's cost profile or not is irrelevant -- we have to make it true! If Figure 1 remains true, then we are doomed because of today's pace of change. Beck却给我们提了一个问题,那些在70年代和80年代也许还能起到效果的方法,他们的经费开销状况(如图1)现在已经发生了变化(如图2),也就是说,维护的成本(也可以等价为不断发生的变化)降低了,而不是越来越高。实际上,图2所示的开销情况在当今是否是事实其实并不重要,重要的是我们必须认识到,如果图1的现象还在继续重演的话,我们只有死路一条,因为当今时代变化实在太快了(也就是说维护的成本将是一个天价)。
The vertical axis in Figure 1 usually depicts the cost of finding defects late in the development cycle. However, this assumes that all changes are the results of a mistake -- i.e., a defect. Viewed from this perspective, traditional methods have concentrated on "defect prevention" in early lifecycle stages. But in today's environment, we can't prevent what we don't know about -- changes arise from iteratively gaining knowledge about the application, not from a defective process. So, although our practices need to be geared toward preventing some defects, they must also be geared toward reducing the cost of continuous change. Actually, as Alistair Cockburn points out, the high cost of removing defects shown by Figure 1 provides an economic justification for practices like pair programming. 图1中的y轴通常用来表示在开发周期的后期发现错误后需要花费的改错成本。可是,这正验证了一个假设,即后期所有需要做的开动均来自前期的一个错误,比方说一个设计缺陷。从这一点来看,传统方法太依赖于在软件生命周期的早期"不出错"。但是在当今瞬息万变的环境中,我们不能完全预防住那些我们预测不到的东西--即由应用需求不断增长而带来的变化,并且这种变化在早期不可能遇见并加以预防。因此,虽然我们要尽可能在早期做出某些应付变化的预防措施,但是更重要的是我们要减少后期改变所带来的开销。正如 Alistai Cockburn 所指出的,需要高成本的图1所示的那种改正缺陷方法,正好从节省开支的角度给了一些实用的方法(如配对编程)一个好的理由。
In this issue of eAD, I want to restrict the discussion to change at the project or application level -- decisions about operating systems, development language, database, middleware, etc., are constraints outside the control of the development team. (For ideas on "architectural" flexibility, see the June and July 1999 issues of ADS.) Let's simplify even further and assume, for now, that the business and operational requirements are known. 在本期eAD杂志中,我打算把讨论定位于项目或应用软件层次上的变化--对类似操作系统、编程语言、数据库、组件等的讨论不在讨论之列。(关于软件结构的灵活性,可以参考ADS杂志1999年6月的那期)另外,让我们进一步做个简化,即假定软件的用户需求已经确定。
Our design goal is to balance the rapid delivery of functionality while we also create a design that can be easily modified. Even within the goal of rapid delivery, there remains another balance: proceed too hurriedly and bugs creep in; try to anticipate every eventuality and time flies. However, let's again simplify our problem and assume we have reached a reasonable balance of design versus code and test time. 我们的目标是既能快速不断的发布新功能,同时又要让软件的设计易于更改。即使是在快速发布这个目标下,仍然需要在"快速发布但Bug丛生"和"面面俱到但旷日持久"之间进行取舍。因此,让我再简化一下我们要讨论的问题,我们假定我们已经在设计、编码和测试这三者之间取得了合理的平衡。
With all these simplifications, we are left with one question: how much anticipatory design work do we do? Current design produces the functionality we have already specified. Anticipatory design builds in extra facilities with the anticipation that future requirements will be faster to implement. Anticipatory design trades current time for future time, under the assumption that a little time now will save more time later. But under what conditions is that assumption true? Might it not be faster to redesign later, when we know exactly what the changes are, rather than guessing now? 在上面这些简化的基础上,还留有一个尾巴:我们在设计时对于未知的未来要看多远?现在的设计已经实现了我们现在想到的一些功能。具有预见性的设计可以使未来的需求更快的获得实现,也就是说预见性设计方法在以现在的时间换取未来的时间,如果一点点现在的时间可以换来未来节约大量时间,当然是划算的。但是这种建设怎么才能成为现实呢?也许未来出了问题就整个重新设计一遍也不慢,那又何必现在瞎猜呢?
This is where refactoring enters the equation. Refactoring, according to author Martin Fowler, is "the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure." XP proponents practice continuous, incremental refactoring as a way to incorporate change. If changes are continuous, then we'll never get an up-front design completed. Furthermore, as changes become more unpredictable -- a great likelihood today -- then much anticipatory design likely will be wasted. 这就是我们为什么要提出重构的原因。重构,Martin Fowler说过,是不改变软件对外表现但是重整内务的一种改进。XP方法的支持者在变化的环境中实践了连续的、增量式的重构方法。如果变化是不断演化的的,那就不可能存在什么一步到位的设计方法。说白了,如果变化不可预测--正如当今社会的情况--过多的在设计时考虑以后可能的变化,完全是一种浪费。 |
|