HN 的朋友们好,我想分享一个想法以及实现它的库。作为《Specification by Example》(也就是 Gojko Adzic 那本名作里描述的概念)的粉丝,我在工作或个人折腾的项目里尝试推广这些理念时遇到了不少挑战。令人意外的是,最困难的部分居然是写 specification……
Hello HN, I'd like to share an idea and a library that implements it. As a fan of "Specification by Example" (as described in Gojko Adzic's renowned book), I faced numerous challenges trying to introduce these ideas at work or in hobby projects. Surprisingly, the most challenging part was writing specifications…
……但更多是为了描述短期的当前工作。BDD 这个词在当下几乎已经被搞臭了,因为它总和特定工具以及自以为是的一整套繁琐流程绑在一起。但如果你把 Specification by Example 理解为带 Given-When-Then 结构的 readme,你就有了一套策略(动笔写代码前先写文档),并结合了一套语言定义,来确保你的策略能在恰当的细节层面上落地执行。……
…but are more for describing active work in short term. BDD is almost a poisoned term at this point because it’s become associated with tooling and opinionated holistic processes. But if you think of Specification by Example as readmes with a Given-When-Then structuring, then you have a strategy (document before writing) combined with a language definition to assure your strategy is executed at the right level of detail.…
……如果 Cucumber 文件本身不会在别处被用到或阅读,那就是徒增工作量。——直接在测试代码里嵌入“Given/When/Then”语句(比如用 RSpec)其实更简单。我想强调的是,Gojko Adzic 的《Specification By Example》建议在提炼成 specification 之前先充分讨论示例;这或许能解决作者抱怨非表格格式无法覆盖重要用例的问题。话虽如此,“Given/When/Then”也算不上……
…is extra effort if the Cucumber files themselves aren't used/read elsewhere. -- It'd be simpler to embed "Given/When/Then" statements within test code (like RSpec). I'd emphasise that Gojko Adzic's "Specification By Example" suggests discussing examples before refining to a specification; that may get around the author's complaint that non-table formats don't allow for important cases. That said, "Given/When/Then" is hardly…
……清晰规格说明的替代品,精心挑选的例子能让规格说明好懂得多。我推荐读读 Gojko Adzic 在这方面的想法(https://www.linkedin.com/in/gojko/)。他是《Specification by Example》的作者。他认为,找出并打磨关键例子,是提升文档质量和团队共识的好办法。
…substitute for a clear specification, well-chosen examples make specs far easier to grasp. I recommend reading Gojko Adzic’s thoughts on this (https://www.linkedin.com/in/gojko/). He’s the author of Specification by Example. He argues that identifying and refining key examples is a great way to raise the quality of documentation and shared understanding.
我挺喜欢 Gojko Adzic 写的《Specification by Example》这本书的,它既算是一份行动宣言,也是教你怎么落地这套做法的指南。
I'm rather fond of a book, Specification by Example by Gojko Adzic, that's partially a manifesto for, and partially a guide to, doing this.
HN 的朋友们好,我想分享一个想法以及实现它的库。作为《Specification by Example》(也就是 Gojko Adzic 那本名作里描述的概念)的粉丝,我在工作或个人折腾的项目里尝试推广这些理念时遇到了不少挑战。令人意外的是,最困难的部分居然是写 specification……
Hello HN, I'd like to share an idea and a library that implements it. As a fan of "Specification by Example" (as described in Gojko Adzic's renowned book), I faced numerous challenges trying to introduce these ideas at work or in hobby projects. Surprisingly, the most challenging part was writing specifications…
……但更多是为了描述短期的当前工作。BDD 这个词在当下几乎已经被搞臭了,因为它总和特定工具以及自以为是的一整套繁琐流程绑在一起。但如果你把 Specification by Example 理解为带 Given-When-Then 结构的 readme,你就有了一套策略(动笔写代码前先写文档),并结合了一套语言定义,来确保你的策略能在恰当的细节层面上落地执行。……
…but are more for describing active work in short term. BDD is almost a poisoned term at this point because it’s become associated with tooling and opinionated holistic processes. But if you think of Specification by Example as readmes with a Given-When-Then structuring, then you have a strategy (document before writing) combined with a language definition to assure your strategy is executed at the right level of detail.…
……如果 Cucumber 文件本身不会在别处被用到或阅读,那就是徒增工作量。——直接在测试代码里嵌入“Given/When/Then”语句(比如用 RSpec)其实更简单。我想强调的是,Gojko Adzic 的《Specification By Example》建议在提炼成 specification 之前先充分讨论示例;这或许能解决作者抱怨非表格格式无法覆盖重要用例的问题。话虽如此,“Given/When/Then”也算不上……
…is extra effort if the Cucumber files themselves aren't used/read elsewhere. -- It'd be simpler to embed "Given/When/Then" statements within test code (like RSpec). I'd emphasise that Gojko Adzic's "Specification By Example" suggests discussing examples before refining to a specification; that may get around the author's complaint that non-table formats don't allow for important cases. That said, "Given/When/Then" is hardly…
……清晰规格说明的替代品,精心挑选的例子能让规格说明好懂得多。我推荐读读 Gojko Adzic 在这方面的想法(https://www.linkedin.com/in/gojko/)。他是《Specification by Example》的作者。他认为,找出并打磨关键例子,是提升文档质量和团队共识的好办法。
…substitute for a clear specification, well-chosen examples make specs far easier to grasp. I recommend reading Gojko Adzic’s thoughts on this (https://www.linkedin.com/in/gojko/). He’s the author of Specification by Example. He argues that identifying and refining key examples is a great way to raise the quality of documentation and shared understanding.