| WARNING: The content of this section is considered DEPRECATED and OBSOLETE It is preserved for historical or documenting reasons.
|
| Stream
|
|
| Category
| Activity
| Sub-category
| TurtleArt
|
| Component
| TurtleArt
|
| Feature
| http://wiki.laptop.org/go/Turtleart
|
| Objective
| Tests basic arithmetic operations
|
| Tools
| None
|
| Setup
| --
- Open the TurtleArt activity.
- Drag a 'forward' block onto the field and remove it's value by dragging it onto the toolbox.
- Connect another 'forward' block immediately below the first 'forward' block. Leave its value as 100.
- Connect a 'print' block immediately below the last 'forward' block.
- Place a 'ycor' value in the print block.
|
| Procedure
| Test Procedure (repeat for all test values below):
- Click the 'clean' button at the top of the screen.
- Connect the math function under test to the input of the first 'forward' statement.
- Change the default values to the values specified by the test.
- Run the sequence.
- Make sure the value printed to the output matches the expected value.
- In all cases, the turtle must have moved upwards, be at the upmost position of the drawn line and facing upwards.
Test Values:
| # | Top Value | Bottom Value | Expected Result |
| [Addition] |
| 1. | 23.2 | 12.3 | 135.5 |
| 2. | -32.4 | 2.8 | 70.4 |
| 3. | 5.6 | -9.8 | 95.8 |
| 4. | -07 | -2 | 91.0 |
| 5. | 0.0 | 3.5 | 103.5 |
| 6. | 4.6 | 0.0 | 104.6 |
| 7. | 0.0 | 0.0 | 100.0 |
| [Subtraction] |
| 8. | 23.2 | 12.3 | 110.9 |
| 9. | -32.4 | 2.8 | 64.8 |
| 10. | 5.6 | -9.8 | 115.4 |
| 11. | -07 | -2 | 95.0 |
| 12. | 0.0 | 3.5 | 96.5 |
| 13. | 4.6 | 0.0 | 104.6 |
| 14. | 0.0 | 0.0 | 100.0 |
| [Multiplication] |
| 15. | 2.2 | 2 | 104.4 |
| 16. | -2.4 | 3 | 92.8 |
| 17. | 5 | -9.8 | 51.0 |
| 18. | -07 | -2 | 114.0 |
| 19. | 0.0 | 3.5 | 100.0 |
| 20. | -4.6 | 0.0 | 100.0 |
| 21. | 0.0 | 0.0 | 100.0 |
| [Division] |
| 22. | 2.2 | 2 | 101.1 |
| 23. | -2.4 | 3 | 99.2 |
| 24. | 5 | -9.8 | 99.4 |
| 25. | -07 | -2 | 103.5 |
| 26. | 0.0 | 3.5 | 100.0 |
| 27. | -4.6 | 0.0 | Error message |
| 28. | 0.0 | 0.0 | Error message |
| [Modulo Values] |
| 29. | 18 | 8 | 102.0 |
| 30. | -2.4 | 3 | 100.6 |
| 31. | 5 | -9.8 | 95.2 |
| 32. | -07 | -2 | 99.0 |
| 33. | 0.0 | 3.5 | 100.0 |
| 34. | -4.6 | 0.0 | Error message |
| 35. | 0.0 | 0.0 | Error message |
| [Square Root Values] |
| 36. | -1 | Error message |
| 37. | 0 | 100.0 |
| 38. | 1 | 101.0 |
| 39. | 4 | 102.0 |
| 40. | 7 | 102.6 |
|
Expected Results and Pass Criteria
| All outputs from the 'print' command match the expected values listed in the table.
|
| Comments
| Assumptions:
- All outputs are truncated to 1 decimal place.
- Mathematically invalid operations should show a #syntaxerror
- Arithmetic overflow is not likely to be a problem for the range of values required, hence is not tested.
Rationale
- Moving the turtle and then checking its Y co-ordinate is used rather than directly checking the output from the math function is done because the print function itself seems to catch errors and write '0' regardless, whereas moving the turtle reveals these errors. Furthermore, moving the turtle again after the test indicates that the program is left in a working state.
- Equivalence partitioning is used since the math functions take at most 2 inputs, and the number tests required to provide sufficient coverage is optimal.
- Addition, Subtraction, Multiplication, Division & Modulo: Values are chosen from the partition class {Negative Real Number, 0.0, Positive Real Number}
- Square Root: Values tested include {-1 (invalid), 0, 1, 4 (integer result), 7 (irrational result)}. These values were selected using Boundary Analysis.
|
| Release
| Stream
| Build
| Pass/Fail
| Trac Ticket(s)
| Comment(s)
| Date of Test
|
| 8.2.0 (767)
| warning.png"" cannot be used as a page name in this wiki.
| 45
| Fail
|
| Failures:
- The test cases 27 and 28 (division by zero) silently returns zero as the result, however should raise a #syntaxerror to let the user know that this error has occurred.
- The test case 31 (square root of -1) does not show a #syntaxerror. Further investigation found that this operation returns NaN, which causes the turtle to move forwards by NaN in this test setup. The result of this is that the turtle appears to jump to (0, 0) and won’t move again until the ‘clear’ instruction is executed.
| 2009/03/29
|
Facts about Tests/Activity/TurtleArt ArithmeticRDF feed
| Build number | 45 + | | Build stream | warning.png"" cannot be used as a page name in this wiki. | | Comments | Failures:
- The test cases 27 and 28 (divis … Failures:
- The test cases 27 and 28 (division by zero) silently returns zero as the result, however should raise a #syntaxerror to let the user know that this error has occurred.
- The test case 31 (square root of -1) does not show a #syntaxerror. Further investigation found that this operation returns NaN, which causes the turtle to move forwards by NaN in this test setup. The result of this is that the turtle appears to jump to (0, 0) and won’t move again until the ‘clear’ instruction is executed. until the ‘clear’ instruction is executed.
| | Created | 29 March 2009 + | | More notes | Assumptions:
All outputs are truncated to … Assumptions:
All outputs are truncated to 1 decimal place.
Mathematically invalid operations should show a #syntaxerror
Arithmetic overflow is not likely to be a problem for the range of values required, hence is not tested.
Rationale
- Moving the turtle and then checking its Y co-ordinate is used rather than directly checking the output from the math function is done because the print function itself seems to catch errors and write '0' regardless, whereas moving the turtle reveals these errors. Furthermore, moving the turtle again after the test indicates that the program is left in a working state.
- Equivalence partitioning is used since the math functions take at most 2 inputs, and the number tests required to provide sufficient coverage is optimal.
- Addition, Subtraction, Multiplication, Division & Modulo: Values are chosen from the partition class {Negative Real Number, 0.0, Positive Real Number}
- Square Root: Values tested include {-1 (invalid), 0, 1, 4 (integer result), 7 (irrational result)}. These values were selected using Boundary Analysis. ues were selected using Boundary Analysis.
| | Pass criteria | All outputs from the 'print' command match the expected values listed in the table. | | PassFail | Fail + | | Short name | Arithmetic + | | Software release | 8.2.0 (767) + | | System component | TurtleArt + | | System feature | http://wiki.laptop.org/go/Turtleart + | | Test category | Activity + | | Test objective | Tests basic arithmetic operations + | | Test procedure | Test Procedure (repeat for all test values … Test Procedure (repeat for all test values below):<br />
- Click the 'clean' button at the top of the screen.
- Connect the math function under test to the input of the first 'forward' statement.
- Change the default values to the values specified by the test.
- Run the sequence.
- Make sure the value printed to the output matches the expected value.
- In all cases, the turtle must have moved upwards, be at the upmost position of the drawn line and facing upwards.
Test Values:
<table border="1" cellspacing="0">
<tr><th>#</th><th>Top Value</th><th>Bottom Value</th><th>Expected Result</th></tr>
<tr><td colspan="4">[Addition]</td></tr>
<tr><td>1.</td><td>23.2</td><td>12.3</td><td>135.5</td></tr>
<tr><td>2.</td><td>-32.4</td><td>2.8</td><td>70.4</td></tr>
<tr><td>3.</td><td>5.6</td><td>-9.8</td><td>95.8</td></tr>
<tr><td>4.</td><td>-07</td><td>-2</td><td>91.0</td></tr>
<tr><td>5.</td><td>0.0</td><td>3.5</td><td>103.5</td></tr>
<tr><td>6.</td><td>4.6</td><td>0.0</td><td>104.6</td></tr>
<tr><td>7.</td><td>0.0</td><td>0.0</td><td>100.0</td></tr>
<tr><td colspan="4">[Subtraction]</td></tr>
<tr><td>8.</td><td>23.2</td><td>12.3 </td><td>110.9</td></tr>
<tr><td>9.</td><td>-32.4</td><td>2.8 </td><td>64.8</td></tr>
<tr><td>10.</td><td>5.6</td><td>-9.8</td><td>115.4</td></tr>
<tr><td>11.</td><td>-07</td><td>-2</td><td>95.0</td></tr>
<tr><td>12.</td><td>0.0</td><td>3.5</td><td>96.5</td></tr>
<tr><td>13.</td><td>4.6</td><td>0.0</td><td>104.6</td></tr>
<tr><td>14.</td><td>0.0</td><td>0.0</td><td>100.0</td></tr>
<tr><td colspan="4">[Multiplication]</td></tr>
<tr><td>15.</td><td>2.2</td><td>2</td><td>104.4</td></tr>
<tr><td>16.</td><td>-2.4</td><td>3</td><td>92.8</td></tr>
<tr><td>17.</td><td>5</td><td>-9.8</td><td>51.0</td></tr>
<tr><td>18.</td><td>-07</td><td>-2</td><td>114.0</td></tr>
<tr><td>19.</td><td>0.0</td><td>3.5</td><td>100.0</td></tr>
<tr><td>20.</td><td>-4.6</td><td>0.0</td><td>100.0</td></tr>
<tr><td>21.</td><td>0.0</td><td>0.0</td><td>100.0</td></tr>
<tr><td colspan="4">[Division]</td></tr>
<tr><td>22.</td><td>2.2</td><td>2</td><td>101.1</td></tr>
<tr><td>23.</td><td>-2.4</td><td>3</td><td>99.2</td></tr>
<tr><td>24.</td><td>5</td><td>-9.8</td><td>99.4</td></tr>
<tr><td>25.</td><td>-07</td><td>-2</td><td>103.5</td></tr>
<tr><td>26.</td><td>0.0</td><td>3.5</td><td>100.0</td></tr>
<tr><td>27.</td><td>-4.6</td><td>0.0</td><td>Error message</td></tr>
<tr><td>28.</td><td>0.0</td><td>0.0</td><td>Error message</td></tr>
<tr><td colspan="4">[Modulo Values]</td></tr>
<tr><td>29.</td><td>18</td><td>8</td><td>102.0</td></tr>
<tr><td>30.</td><td>-2.4</td><td>3</td><td>100.6</td></tr>
<tr><td>31.</td><td>5</td><td>-9.8</td><td>95.2</td></tr>
<tr><td>32.</td><td>-07</td><td>-2</td><td>99.0</td></tr>
<tr><td>33.</td><td>0.0</td><td>3.5</td><td>100.0</td></tr>
<tr><td>34.</td><td>-4.6</td><td>0.0</td><td>Error message</td></tr>
<tr><td>35.</td><td>0.0</td><td>0.0</td><td>Error message</td></tr>
<tr><td colspan="4">[Square Root Values]</td></tr>
<tr><td>36.</td><td colspan="2">-1 </td><td>Error message</td></tr>
<tr><td>37.</td><td colspan="2">0 </td><td>100.0</td></tr>
<tr><td>38.</td><td colspan="2">1 </td><td>101.0</td></tr>
<tr><td>39.</td><td colspan="2">4 </td><td>102.0</td></tr>
<tr><td>40.</td><td colspan="2">7 </td><td>102.6</td></tr>
</table> 102.6</td></tr>
</table> | | Test setup | --
- Open the TurtleArt activity.
- Drag a ' … --
- Open the TurtleArt activity.
- Drag a 'forward' block onto the field and remove it's value by dragging it onto the toolbox.
- Connect another 'forward' block immediately below the first 'forward' block. Leave its value as 100.
- Connect a 'print' block immediately below the last 'forward' block.
- Place a 'ycor' value in the print block.
- Place a 'ycor' value in the print block.
| | Test subcategory | TurtleArt + | | Test tools | None + |
|