Project 2

12331002 陈果
12331015 孟泽宇

Task 2: Design test cases for version 1


TerpCalc Version1

TerpCalc有三种模式:

  1. Standard
  2. Graphic
  3. Scientific

每一种模式对应一个window,共三个window


Standard模式

  • operator1
Operator Perform-a-simple-calculation
Parameters First number:[0-9]; button:[+, -, *, /, C]; second number:[0-9]
Precondition Set the calculator as the initialization state
Effects Get a result

Test case:
- Calculate 1 + 1
- Calculate 1 - 1
- Calculate 2 * 2
- Calculate 4 / 2
- Calculate 1 / 0
- Calculate 2 * 0

State machine:
这里写图片描述

  • operator2
Operator Use-the-memory
Parameters number:[0-9]; button:[MS, MR, MC, M+]
Precondition the memory is empty
Effects the number is in the memory or removed from the memory

Test case:
- Input a number and store it in the memory
- Recall the number from the memory
- Remove the number from the memory
- Add a number into the memory

State machine:
这里写图片描述

  • operator3
Operator Perform-the-square-root-calculation
Parameters number:[0-9]; button:[sqrt]
Precondition Set the calculator as the initialization state
Effects Get the square root

Test case:
- Calculate sqrt(9)
- Calculate sqrt(-9)
- Calculate sqrt(0)
- Calculate sqrt(1/9)
- Calculate sqrt(-1/9)
- Calculate sqrt(3)

State machine:
这里写图片描述

  • operator4
Operator Format-the-number
Parameters number:[0-9]; button:[Digital Grouping]
Precondition null
Effects the number is convert to another format

Test case:
- Input 1234 then format it
- Input 123 then format it

State machine:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值