这个用例是什么意思

时间:2013-11-18 22:36:33

标签: documentation uml specifications requirements use-case

所以我正在创建一个用例规范,我只是有点困惑,有一个自动售货机,允许演员从两种不同的付款方式中选择,所以演员可以通过卡支付或通过硬币支付,是以下规范对于这种情况是否正确?

1. Include [Payment Acceptance Use Case ID]
  1.1 Actor Select Card to Pay with 
  1.1.1 Include [Pay By Card Use Case ID]
  1.1.2 Actor enters card
  1.1.3 System validates card
  1.1.4 Drink is dispensed 
  1.2 Actor Selects Coins to pay with
  1.2.1 Include [Pay By Coins Use Case ID]
  1.2.2 Actor enters coins
  1.2.3 Drink is dispensed 

这个用例规范是否证明了Actor可以选择用卡或硬币选择支付的场景是用例说明,说演员必须先用卡支付然后用硬币支付?

2 个答案:

答案 0 :(得分:1)

我不熟悉用例的这种语法,但目前提供这些选项的方式存在逻辑上的缺陷:假设1.1.1,1.1.2,1.1.3和1.1.4是顺序的(如1.2.1,1.2.2和1.2.3),因此可以假设1.1和1.2也应该是顺序的。

同样,我不太了解标准,但在我看来,可能的解决方法是缩进第三级步骤并将OR放在1.1的末尾,如下所示:

1. Include [Payment Acceptance Use Case ID]
  1.1 Actor Select Card to Pay with OR
    1.1.1 Include [Pay By Card Use Case ID]
    1.1.2 Actor enters card
    1.1.3 System validates card
    1.1.4 Drink is dispensed 
  1.2 Actor Selects Coins to pay with
    1.2.1 Include [Pay By Coins Use Case ID]
    1.2.2 Actor enters coins
    1.2.3 Drink is dispensed 

答案 1 :(得分:0)

有关用例模板的示例,请参阅此URL:http://alistair.cockburn.us/Basic+use+case+template

您的1.2至1.2.3将列在"变体"