An EBNF-Based Grammar for Use Case Specification
摘要
This paper presents a use case grammar for specifying functional requirements, providing syntactic and semantic rules that integrate with a specific yet extensible vocabulary to form a semi-formal language for use case specification. Built on EBNF and implemented in ANTLR, the grammar ensures well-formedness and facilitates validation of such specifications. Core elements of the grammar include (i) use case patterns, which define structured sequences of action blocks to achieve specific functionalities; (ii) action blocks, serving as fundamental units of user or system actions, further categorized into atomic blocks for main scenarios and composite blocks for alternate scenarios; (iii) support for both design-free and design-augmented functional specifications; (iv) a hierarchical grammar structure that promotes modularity and traceability; and (v) mechanisms to identify and specify actors, related use cases, and alternate scenarios. This structured approach reduces redundancies, inconsistencies, and omissions while facilitating the validation of requirements; it also provides a foundation for generating automatically diagrammatic notations, such as use case and sequence diagrams, in future implementations. Ultimately, it accelerates requirements engineering and enhances the overall quality of functional requirements.