First, the test process is as follows:
Test module |
Test input |
Expected results |
Run results |
Bug tracking |
Simple interest Calculation F = P * (1 + i * N); |
(Principal, duration, interest rate) |
Final value |
|
|
1 |
(100,10,3) |
130 |
√ |
√ |
2 |
(0,10,3) |
0.0 |
√ |
√ |
3 |
(100,0,3) |
0.0 |
100.0 |
has been improved. Returns the result of 0 |
4 |
(100,10,0) |
0.0 |
100.0 |
has been improved. Returns the result of 0! |
Second, the initial test results:
Thirdly, the results of the improved test are as follows:
In addition to the problem of calling the simple interest calculation formula, other computational formats have similar problems and have been improved.
Iv. Program source code address:
Https://github.com/helloyoucan/compoundung/blob/master/Compounding4_2.java
Https://github.com/helloyoucan/compoundung/blob/master/DataTreating1_1.java
Five, the test code address:
Https://github.com/helloyoucan/compoundung/blob/master/DataTreatingTest1_1.java
Vi. Summary
After this test, make Datatreating.java this kind of calculation formula of the class more perfect, make this class not only let Compounding4_2.java this kind of service.
Software Engineering---Unit test report