【IT168 技术文章】
需求-用例增量
增量1:支票和储蓄账户的存款和取款
增量2:查询和转账
增量3:透支
每个增量内进行迭代:乐观的,正常的,悲观的
需求用例规约:名称,触发器,输入参数,输出返回值,出现的前置条件/异常,出现的(raised)后置条件/异常,基本的/乐观场景,替代性可选的/悲观的场景,业务规则,测试实例。
WithdrawFromCheckingAccount用例的用例规约
用例名:WithdrawFromCheckingAccount
触发器: WithdrawFromCheckingAccount
输入参数: sAcctNum, nWithdraw
输出返回值: sText
前置条件: ValidAccount = true and nWithdraw <= nCurrentBalance
出现的前置条件异常: 待定的
描述/转换: nCurrentBalance = nCurrentBalance - nWithdraw
后置条件: nCurrentBalance < nOldBalance
后置条件异常:无
相关用例: Generalization, Includes, Extends/Extension Point: 无
基本场景/乐观场景: Text(文本) - 待定;Diagram(图) -见 WithdrawFromCheckingAccount乐观场景顺序图
替代性可选场景/被动场景:Text -待定;Diagram -见WithdrawFromCheckingAccount 活动图
业务规则: ValidAccountRule, AdequateBalanceRule
测试实例:1 - 乐观的:输入: sAcctNum - BGates001, nWithdraw - 100, nCurrentBalance - 1000 Conditions: None, 输出:"BGates001 withdraw $100 OK and recorded";2 ...待定