After three weeks of development and commissioning, our pair programming project finally came to an end. Let's start with a final picture.
The function of the program implementation is a simple calculator function. This week's main work is to increase the user-specified precision output function, while the program is a black box test. 、
Precision function
After the user opens the program, click the ALT key once, you can see the settings in the top left of the program to select the Accuracy option. After clicking on the Precision option, the user can enter the accuracy of their own demand output. After the user has entered the precision, then the result of the input formula is output with that precision. The effect is as follows:
---
As you can see, before setting the precision, input 2/4 Gets the result of 1/2, and when the precision is set to 3 bits, the result of input 2/4 is 0.500.
Black box test
We also had a black-box test this week, and some bugs were found during the test, but it was not available here.
The test data mainly consists of several parts:
1. Enter multiple symbols consecutively: 1 + 2/* 3 =
-
in the input 1+2 /After entering the * number
As you can see, the program recognizes the user input two consecutive symbols, and after the second symbol entered, it replaces the first symbol.
2. Enter multiple decimal points
When you enter the second decimal point, you observe that the program does not read into the second decimal point, and that there is only a small number in the expression in the foreground, and that the result of the calculation is not error-free.
3. Input calculation: 0123 + 456 + 7
Expected output: 123 + 456 + 7
In this fast we found a bug in the program is the user input 0123, according to the common sense program should read in and display 123, and in fact the program shows the number is 0123, which is inconsistent with expectations.
4. Input calculation: 45 + 5/(6-6)
-
The results are as follows: The program can correctly determine the error except 0.
5, set the accuracy: in the precision input box, do not enter anything, click OK.
Result: Program crashes
6. Other
We have tried a lot of test examples, not listed here, the main errors listed above, and to enumerate some of the correct results. The other sample programs of the test are able to process and output correctly.
Pair programming--arithmetic