而且在这个过程中,如果说找出Why和Who还不算难事,那么要挖出How与What则让我大费周张。在
书中,作者对How的部分引入了Capability的概念,并建议参照Liz Keogh的观点,以”to be able to”的形
式来描述。而对What的部分,作者则引入了Feature的概念,强调这里描述的应该是系统能以何种方式
帮助特定角色实现相应的Capability。
于是当我按图索骥时,却再一次陷入了教条主义的泥沼,搞不清什么应该放在How、什么又该放在Wha
t里。而致使我陷入被动的另一个因素,则是我发觉中英文在表达How与What时语义上存在的混淆。比
如”它会怎样改变?(How should it change?)“与”它会发生什么样的改变?(What should be the cha
nge in it?)”,你能分得清这两者有什么真正的区别吗?
尽管我反复阅读BDD in Action第3章和第4章,但我那可怜的英语阅读能力并未能帮助我顺利摆脱How
与What的纠结。
柳暗花明
好在网络是强大的、墙外的风光总有美好的。在email、twitter以及group的轮番轰炸下,一切开始出现
转机。首先是Julian May向我推荐了Gojko Adzic所著的《Specification By Example》一书,然后是作者
Gojko、网友ChrisMatts等人的回复,为我指明了学习的方向。
在此有点题外话,一是BDD in Action著书于Specification by Example之后,其第3、4章的内容已经撷
取了后者的精华,却不知为何没有使用Gojko所提倡Impact和Deliverable的概念。二是Specification by
Example已有中译本《实例化需求:团队如何交付正确的软件》,由人民邮电出版社出版,我的英文
书摘亦将另行整理,以作对照。
Specifications by Example为我呈现了一个全新的视角:以Specification、Automation Test以及Living
Documentation等文档为中心的交付模型(Documentation-centric model),以及一个由下图所示的
交付模式。
Why – Goal - Why do you want this product? 为什么会需要这款产品?
Who – Actor - Who can help or obstruct us? 谁会帮助或妨碍我们?
How – Impact - How will they be impacted? 这会对他们产生什么样的影响?
What – Deliverable - What will the feature do to support the desired impact? 这个功能将如何产生期望
中的影响?
之前那种依赖于语言本身对How和What进行的讨论,此时便显得如此拙劣。对此,Gojko有这样一段精
彩的阐述:
But now I advise people not to think about that, instead to think about impacts and deliverables. Delive
rables are stuff you do in your zone of control, impacts are how those things influence actors in your s
phere of influence. You can call these questions "what/how" or "how/what" or not think about the que
stions at all, depending on what the group in the room understands better.
Impacts - this is your sphere of influence - things you don't control directly, but things you think you ca
n influence. Deliverables - this is your zone of control. The big question to differentiate between the two
is: is there an assumption here, or are we guaranteed to achieve it if we decide to do it. Eg if we decide t
o build an iPhone App, we will. But if we decide to get people to buy the app on the appstore more, reg
ardless of all our efforts that might not happen. The first one is in our zone of control, the second is in t
he sphere of influence.
期间我对Business Goal也重新进行了认识。BDD in Action曾用Specific(特定的)、Measurable(可量化
的)、Achievable(可实现的)、Relevant(相关的)、Time-bound(有期限的)对其进行说明,而发掘
Goal的工具真的是如此简单——不停地问Why……然后,我又重绘了之前的图: