A paradox of requirements specifications as dominantly practiced in the industry is that they often claim to be object-oriented (OO) but largely rely on procedural (non-OO) techniques. Use cases and user stories describe functional flows, not object types. To gain the benefits provided by object technology (such as extendibility, reusability, reliability), requirements should instead take advantage of the same data abstraction concepts - classes, inheritance, information hiding - as OO design and OO programs. Many people find use cases and user stories appealing because of the simplicity and practicality of the concepts. Can we reconcile requirements with object-oriented principles and get the best of both worlds? This article proposes a unified framework. It shows that the concept of class is general enough to describe not only "objects" in a narrow sense but also scenarios such as use cases and user stories and other important artifacts such as test cases and oracles. Having a single framework opens the way to requirements that enjoy the benefits of both approaches: like use cases and user stories, they reflect the practical views of stakeholders; like object-oriented requirements, they lend themselves to evolution and reuse.
翻译:工业界普遍实践的需求规范存在一个悖论:它们往往宣称是面向对象的,却主要依赖过程化(非面向对象)技术。用例与用户故事描述的是功能流,而非对象类型。为获得对象技术带来的优势(如可扩展性、可复用性、可靠性),需求应同样采用与面向对象设计与程序相同的数据抽象概念——类、继承、信息隐藏。许多人认为用例与用户故事因概念简洁实用而具有吸引力。我们能否调和需求与面向对象原则,兼得两者之长?本文提出一个统一框架,阐明"类"这一概念不仅足以描述狭义上的"对象",还能描述用例与用户故事等场景,以及测试用例与测试预言等其他重要制品。单一框架的建立开辟了兼具两种方法优势的需求之路:如同用例与用户故事,它们反映利益相关者的实践视角;如同面向对象需求,它们天然支持演进与复用。