A, github address: https://github.com/Jasminejiamei/homework-wc
Two, PSP
PSP | Personal Software Process Stages | Estimated time consuming (minutes) | The actual time-consuming (minutes) |
---|---|---|---|
Planning | plan | 40 | 30 |
· Estimate | • Estimate how much time this task requires | 30 | 25 |
Development | Develop | 790 | 710 |
· Analysis | · demand analysis | 20 | 20 |
· Design Spec | Generate design documents | 40 | 30 |
· Design Review | · Design Review | 30 | 30 |
· Coding Standard | · Code Specification | 30 | 40 |
· Design | · Specific design | 80 | 60 |
· Coding | · Specific coding (to learn new technologies) | 470 | 370 |
· Code Review | · Code Review | 60 | 50 |
· Test | · Test (self-test, modify the code, submit modifications) | 60 | 60 |
Reporting | report | 120 | 120 |
· Test Report | · testing report | 60 | 60 |
· Size Measurement | · Computing workload | 30 | 30 |
· Postmortem & Process Improvement Plan | · Hindsight, and propose process improvement plan | 30 | 30 |
total | 950 | 860 |
Third, the problem-solving ideas
Just beginning to see the problem, that must use c language or java can achieve a .exe tool, and later I learned that imitate serious look fulfill its function and can be expanded, not limited language. I Jiaoshu programming language is JavaScript, but your browser JavaScript is not the ability to file operations, and Node in JavaScript with a document processing system, such an operation is very easy to read the file, so I thought with node.js, this time I know about node.js is not very deep. But I think that the fast learning the language can still complete the task, so I used node.js to complete the project. Development environment: Visual Studio Code.
1. How node to read the file, how to read the command line user input terminal, wherein the statistical logic is relatively easy to achieve, so I went to learn node.js of fs file system, as well as `process.argv` (command-line instructions to obtain operation) relevant content, find a way to solve the.
2. npm use node packaging tools, package.json file is used to define the properties of the whole package, the test found that when a custom command line can not, in the understanding of its configuration, add a new configuration, { "bin": { "homework": "./ index.js"}}, precisely because of the lack of this configuration, resulting in homework command word is not recognized.
3. For user input -s command of it, if the information entered does not regulate how to do?
If the command input for the irregularities -s, information is returned correctly to the user input, for example:
If the command is a system would not custom, not for processing, and returns "This instruction does not";
4. After processing a file of statistics information easy to implement, how to recursive processing the contents of a folder of it, began to think very complicated, but the final solution is simple method to determine whether to make a folder, if the folder , direct recursion can be.
5. not very familiar with the grammar node, and the completion of advanced features, do not know what to open a way through the interface, the first thought was to write a program front-end interface, with a node to build a small backstage, front-end request data, you can return the background, but this method is not practical, such encoding time will greatly exceeds the preset time, with the help of csdn to find a way to draw node can use a graphical interface directly invoke the command line opens a graphical interface.
Fourth, the design and implementation process
1. Basic functions and expansion project functions of the system flow chart
2. GUI
Originally a node to write a simple http server, write to it, you can automatically open the back into a html graphical interface homeworkWc -x filename to run with
Five test
Test the basis of instructions:
1. homeworkWc -l filename
2. homeworkWc -w filename
3.homeworkWc -c filename
Expanding requirements directive:
1. homeworkWc -s -l/-w/-c file
2. homeworkWc -a filename
Test instructions advanced features:
VI Summary
In doing this project I am familiar with a language I want to study in depth, and use this language to complete the functional requirements of the job, you still have to try. Meanwhile From a software development point of view, in practice this project experience in the software requirements analysis, design, development and testing process, but also to better understand a product might his functions to be achieved is not difficult, but in the development of We have to consider many angles. Encounter a bug in the realization of this project when a little impatient and want to get rid of this bad habit, calmly analyze and solve problems with a better solution.