12331002 陈果
12331015 孟泽宇
Task 2: Design test cases for version 1
TerpCalc Version1
TerpCalc有三种模式:
- Standard
- Graphic
- 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:
Scientific模式
- operator1
Operator | Switch-between-number-systems |
---|---|
Parameters | number:[0-9]; button[Bin, Oct, Hex, Dec] |
Precondition | null |
Effects | the number is convert to another format |
Test case:
- Input pi, then convert it to other systems.
- Input 9, then convert it to other systems.
- Input 12, then convert it to other systems.
- Input 18, then convert it to other systems.
State machine:
- operator2
Operator | Use-scientific-notation |
---|---|
Parameters | number:[0-9]; button:[F-E] |
Precondition | null |
Effects | the number is convert to scientific notation |
Test case:
- Input -5, then convert it to scientific notation
- Input -0.5, then convert it to scientific notation
- Input 0, then convert it to scientific notation
- Input 0.5, then convert it to scientific notation
- Input 5, then convert it to scientific notation
State machine:
- operator3
Operator | Use-statistics |
---|---|
Parameters | number:[0-9] |
Precondition | null |
Effects | do some statistic operation |
Test case:
- Click “Sta” to open the box
- Click “Dat” to add some number
- Click “Sum” to calculate sum
- Click “Ave” to calculate average
- Click “s” to calculate standard deviation
State machine:
Graphic模式
- operator1
Operator | Graph-a-equation |
---|---|
Parameters | number:[0-9]; button[+, -, *, /]; button:[graph] |
Precondition | null |
Effects | the equation is graphed |
Test case:
- Input 5 * x to get the equation “y = 5 * x”, then click the “GRAPH” button
State machine:
- operator2
Operator | Calculate-the-value-at-a-point |
---|---|
Parameters | button:[Get Y value]; number:[0-9] |
Precondition | the current window is a graph view |
Effects | get the result |
Test case:
- Input two boundary and a non-boundary value to calculate
State machine:
- operator3
Operator | Zoom-in-or-out |
---|---|
Parameters | number:[0-9]; button:[xMin, xMax, yMin, yMax] |
Precondition | the current window is a graph view |
Effects | The graph window size is larger or smaller |
Test case:
- Input a positive number for xMin, xMax, yMin and yMax, and xMin < xMax, yMin< yMax
- Input a positive number for xMin, xMax, yMin and yMax, and xMin > xMax, yMin >yMax
- Input a positive number for xMin, xMax, yMin and yMax, and xMin = xMax, yMin = yMax
- Input a negative number for xMin, xMax, yMin and yMax
- Input 0 for xMin, xMax, yMin and yMax
State machine:
- operator4
Operator | Add-or-change-x(y)-label-and-title |
---|---|
Parameters | button[xLable, yLable, Title]; string:[label, title] |
Precondition | the current window is a graph view |
Effects | The graph has labels and a title |
Test case:
- Add labels to both x and y
- Add a title
State machine:
- operator5
Operator | Add-user-defined-function |
---|---|
Parameters | string:[label]; file:[Function.java] |
Precondition | Exsit a java file |
Effects | The user defined function is created |
Test case:
- Modify the “UserFunctions.java” to define a function
- operator6
Operator | Print-the-graph |
---|---|
Parameters | button:[Print] |
Precondition | the current window is a graph view |
Effects | the graph is printed |
Test case:
- Click the “Print” button.
State machine:
TerpSpreadsheet Version1
TerpSpreadsheet的基本功能:
- Menu Bar
- File: New; Save; Save as; Open; Print; Exit
- Edit: Cut; Copy; Paste; Clear
- Format: Column Width; Row Height; Format Cells
- Functions: Sum; Average; Max; Min; Square Root; Sine; Count
- Tool Bar
- 设置字体,大小,粗体,斜体
- Worksheet
- 输入字符数字等
Test Cases
- operator1
Operator | Creat-a-new-file |
---|---|
Parameters | button:[new] |
Precondition | null |
Effects | creat a new file |
Test case:
- Click file->new
- operator2
Operator | Open-a-file |
---|---|
Parameters | button:[open]; file:[file.ums] |
Precondition | exist a .ums file |
Effects | open the file |
Test case:
- Click openfile->file.ums->打开
- operator3
Operator | Save-file |
---|---|
Parameters | String:[filename] |
Precondition | null |
Effects | Save the file |
Test case:
- Click save(or Ctrl+s)->[filename].ums->保存
- operator4
Operator | Print-file |
---|---|
Parameters | button:[print]; file[file.xps] |
Precondition | exist a .xps file |
Effects | print the file |
Test case:
- Click Print->Print selected area->xx.xps
- operator5
Operator | Cut-some-area |
---|---|
Parameters | button:[cut] |
Precondition | there is some text in the window |
Effects | the selected area is cut |
Test case:
- Click edit->cut
- operator6
Operator | Copy-and-paste-some-area |
---|---|
Parameters | button:[copy, paste] |
Precondition | there is some text in the window |
Effects | the selected area is copyed and paste it to another place |
Test case:
- Click edit->cut, then click edit->paste
- operator7
Operator | Table-a-form |
---|---|
Parameters | String:[name]; int:[id, age] |
Precondition | null |
Effects | creat a form |
Test case:
- operator8
Operator | Sum |
---|---|
Parameters | int:[age] |
Precondition | there exist a form |
Effects | result the sum of ages |
Test case:
- input =sum(c1, c2, c3)
- operator9
Operator | Average |
---|---|
Parameters | int:[age] |
Precondition | there exist a form |
Effects | result the average of ages |
Test case:
- input =Average(c1, c2, c3)
- operator10
Operator | Max |
---|---|
Parameters | int:[age] |
Precondition | there exist a form |
Effects | result the max of ages |
Test case:
- - input =Max(c1, c2, c3)
- operator11
Operator | Overstriking |
---|---|
Parameters | String:[name]; button[加粗] |
Precondition | the string didn’t get overstriking before |
Effects | the “name”is bolded than before |
Test case:
- select the name and click “加粗”
- operator12
Operator | Set-the-size |
---|---|
Parameters | String:[name] |
Precondition | null |
Effects | make the string bigger |
Test case:
- select the name and set the size to 20
Task 3: Record the test scripts for version 1
根据TASK2中设计的测试用例,我们组合了以下几个脚本:
1. 测试TerpCalc Standard模式的功能
2. 测试TerpCalc Scientific模式的功能
3. 测试TerpCalc Graph模式的功能
4. 测试TerpSpreadsheet的文件功能:新建文件->写文件->保存文件
5. 测试TerpSpreadsheet的文件编辑功能:剪切-> 粘贴, 复制->粘贴,删除
6. 测试TerpSpreadsheet的函数功能:sum,average,max,min,square root, sine,count
7. 测试TerpSpreadsheet的打印功能
8. 测试TerpSpreadsheet的字体变化功能
以下是部分脚本的日志截图:
- 脚本1:
- 脚本2:
- 脚本3
- 脚本5
Task4:Maintain test scripts version 2 and report failures in the test scripts
对于Version2,脚本我们选择重新录制,具体的请查看文件。