I tried to finish the code of this project. To tell the truth, I did not expect that it would take so much time. In the strong contrast of reality, I found that I was really broken by graphic.
1. Estimated time
Since the OO Course of the last semester had a similar program, I thought it would be so easy to do it again, so I felt quite confused. It is expected to be done in four hours, and I will use a maximum of one hour for testing.
2. the cruelty of reality
The first three hours were used to do chores (write macro functions, build achievements, write small functions, classify and discuss command line situations, and design the entire project structure ),
In the next three hours, we will find a variety of materials (File streams, template libraries, string classes, and binary tree traversal that we forgot ),
The next three hours are used for coding. Now the simple mode is complete.
Run, collapsed.
There are many bugs in this year. 4 hours of debugging!
Debugging took two hours to write the extended mode.
So far, the task has been completed. A total of 13 hours.
3. Performance Analysis
Everybody is scanning the vs directory, and I also scan it.
Path "C: \ Program Files (x86) \ Microsoft Visual Studio 11.0"
The first run collapsed.
Check the cause, set a lot of breakpoints, and finally found that when traversing the tree there are too many layers of recursion, a stack overflow occurs. So it is changed to non-recursive form.
Run again. Figure.
Result:
Performance:
Because the tree structure is adopted, it is much faster than some other data structures except hash tables.
4. Test Cases
The test case uses the result of the kite chaser obtained by the students.
Simple mode:
Expansion Mode 1:
Expansion Mode 2:
The functions used in the three modes are similar. The number of words that appear in a relatively small number of times is detected through manual search, which is consistent with the results.
Some wrong inputs were tested, and the program exited directly without crashing.
5. Gains
I reviewed the construction and traversal of the tree from this project, familiarized myself with the use of the template library and file stream, and learned the special situation of stack overflow. In addition, the coding experience is also refined by hitting more than four hundred lines of code.
Software Engineering: individual project-Word Frequency Program