敏捷建模和极限编程(XP)
Agile Modeling (AM) is a practices-based software process whose scope is to describe how to model and document in an effective and agile manner. On the AM home page I state that one of the goals of AM is to address the issue of how to apply modeling techniques on software projects taking an agile approach such as eXtreme Programming (XP), Dynamic Systems Development Method (DSDM), and Scrum to name a few. Because the scope of XP is much greater than that of AM, XP covers the full development lifecycle, it is a candidate "base process" into which the techniques of AM may be tailored. Furthermore, although XP clearly includes modeling as part of its process it is not as explicit about how to do so as many developers would prefer. Hence an opportunity for AM. Luckily XP, like AM, is also an agile practices-based methodology which makes the conceptual fit between the two methods much easier than between AM and a process such as the Rational Unified Process (RUP) the topic of the article Agile Modeling and the Unified Process.
敏捷建模(AM)是一个实践为基础的软件过程,其范围是描述如何以一个有效和灵活的方式建模和建立文档,在AM主页,我指定AM的目标之一是如何应用软件工程建模技术,如敏捷方法解决的问题,比如极限编程(XP),动态系统开发方法(DSDM),和Scrum等等。因为XP的范围远远比AM大,XP涵盖整个开发生命周期,它是一个候选的AM技术,可定制的“基过程”。此外,虽然XP显然包括建模过程的一部分,但是许多开发人员宁愿不清楚它是如何做到这一点。因此有机会给AM。幸运的是XPAM一样,也是一个灵活的实践为基础的方法,这使得适合之间的两种方法比之间时要容易得多,如统一软件开发过程(RUP)的文章敏捷建模与统一过程的主题。
Table of Contents
目录
Setting the record straight
弄清真相
XP and AM?
XP和AM?
AM throughout the XP lifecycle
AM贯穿整个XP的生命周期
How do you make this work?
你如何做这项工作?
1. Setting The Record Straight
1。弄清真相
There are several common misconceptions that people seem to have regarding modeling on an XP project. The three most common misconceptions are that you don’t model on an XP project, that you don’t document on an XP project, or that if you do model your only options are the modeling artifacts of the UML. I’ll address these misconceptions in turn in this section, but first I want to explore why they occur so that you can recognize other misconceptions when they arise. From what I can gather based on the conversations on the AM mailing list the source of these misconceptions is often the result of one or more of the following:
有几个常见的误解,人们似乎已经对一个XP项目的建模。 3种最常见的误解是,你没有建模在一个XP的项目上,你不记录在一个XP项目上,或者说,如果你做模型的唯一的选择是UML的建模构件。我会在本节轮流来处理这些误解,但首先我想探讨他们为什么会发生的,以便在他们出现时你可以认出其他误解。从我收集的基础上在AM的谈话邮件列表列出这些误解的根源往往是一个或多个以下的结果:
Second-hand knowledge of XP. The Internet is a major source of information for many developers, in particular newsgroups and emails from colleagues. As people learn a new technique they often join a newsgroup or mailing list, such as the extremeprogramming list, and start monitoring the group/list. Someone will post something, which may not be accurate, and many people will accept it as official, particularly when they haven’t had an opportunity yet to try it out for themselves. Don’t believe everything that you hear.
XP过时的知识。互联网是一个许多开发人员信息的主要来源信息,特别是同事的新闻组和电子邮件。随着人们学习一门新的技术,他们往往加入新闻组或邮件列表,如extremeprogramming极限编程列表,并开始监测组或者列表。有人会发表某些东西,这可能是不准确的,很多人会接受它作为官方的,特别是当他们已经没有机会为自己尝试。不要相信你听到的一切。
Questionable sources of information regarding XP. It’s often hard to determine the quality of published material, be it electronic or printed form. Sometimes honest mistakes are made, that’s happened to me more than once, and sometimes people publish misleading information on purpose. When you’re just learning a new subject you often cannot distinguish between high-quality sources of information and questionable ones. If you base your understanding on questionable sources it is very easy to get the wrong idea about XP.
关于XP中的可疑信息来源。这往往很难确定公布的材料的质量,无论是电子或印刷形式。有时候,诚实的错误,这是发生在我身上不止一次,有时人故意发布误导性信息。当你刚开始学习一个新的课题,你往往不能区分高品质的信息来源和可疑的信息来源。如果你根据你对问题的来源的理解,这是很容易得到关于XP的错误观念。
Difficulty seeing beyond their current environment. Many developers find themselves in less-than-ideal environments. XP requires you to adopt practices that are often foreign to your current environment, pair programming and test-first development are new to most organizations, and sometimes these practices simply aren’t feasible to adopt. If you cannot adopt the practice of pair programming then XP isn’t going to work for you, but instead of proclaiming that XP doesn’t work in their environment many people will instead proclaim that XP doesn’t work at all. The reality is that XP does in fact work in the right situations, it is just that your situation may not be one of the right ones.
很难看出超出他们当前的环境下。许多开发人员发现自己在低于理想的环境。XP需要您采取的做法,往往是在当前的环境之外,对结对编程和测试优先开发的大部分组织是新的,有时这些做法根本是不可行的采用。如果你不能通过结对编程的实践,然后XP是不会为你工作,但很多人宣布XP根本不能用,而不是宣布XP并不在他们的环境中工作。现实的情况是,XP的确能工作在合适的情况下,事实上,这仅是您的具体情况可能并非正确做法中的一种。
Too much focus on the word “extreme”. XP’s name is both one of its greatest strengths its greatest weaknesses. Because of the name when some people hear XP’s advice to travel light, to reduce the amount of documentation that you create and maintain, that they instead translate it to “create no documentation at all”. That’s extreme, right? Or they’ll hear XP’s advice to use simple modeling techniques such as user stories and CRC cards and somehow translate that advice to “you don’t model at all.” That’s extreme, right? Sigh.
过多集中于“极限”的字。 XP的名字,既是其最大的优点,亦是其最大的弱点之一。因为当一些人听到XP的意见来轻装上阵,以减少您所创建和维护的文档的数量,,他们反而把它翻译为“根本不用创建文档”。这就是极限,对吗?或者他们会听到XP的意见去一些简单的建模技术,比如用户故事和CRC卡(注:Class类别, Responsibility责任, Collaborator辅助者),或者换种方式说“你根本不必建模”这就是极限,对吗?哎.
In this section I will set the record straight regarding the three most common issues concerning modeling and XP:
在本节中,我将弄清楚最常见的三种关系建模和XP的问题:
Modeling is Part of XP
建模是XP的一部分
Documentation happens
建立文档的发生
XP and the UML?
极限编程和统一建模语言?
1.1 Modeling is Part of XP
1.1 建模是XP的一部分
User stories are a fundamental aspect of XP and artifacts such as Class Responsibility Collaborator (CRC) cards are common to XP efforts. User stories provide a high-level overview of the requirements for a system -- they are reminders to have a conversation with your project stakeholders regarding their requirements -- and are used to as a primary input into estimating and scheduling, and drive the development of acceptance test cases. CRC cards are used to explore structure, perhaps for conceptual modeling to understand the problem domain or for design to work through the structure of your software. User stories and CRC cards are both models, see the Artifacts for AM article, so therefore modeling is clearly a part of XP. XP developers will also create sketches, often on a whiteboard or a piece of paper, whenever user stories and CRC cards aren’t the best option. In Extreme Programming Explained, the first book written about XP, Kent Beck includes hand-drawn sketches of class diagrams and other free-form diagrams. In fact, in the second edition he includes a mind map in the inside cover overviewing XP. The bottom line is that modeling is a fundamental aspect of XP, something that I explore in detail in this article.
用户故事是XP和加工品的基本方面,如类责任合作者(CRC)卡对XP的努力来说是很普遍的。用户故事为一个系统需求提供了高层次的概述 - 他们有一个与您的项目利益相关者对他们的要求谈话提醒 - 被用来作为主要输入到估计和调度,并推动发展验收测试用例。 CRC卡是用来探讨结构,也许是为概念建模的理解问题域,或通过你的软件的结构来设计工作。用户故事和CRC卡都是模型,请参阅我的文章的加工品,因此建模显然是一个XP的一部分。 每当用户故事和CRC卡是不是最好的选择,XP的开发者也将创建草图,经常在白板上或一块纸上。在极限编程已说明过的,关于XP编写的第一本书,Kent Beck包括类图和其他*形式的图的手绘草图。事实上,他在第二版包括在里面覆盖概览XP的脑海映像。底线是,建模是一个XP的基本方面,我在这篇文章中详细探讨。
1.2 Documentation Happens
1.2 建立文档的发生
Documentation is also an important part of XP. Ron Jeffries offers the following advice:
文件也是一个XP的重要组成部分。罗恩·杰弗里斯提供以下建议:
“Outside your extreme programming project, you will probably need documentation: by all means, write it. Inside your project, there is so much verbal communication that you may need very little else. Trust yourselves to know the difference.”
"极限编程项目外,你可能会需要的文件:通过各种手段,把它写出来。在你的项目中,有这么多的口头沟通,而您可能需要很少其他的。相信自己知道其中的差别。"
There are several interesting implications of that statement. First and foremost, the XP community recognizes that documentation should be produced for people external to your team, people that AM would term project stakeholders. Second, it points out that verbal communication between team members reduces the need for documentation within the team. This is the result of project team members being co-located, making communication easier, as well as aspects of XP such as Pair Programming and Collective Ownership that promote communication between developers. As I discuss in the article on Communication documentation is only one form of communication, one that is typically the least effective, that can be easily replaced by more effective techniques such as face-to-face communication. Third, it recognizes that sometimes you do in fact need internal documentation for your team. This is consistent with the advice presented in Extreme Programming Installed where the authors point out that information resulting from conversations with your project stakeholders regarding user stories are captured as additional documentation attached to the card. More on this in the Section A Closer Look At the XP Lifecycle. Fourth, it suggests that XP team members should know when documentation is required and be allowed to act accordingly. Fifth, it implies that you should trust the team and give them control over their own destiny. This can be hard in many organizations. If the team is untrustworthy then you have a serious problem that needs to be dealt with, this is true regardless of whether they are following XP, or if they are trustworthy but your organizational culture doesn’t allow you to act based on that trust then once again you have a serious problem to deal with. Another problem is that when you are an outsider to an XP team, when you haven’t been actively involved in the conversations and interactions that have replaced the need for documentation, that it appears that there isn’t enough documentation. When this is the case, instead of forcing the team to write documentation instead invest the time to determine if they need the documentation that you believe is missing – suggest the documentation to the team, and if there is an actual need for it then they’ll create it. As Ron Jeffries likes to say, “It’s called Extreme Programming not stupid programming”. Finally, the most important implication for XP teams is that if you need documentation then write it.
声明有一些有趣的影响。
首先,XP社会认识到,文件应为你的团队外部的人,那些人,是我会长期项目的利益相关者产生。
第二,它指出,团队成员之间的口头沟通,减少了队内的文档需要。这是项目团队成员的合作,使沟通更容易,以及XP的方面,如对编程和集体所有权,促进开发商之间的沟通。正如我在文章中讨论通讯文件是只有一种形式的沟通,一个是一般至少有效,可以如面对面沟通,更有效的技术容易被取代。
第三,它承认,有时你事实上,确实需要为您的团队的内部文件。这是极限编程提出的意见是一致的安装在那里的作者们指出,信息与项目利益相关者的对话关于用户故事捕获卡连接到其他文档。在此更在第一个关于建立更紧密看看XP的生命周期。
第四,建议XP团队成员应该知道什么时候文件是必需的,是允许采取相应的行动。第五,它意味着,你应该信任的团队,并给予他们控制自己的命运。在许多组织中,这是很难。如果球队是靠不住的,那么你有一个严重的问题,需要处理,这是真实的,不管他们是否遵循XP,或者如果他们是值得信赖的,但您的组织文化不允许你,信任的基础上采取行动,然后再一次,你有一个严重的问题来处理。
另一个问题是,当你是一个XP团队,局外人当你有没有积极参与谈话相互作用,已经取代了对文档的需要,似乎没有足够的文件。何时这种情况下,而不是迫使团队写文档,而不是投资,如果他们需要时间来确定您认为是文件丢失 - 建议文档队,如果有实际需要为它然后,他们将创建它。正如罗恩·杰弗里斯喜欢说,“这就是所谓的极限编程没有愚蠢的编程”。
最后,XP团队最重要的意义是,如果您需要的文件,然后把它写入。
The need for documentation on an XP project is reduced by several of its practices. First, because of test-first development and a focus on acceptance testing there is always a working test suite that shows that your system works and fulfills the requirements implemented to that point. For the developers, these tests act as significant documentation because it shows how the code actually works. When you think about it, this makes a lot of sense. When you are learning something new do you prefer to read a bunch of documentation or do you look for source code samples? Many developers prefer to start at source code samples, and the test suite provides these samples. Second, XP’s focus on simplicity and practice of refactoring result in very clean and clear code. If the code is already easy to understand, why invest a lot of time writing documentation to help you to understand it? This applies to both internal and external documentation – why add comments to code that is already clear and unambiguous? If the code isn’t so, then refactor it to improve its quality or as a last resort write documentation. Even though some development environments make it easy to include documentation in your code, Java’s Javadoc utility is such an example, you only want to invest in documentation when it makes sense to do so and not just because it is easy.
一个XP项目的文档需要减少一些做法。
首先,因为测试先行的开发和验收测试的重点始终有一个工作的测试套件,表明你的系统的工作原理和满足的要求落实到这一点。对于开发商,这些测试作为显著的文档,因为它显示了如何实际工作的代码。当你想想看,这使得很多的意义。当你学习新的东西,你喜欢读一堆文件,或者你看看源代码样本?许多开发人员喜欢源代码样本,并开始测试套件提供了这些样品。
第二,XP的非常干净,清晰的代码重构结果的简单和实践上的焦点。如果代码已经是很容易理解,为什么投资了很多时间写文档,以帮助你了解它吗?这适用于内部和外部的文件 - 为什么添加代码,已经是明确和毫不含糊的意见?如果代码是不是这样,然后重构它,以提高其质量或作为最后的手段写文件。即使一些开发环境中可以很容易包括在您的代码中的文档,Java的javadoc工具是一个这样的例子,你只希望在文档中进行投资时是有意义的这样做,不仅因为它很容易。
What confuses many people regarding XP and documentation is that XP doesn’t specify potential documents to create during development. This is unlike the RUP which suggests a slew of potential project artifacts. Instead, the suggestion is to work together with your project stakeholders in an environment of rapid feedback and trust them to determine the things that they need, not just documents but any type of project enhancements. Once again, you need to have the courage to trust the people involved with the project. In the article Agile Documentation I discuss a collection of documents that you may choose to create and provide advice for when to consider creating them.
什么迷惑了许多人关于XP的文件是XP不指定潜在的开发过程中创建的文件。这是不同于RUP,这意味着一个潜在的项目工件的回转。相反,建议是与项目利益相关者在一个快速反馈的环境共同努力,相信他们能够确定的事情,他们需要的不只是文件,但任何类型的项目增强。再次,你需要有这样的勇气,信任与参与该项目的人。敏捷文档在文章中,我讨论的文件的集合,您可以选择以创建和提供建议时,要考虑他们创造的。
One of the greatest misunderstandings people have about XP regards concept of traveling light – many people believe that it means you don’t create any documentation, but nothing could be further from the truth. What traveling light actually means is that you create just enough models and documentation, too little or too much puts you at risk. As I suggest in Agile Documentation a good rule of thumb to ensure that you’re traveling light is that you shouldn’t create a model or document until you actually need it – creating either thing too early puts you at risk of wasting your time working on something you don’t actually need yet.
一个最大的误解,人们对XP有一个轻装上阵的概念 - 许多人认为,这意味着你不创建任何文件,但没有可能进一步从真相。轻装上阵,实际上是指的是你创建只是足够模型和文件,太少或太多置于风险之中。我建议在敏捷文档的一个很好的经验规则,以确保你轻装上阵,你不应该创建一个模型或文件,直到你真正需要它 - 创造任何东西,过早让你在浪费你的时间工作的风险你但实际上并不需要。
An important thing to understand about documentation on an XP project is that it is a business decision, not a technical one. This is consistent with AM’s philosophy regarding documentation, discussed in Agile Documentation. Jeffries says it best:
一个XP项目的文档了解一件重要的事情是,它是一个商业决定,而不是一个技术之一。这是AM的理念敏捷文档中所讨论的有关文件,一致。杰弗里斯说,最好的:
“If there is a need for a document, the customer should request the document in the same way that she would request a feature: with a story card. The team will estimate the cost of the document, and the customer may schedule it in any iteration she wishes.”
如果有需要的文件,客户应以同样的方式,她会要求功能要求文档:用一个小故事卡。该小组将估计文件的成本,客户可以安排她希望在任何迭代。
1.3 XP and The UML
1.3 极限编程和统一建模语言?
See the article XP and the UML? Clearly the Wrong Question to be Asking
看到这篇文章XP和UML?显然问错了问题
2. AM and XP?
2. AM和XP?
AM should be tailored into an existing, full lifecycle methodology, in order to improve its approach to modeling. Because modeling is clearly a part of XP, see above, the potential exists for AM to add value to an XP project. This assumes of course that there is possible to tailor AM into XP, I believe it is and argue so below, and that you can do so without detracting from what currently exists within XP. In particular, XP’s practices of refactoring and test-first development clearly do a very good job of filling in for two critical goals – promoting clean design and thinking through your design before writing code – that are typically associated with traditional modeling processes. My experience is that both refactoring and test-first development are complementary to AM and arguably enablers of several AM practices, as I argue below. In this section I explore the following issues:
AM应调整到一个现有的,完整的生命周期方法,以改善其建模方法。因为模型显然是一个XP的一部分,见上面,存在潜在AM添加一个XP项目的价值。这当然假设是有可能进入XP定制AM,我相信这是认为这样下面,你可以做而不减损目前在XP中存在。特别是,重构和测试优先发展的XP的做法显然填补两个关键目标的一个非常好的工作 - 促进您的设计,编写代码之前,洁净的设计与思考 - 通常与传统的建模过程。我的经验是,重构和测试优先发展是相辅相成的,我可以说是几个AM做法引擎,我认为以下。在本节中,我探讨了以下问题:
The potential fit between AM and XP
AM和XP之间的潜在适合
Refactoring and AM
重构和AM
Test-first development and AM
测试先行的开发和AM
Which AM practices to adopt?
我将采取哪种AM实践?
2.1 The Potential Fit Between AM and XP
2.1 AM和XP之间的潜在适合
A critical issue that must be addressed is how well AM fits with XP. Table 1 lists the practices of AM and either maps them to existing principles or practices of XP or discusses the potential fit of the AM practice when it is not explicitly a part of XP. Because XP was used as a foundation for AM many of the practices map straight to XP. However, because AM’s focus is on modeling several practices are clearly new, hence the potential for AM to bring value to an XP project.
必须解决的一个关键问题是如何我适合用XP。表1列出了AM的做法和他们现有的原则或XP的做法,或讨论潜在的合适的AM实践时,它是没有明确的XP的一部分或者地图。因为XP是用一个AM的基础的做法,许多映射直接到XP。然而,因为AM的工作重点是模拟几种做法显然是新的,因此潜在AM的XP项目带来价值。
Table 1. Applicability of AM Practices on an XP Project.
表1。在一个XP项目上AM实践的适用性。
AM Practice 敏捷建模实践 |
Fit With XP 适用于极限编程 |
Active Stakeholder Participation 利益有关者积极参与 |
This practice is simply a new take on XP’s On-Site Customer practice. AM uses the term project stakeholder in place of customer and focuses on the concept of their active participation, hence Active Stakeholder Participation and not On-Site Stakeholder. 这种做法简直是对XP的现场客户实践的新的起飞。AM在顾客的地方使用的长期项目的利益相关者,并着重对他们的积极参与,因此活动的利益相关者的参与,而不是网站上的利益相关者的概念。 |
应用建模标准 |
This is the AM version of XP’s Coding Standards practice. 这是AM版XP的编码标准的做法。 |
轻量级应用模式 |
This practice reflects the YAGNI principle to the effective application of patterns within your system, in conformance to XP’s practice of Simple Design. 这种做法反映YAGNI原则模式的有效应用在您的系统,符合XP的设计简单的做法。 |
采用正确的加工品 |
This practice is not explicitly described by XP principles and practices although is very much aligned with XP philosophies of “if you need it do it” and using the most appropriate tool or technique for the job at hand. 这种做法是不明确XP的原则和做法,虽然是非常与XP的哲学相一致的“,如果你需要做”,用手头的工作最合适的工具或技术。 |
集体拥有权 |
AM has adopted XP’s Collective Ownership practice. AM已通过XP的集体所有权的实践。 |
Create Several Models in Parallel 创建并行的几种模式 |
This is a modeling-specific practice. XP developers can clearly work on several models – such as CRC cards, acceptance test cases, and sketches – if they choose to do so. 这是一个建模的具体实践。 XP开发人员可以清楚地工作的几种模式 - 如CRC卡,接受测试的情况下,和草图 - 如果他们选择这样做。 |
创建简单的内容 |
This is complementary XP’s Simple Design practice that advises to keep your models as simple as possible. 这是互补XP的简单设计的做法,建议保持尽可能简单的模型。 |
简单地描绘模型 |
This is complementary XP’s Simple Design practice that suggests that your models do not need to be fancy to be effective, perfect examples of which are CRC cards and user stories. 这是相辅相成的XP的简单设计实践表明,你的模型不需要看中的是有效的完美的例子,这是CRC卡和用户故事。 |
丢弃临时模型 |
This practice reflects XP’s Travel Light principle, which AM has adopted, explicitly advising you to dispose of models that you no longer need. 这种做法反映了XP的轻装上阵的原则,AM已通过,明确建议你,你不再需要处理模型。 |
公开显示模式 |
This practice reflects XP’s (and AM’s) value of Communication, principle of Open & Honest Communication (adopted by AM), and reflects its practice of Collective Ownership. 这种做法反映了XP的(和AM)通信,开放和诚实的沟通原则(被AM采纳)的价值,并反映其集体所有权的实践。 |
正式联系模型 |
This practice is not currently reflected within XP, well perhaps in its “if you need to then do it” philosophy. This practice was included in AM to provide guidance for how to deal with the very common situation of integrating with other systems. 这种做法目前尚未反映在XP中,或许在其“如果你需要,然后做”的经营理念。这种做法被列入我对于如何处理与其他系统集成的很常见的情况提供指导。 |
迭代到另一个加工品 |
This practice explicitly states, in a general form, the practice of XP developers to iterate between working on various artifacts such as source code, CRC cards, and tests. 这种做法明确规定,在一般的形式,XP的开发实践迭代之间的各种文物,如源代码,CRC卡,测试工作。 |
以较小的增量模型 |
This practice supports XP’s iterative and increment approach to development. Both XP and AM prefer an emergent approach to development and not a big design up front (BDUF) approach. 这种做法,支持XP的迭代和递增的发展方针。 XP和AM都喜欢发展的应急办法,不是前面的大设计(BDUF)方法。 |
与其他模型 |
This is the AM version of XP’s Pair Programming practice. 这是AM版XP的结对编程实践。 |
用代码证明 |
This is the AM version of XP’s Concrete Experiments principle. In fact, it was originally called Concrete Experiments although was renamed when it was evolved into a practice. 这是AM版XP的原则混凝土实验。事实上,它最初被称为具体的实验虽然改了名,当它被演变成一种做法。 |
重用现有的资源 |
This concept is not explicitly included in XP, although it clearly isn’t excluded either. XP developers are practical, if there is something available that can be appropriately reused then they will likely choose to do so. 这个概念没有明确包括在XP中,虽然这显然是不排除。 XP的开发是可行的,如果有东西可用可适当重用,那么他们很可能会选择这样做。 |
Single Source Information 单源的信息 |
The goal of storing information in a single place reflects the XP concept of traveling light. 将信息存储在一个地方的目标,反映的轻装上阵XP的概念。 |
仅当触碰到是更新 |
This practice reflects AM and XP’s Travel Light principle, advising that you should only update an artifact only when you desperately need to. 这种做法反映了AM和XP的旅行轻的原则,建议你应该只更新一个神器,只有当你迫切需要。 |
使用简单的工具 |
This practice reflects AM and XP’s Assume Simplicity principle and is consistent with XP’s preference for low-tech tools such as index cards for modeling. 这种做法反映了AM和XP的简单性原则,是XP的低技术手段,如建模的索引卡的偏好是一致的。 |
The fact that AM’s practices are complementary to XP isn’t sufficient; there should also be a philosophical alignment between the two methodologies as well. I believe that there is. First, AM has adopted the four values of XP – Courage, Simplicity, Communication, and Feedback – and added a fifth one, Humility, one that is clearly compatible with XP. Second, the principles of AM are closely aligned with those of XP. Nine of eighteen are adopted directly from XP, and the remaining ones – Software is Your Primary Goal, Enabling the Next Effort is Your Secondary Goal, Model With a Purpose, Multiple Models, Content is More Important Than Representation, Everyone Can Learn From Everyone Else, and maximize stakeholder ROI – are clearly compatible with XP’s philosophies. The three modeling-specific principles may cause a hard-core XP developer to pause for a moment, but on reflection should not prove arguable. Model With a Purpose advises that you shouldn’t work on a model without good cause, Multiple Models says that you have a wide range of techniques available to you that you may choose to apply (including but not limited to CRC cards, user stories, and the diagrams of the UML).
事实上,AM的做法是相辅相成的XP是不够的,以及两者之间的方法也应该是一个有哲学对齐。我相信有。首先,AM已通过XP的四个价值观 - 勇气,简单,沟通,反馈 - 增加了五分之一,谦逊,一个显然是与XP兼容。第二,AM的原则与XP中的密切配合。八九十是通过直接从XP,其余的 - 软件是你的首要目标,使下一步的努力是你的第二个目标,模型的目的,多种模式,内容更重要比表示,每个人都可以学习别人和最大化利益相关者的投资回报率 - 显然是与兼容XP的理念。三种建模的具体原则可能会导致暂停硬核XP片刻开发的,但反思不应该证明值得商榷。模型有目的的建议,你不应该无正当理由工作模型,多模型,说你有一个广泛的技术提供给您,您可以选择适用于(包括但不限于CRC卡,用户故事,和UML的图)。
2.2 Refactoring and AM
2.2重构和AM
Refactoring is a technique to restructure code in a disciplined way, a technique that is a fundamental practice of XP. The basic idea is that you make small changes to your code, called refactorings, to support new requirements and/or to keep your design as simple as possible. The advantage of refactoring is that it enables programmers to safely and easily evolve their code to fulfill new requirements or to improve its quality.
重构是一种技术来重组一个有纪律的方式,这是一个XP的基本实践的技术代码。基本的想法是,你做小改动你的代码,称为重构,以支持新的要求和/或保持你的设计尽可能简单。重构的好处是,它使程序员可以轻松,安全地发展他们的代码,以满足新的要求,以提高其质量。
Is refactoring compatible with AM? Yes. Refactoring is a coding technique whereas AM does not address programming-related issues, therefore there is no technical overlap between the two. What about a conceptual overlap? AM address design modeling and refactoring addresses design improvement of source code. This begs the question “What do you do when you have an existing design model and you refactor your code?” Although it’s an interesting question, the real issue is that you have two artifacts, a design model and source code, that describe the design of your system. One has changed, the source code, now you need to decide whether or not you wish to update the model. The way that you originally arrived at the model is irrelevant to this issue, you could have gotten there because you took an AM approach to develop it, you could have taken a BDUF approach, or you could adopted an existing model and are coding to it (for example, several organizations have developed persistence frameworks based on the design that I present at http://www.ambysoft.com/persistenceLayer.html). The issue is irrelevant of the type of design model, be it a UML class diagram, CRC cards, a physical data model, or a procedural structure chart. The good news is that AM provides advice for how to deal with such a situation, in particular the practice Discard Temporary Models suggests that you should consider whether you really need the design model and then if not get rid of it and the practice Update Only When it Hurts suggests that it’s often reasonable to have artifacts such as the design model and the code out of sync.
重构与AM是兼容的?是。重构是一种编码技术,而我并没有解决编程相关的问题,因此,两者之间是有没有技术的重叠。一个概念的重叠是什么?地址设计模型和重构地址的源代码的设计改进。这引出的问题:“你做什么时,你有1现有的设计模式和你重构你的代码”虽然这是一个有趣的问题,真正的问题是,你有两个工件,一个设计模型和源代码,描述设计您的系统。一个已经改变,源代码,现在您需要决定您是否要更新模型。您最初在到达模型的方式是与这个问题无关,你可以得到,因为你拿了一个AM的方法来开发,可以采取BDUF方法,或者你可以通过现有的模型和编码(例如,一些组织已经开发出持久性框架的基础上设计的,我目前在http://www.ambysoft.com/persistenceLayer.html)。问题是设计模型的类型无关,它是一个UML类图,CRC卡,物理数据模型,或者程序结构图。好消息是,AM提供如何处理这种情况的意见,特别是实践丢弃临时模型表明,你应该考虑你是否真的需要设计模型,然后如果不摆脱它与实践的更新只当它伤害的建议,它是合理的,有文物,如设计模型和代码同步。
So how do you apply AM and refactoring together? Simple. Apply AM practices as appropriate when you are modeling, use those models as input into your programming efforts, and refactor your code as you normally would have. If you discover that you need to attempt a major refactoring, get the team together to discuss it, modeling whenever appropriate, then approach the major refactoring as you would have in the past: as a collection of small refactorings.
那么,你如何适用于AM和重构?简单。申请我建模时你输入到你的编程工作,使用这些模式,并重构您的代码,你通常会在适当的做法。如果你发现你需要尝试一个重大的重构,得到团队一起讨论,建模,然后适当的时候方法的主要你将不得不在过去的重构:作为一个小的重构集合。
建模工具,逆向工程的代码可以被证明是有价值的,当你重构代码,尤其是当你不熟悉的代码。许多开发商认为,在视觉上,他们掌握更容易比他们传达文本信息,通过图片传达的信息,因此CASE工具,快速导入的代码位,并从他们创建图表是非常有用的。CASE工具导入Java编写的面向对象的源代码,也许这是相当普遍的或C + +,生成UML类图显示的代码和UML序列图的描绘,其动态性质的静态结构。这些图可用于快速理解现有的代码,在重构的第一步。
2.3 Test-First Development and AM
2.3 测试先行的开发和AM
Test-first development is a development practice where you work in very short cycles where you consider a test, write the test and business code for it, get it to work, then continue. These tests are collected into a development integration testing suite that must be successfully run whenever code is submitted into your shared repository. This practice is integral to XP.
你在很短的周期,你认为测试工作,测试先行的开发是一个发展的实践,写的测试和业务代码,得到它的工作,然后继续。这些测试收集到的发展集成测试套件必须成功运行时代码提交到您的共享库。这种做法是不可或缺的XP。
Is test-first development compatible with AM? Yes. Like refactoring, test-first development is more of a coding practice so there is little opportunity for technical overlap. However, there is room for conceptual overlap because test-first development clearly delves into the realm of detailed design since it provides developers with an opportunity to think through their code before they write it (as well as important feedback regarding their code). If you’ve chosen to do a little modeling before writing your code, perhaps to think through an issue larger than a single test case, then that’s okay. In fact, it may even make your test-first development efforts easier, because you've thought things through better.
测试先行的开发与AM兼容吗?是。像重构,测试先行的开发是一个编码实践,因此有技术重叠的机会很少。然而,有概念重叠的地方,因为测试先行的开发明确详细设计领域的深入研究,因为它提供了一个机会,想通过他们的代码之前,他们把它写(以及重要的反馈,对他们的代码)的开发。如果你选择了编写代码之前,做一点点的模型,也许是想通过一个问题大于一个测试用例,然后没关系。事实上,它甚至可以使您的测试先行的开发方面的努力,更容易,因为你想通过更好的东西。
How do you apply AM within a test-first development environment? As with refactoring, simply apply AM practices as appropriate when you are modeling, use those models as input into your programming efforts, and iterate between modeling, testing, and programming as needed. For more details, read the AMDD article.
如何申请我在测试先行的开发环境?至于与重构,简单地套用AM在适当的做法,当你建模,输入到你的编程工作中使用这些模型,迭代建模,测试和编程之间需要。有关详细信息,请阅读的AMDD文章。
2.4 Which AM Practices to Adopt?
2.4 采用哪种AM实践?
Only the ones that add value to what your team is trying to accomplish. Ideally that will at least be the core practices of AM, therefore it would be fair to claim that you are in fact “doing AM”, and perhaps even adopt the supplementary practices as well. It is important to note that your goal isn’t simply to be able to say that you’re agile modeling, it is to improve your productivity as software developers.
只有你的团队,努力实现增加值。理想的情况下,将至少是AM的核心做法,因此这将是公平的要求,事实上,“做AM”,甚至采取补充的做法,以及。重要的是要注意,你的目标不只是要能说,你是敏捷建模者,它是作为软件开发人员来改善您的生产力。
3. AM Throughout the XP Lifecycle
3. AM贯穿整个XP的生命周期
To explain how the practices of AM can be applied on an XP I will work through a portion of the SWA Online Case Study and show how modeling is used throughout the XP lifecycle in the article AM and XP: AM Throughout the XP Lifecycle.
解释如何使AM实践可以应用在一个XP上,我将努力通过部分的SWA在线为例,展示如何建模是整个XP的生命周期在AM和XP的文章:在整个XP的生命周期。
4. How Do You Make This Work?
4. 你如何做这项工作?
How should you approach modeling during development on an XP project? Beck suggests that you should apply the XP practice of Small Initial Investment and draw a few pictures at a time. He states that the XP strategy is that anyone can design with pictures all they want, but as soon as a question is raised that can be answered with code then the designers must turn to code for the answer. In other works you should then seek Rapid Feedback to discover whether your pictures are on target by following the AM practice Prove it With Code.
你应该如何对待一个XP项目的开发过程中的建模?贝克建议,你应该适用于小的初始投资的XP实践和时间绘制了几张图片。他指出,XP的策略是,任何人都可以设计图片所有他们想要的,但只要作为一个问题提出,可以用代码回答,然后设计者必须把答案代码。在其他作品中,你应该寻求快速反馈,发现你的照片是否目标是通过以下的AM实践证明它的代码。
When should you consider modeling during development on an XP project? Whenever creating a model is more effective that writing code. In other words, follow the AM principle maximize stakeholder ROI and the AM practice Apply the Right Artifact(s).
当你应该考虑一个XP项目的开发过程中的建模?每当创建一个模型是更有效地编写代码。换句话说,按照AM的原则,最大限度地发挥利益相关者的投资回报率和采用正确的加工品的AM实践。
How should you model? Follow AM’s practice Use the Simplest Tools and prefer tools such as index cards, whiteboards, and Post It notes over more complicated CASE tools. Simple tools tend to promote interaction and communication, two factors that are critical to your success. Although XP favors the use of index cards to record user stories, CRC models, and story tasks there is nothing wrong with using a CASE tool as long as its use provides positive value to your effort.
你应该如何建模?遵循AM的实践,用最简单的工具和喜欢索引卡,白板等工具,并张贴注意到以上的更复杂的CASE工具。简单的工具,往往促进互动和交流,您的成功是至关重要的两个因素。尽管XP有利于使用索引卡来记录用户的故事,CRC模型,和剧情任务,只要使用一个CASE工具,它的使用提供了积极的价值你的努力没有错。
How should you document? XP teams prefer to write clean, easy-to-understand source code – their philosophy is that only the source code is in sync with the source code. However, remember that AM’s principle Model With A Purpose states that you should understand the needs of a model/document’s audience. If the audience for documentation is your system’s users or your senior management then clean source code isn’t going to do it, instead you will need to develop external documentation for this audience. Your stakeholders should request this documentation and should understand the costs involved, one of which is the fact that any time you spend writing documentation isn’t spent writing software, and be willing to accept those costs.
你应该如何记录?XP团队喜欢写干净,易于理解的源代码 - 他们的理念是,只有源代码是在与源代码同步。但是,请记住,我的原则与目的国模型,你应该了解模型/文档的观众的需求。如果观众文件系统的用户或高级管理人员,然后干净的源代码不打算这样做,而不是你将需要开发这个观众的外部文档。你的利益攸关方应请求这个文件,并应了解所涉及的费用,其中之一是没有花任何时间花在编写文档编写软件,并愿意接受这些费用的事实。
XP developers need to recognize that you can model on an XP project, that modeling is in fact a part of XP already with its existing application of user stories and CRC cards. More importantly, XP developers must abandon any preconceived notions that they may have about modeling - that big modeling up front (BMUF) is the only approach to modeling, that models are permanent documents that must always be updated, that you need to use complex CASE tools to model, and that the UML defines the only models available to you - and approach modeling from a new perspective. One such perspective was presented in this article, that you can tailor Agile Modeling (AM) into a software process based on eXtreme Programming (XP) and still remain effective as software developers.
XP开发人员需要认识到,你可以模拟一个XP项目,该模型实际上是一个XP的一部分已经与现有的应用程序其用户故事和CRC卡。更重要的是,XP的开发必须摒弃任何先入为主的观念,他们可能有大约建模 - 大,前面建模(BMUF)的模型,模型是必须始终更新的永久文件是唯一的办法,你需要使用复杂的情况下工具的UML模型,并定义唯一的车型为您提供 - 从一个新的视角和方法建模。这样一个观点,在这篇文章中,你可以定制敏捷建模(AM)到极限编程(XP)的基础上,仍然有效的软件开发商的软件过程。
Reference sit: http://www.agilemodeling.com/essays/agileModelingXP.htm