A, GitHub address: https://github.com/lq15086495788/wc
Two, psp table
PSP2.1 |
Personal Software Process Stages |
Estimated time consuming (minutes) |
The actual time-consuming (minutes) |
Planning |
plan |
40 | 52 |
· Estimate |
• Estimate how much time this task requires |
40 | 52 |
Development |
Develop |
710 | 550 |
· Analysis |
· Needs analysis (including learning new technologies) |
110 | 130 |
· Design Spec |
Generate design documents |
70 | 40 |
· Design Review |
· Design Review (and his colleagues reviewed the design documents) |
30 | 20 |
· Coding Standard |
· Code specifications (development of appropriate norms for the current development) |
30 | 40 |
· Design |
· Specific design |
110 | 50 |
· Coding |
· Specific coding |
220 | 180 |
· Code Review |
· Code Review |
40 | 30 |
· Test |
· Test (self-test, modify the code, submit modifications) |
100 | 60 |
Reporting |
report |
100 | 80 |
· Test Report |
· testing report |
40 | 40 |
· Size Measurement |
· Computing workload |
30 | 30 |
· Postmortem & Process Improvement Plan |
· Hindsight, and propose process improvement plan |
20 | 30 |
total |
840 | 740 |
Third, design probably thinking
Design of three categories, namely main, counte and a coder.
一,main
In this class, the main achievement of program control and method calls, io stream enables entry documents.
Two, counter
This class is used to implement four basic statistical operation, which
Number of characters: all characters except the space character and career change, record
Number of lines; switch operator who will experience counts
Word count: space on the record
Finally, a unified operation -all with all the basic statistics are displayed.
Three, code class
The extended operation, statistical blank lines, comment lines and other lines of code spreading operation implemented in this class.
And to determine whether the file is empty, which do not meet the standard file
Notes matcher (match single-line, multi-line, documentation comments)
Blank line matcher (carriage return match, tab key, space)
Traversing the file and record the number of the corresponding comment lines and blank lines,
Except the blank lines and comments, the rest are all lines
Fourth, the program flow design
Fifth, the test run.
Test files include: an empty file, a file is only one word, a java source code files
5.1 Test general statistics for an entire file
Correct test results.
5.2 Testing an empty file of statistics
Correct test results.
5.3 Test invalid file
Test results are correct
5.4 Test contains only a word document
Test results are correct
5.5 Test extended operation
Test results are correct
Question six, encountered in the development process
# Select the language difficult to achieve:
This time to see his original work, the need to implement a command-line program, at the time very tangled in the end to achieve what language to use. Because the scripting language and the hypertext language can not achieve this function, it is necessary to make other plans.
Programming languages are not familiar with the difficulties:
Because not too long to write java, in which the process of programming needs and checking while writing logic, leading to write a bit slow.
Function implemented difficulties:
Time to start writing to read the file, select the file stream buffer reading function, found that due to personal problems, leading to unsatisfactory results of the proceedings. And later choose to use read () function to read file operations, operated by the binary stream. For this based on the number line judge, word book, the number of characters function, to achieve than the buffer was slightly simpler.
# Did try:
Initially, choose pathon to achieve this program, then choose the c language, but later felt accustomed to object-oriented programming, I thought up an elective sophomore learning java, so the final choice of java the language to achieve .
solve:
Finally, simply to achieve the basic functions and expand a function.
gain something:
In times of difficulties, we must go through after their own thinking, go to understand is how to achieve. So that we can better understand and implement this function. Multi-point try different approaches better.
VII. Summary
Through this work, we revisit a bit of knowledge of Java, but also learned to implement a program from 0-1, from estimates, design, coding, development, testing, documentation and other processes to exercise their own.
The first exercise to develop the habit of doing electronic notes, the second concept has also been writing a blog, but also enhance the ability of other learning ability outside of their own codes.