好在网络是强大的、墙外的风光总有美好的。在email、twitter以及group的轮番轰炸下,一切开始出现转机。首先是Julian May向我推荐了Gojko Adzic所著的《Specification By Example》一书,然后是作者Gojko、网友ChrisMatts等人的回复,为我指明了学习的方向。
Specifications by Example为我呈现了一个全新的视角:以Specification、Automation Test以及Living Documentation等文档为中心的交付模型(Documentation-centric model),以及一个由下图所示的交付模式。
随着阅读的不断深入,Why-Who-How-What被Goal-Actor-Impact-Deliverable所代替,其含义也越发地清晰起来:
之前那种依赖于语言本身对How和What进行的讨论,此时便显得如此拙劣。对此,Gojko有这样一段精彩的阐述:
But now I advise people not to think about that, instead to think about impacts and deliverables. Deliverables are stuff you do in your zone of control, impacts are how those things influence actors in your sphere of influence. You can call these questions "what/how" or "how/what" or not think about the questions at all, depending on what the group in the room understands better.
它回答了之前一直困扰我的问题。即What是在开发团队控制范围内的,能对Actor产生影响的那些事物。这些是我们努力就一定能做到的,比如系统能提供的具体功能。而How则是我们期望的、能对Actor产生的影响。这种影响相对开发团队而言,是间接和被动的。对此,Gojko用一个手机App进行了形象的比喻:
Impacts - this is your sphere of influence - things you don't control directly, but things you think you can 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 to build an iPhone App, we will. But if we decide to get people to buy the app on the appstore more, regardless of all our efforts that might not happen. The first one is in our zone of control, the second is in the sphere of influence.
期间我对Business Goal也重新进行了认识。BDD in Action曾用Specific(特定的)、Measurable(可量化的)、Achievable(可实现的)、Relevant(相关的)、Time-bound(有期限的)对其进行说明,而发掘Goal的工具真的是如此简单——不停地问Why……然后,我又重绘了之前的图:
再补上MelvinPerezCx对Impact Map与各种产出件之间关系的一张好图:
继续前进解决了Impact Map的问题,下一步就是思考如何将DDD的战略思考与BDD的战术实现结合起来,引导整个开发的方向。这一切当然地需要用实践来解决,在前进中才能解决遇到的问题,所以暂且只得到以下的一个思路。
DDD+BDD的开发流程: