Personal Project Ultimate Blog--Analysis of arithmetic problem generation program

Source: Internet
Author: User

Analysis of arithmetic problem generation program

13061184 Horse Prancing

One, TIME analysis

PSP2.1

Personal Software Process Stages

Time

Planning

Plan

· Estimate

• Estimate how long this task will take

15h

Development

Development

· Analysis

• Demand analysis (including learning new technologies)

2h

· Design Spec

• Generate design documents

1h

· Design Review

• Design Review (and colleagues review design documents)

0.5h

· Coding Standard

• Code specification (appropriate specification for current development)

1h

· Design

• Specific Design

4h

· Coding

• Specific coding

4h

· Code Review

• Code review

1h

· Test

• Test (self-test, modify code, commit changes)

3.5h

Reporting

Report

· Test Report

• Test reports

1h

· Size Measurement

• Computational effort

1h

· Postmortem & Process Improvement Plan

• Post-mortem summary and propose process improvement plans

0.5h

Total

19.5h

Second, performance analysis and improvement

In the first analysis of the program, it can be found that the use of class expression is very small, and his function and the program class has been duplicated, so in the improvement of the expression class to delete, and the original implementation of the functions it implemented into other classes to implement.

After the improvement, we can find that the equalization of each function has been improved a certain degree.

Third, test case and program correctness analysis

Test cases: In terms of the number of builds, the data from 1 to 10000 are tested, and all the data is output normally, but it is slow to run at a large number of times.

In the case of numerical upper limit: The program can output normally when the arithmetic is running below 20, but there will be a digital overflow problem when the number is large.

When matching the answer, the generated question and answer are matched first, and the output should be all correct, then change some answers to match, to test the answer is incorrect.

The specific test cases are as follows (input as command line parameters, output as file output, due to many output problems, with the first question and answer as a sample):

-N 10–r 10

1.8x8 ' 1/3÷7÷2 ' 1/4

1.1. 4 ' 44/189

-N 100–r 10

1.3÷2/9

1.13 ' 1/2

-N 10000–r 10

1.1 ' 7/9x (2 ' 1/6-5/7 + 7 ' 2/7)

1.15 ' 101/189

-N 100–r 20

1.13 ' 2/9-15 ' 1/3÷11 ' 1/5

1.11 ' 215/252

-N 10000–r 20

1.1/4 + 18 ' 15/19 + 19 ' 15/17

1.38 ' 1191/1292

-N 10000–r 1000

1 ' 1/11x77 ' 29/65÷11 ' 61/92-2 ' 39/74

1.237 ' 195757/1534390

-e D:\Exercises.txt-a D:\Answers.txt (output to Grade.txt)

If two files are generated by the program and the answer, then the output is:

CORRECT:100 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88 1, 92, 93, 94, 95, 96, 97, 98, 99, 100)

wrong:0

If you manually change the number of answers to a few questions in the answer file, the output is:

Correct:88 (1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35 6, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100

Wrong:12 (5, 10, 14, 19, 24, 34, 40, 52, 60, 74, 87, 97)

-N 100–r 100–n 100 (wrong number of arguments):

Console output: Error:wrong number of arguments

-N 100–e 100 (the number of arguments is correct, but the parameter name is incorrect)

Console output: error:invalid arguments

-N abc–r ABC (parameter content format does not meet the requirements)

Console output: Error: The input string is not in the correct format.

Iv. Summary and Harvest

1, exercise the C # language programming ability, the VS programming Environment has a more in-depth understanding;

2, the first contact to write a complete software workflow, took a familiar blog operation process of the first step;

3, understand the program performance analysis methods, at any time to urge themselves to improve the program;

4, the understanding of the importance of understanding the needs of users, understand that a software need not demanding perfection, but to be good enough, stable and durable.

Personal Project Ultimate Blog--Analysis of arithmetic problem generation program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.