Individual projects wc (java achieve)

A, Github URL:

https://github.com/Clarazhangbw/Wc.exe

Two, PSP table

PSP2.1

Personal Software Process Stages

Estimated time consuming (minutes)

The actual time-consuming (minutes)

Planning

plan

100

 120

· Estimate

• Estimate how much time this task requires

 100

 120

Development

Develop

 1080

1620

· Analysis

· Needs analysis (including learning new technologies)

240

 360

· Design Spec

Generate design documents

 60

 60

· Design Review

· Design Review (and his colleagues reviewed the design documents)

 15

 15

· Coding Standard

· Code specifications (development of appropriate norms for the current development)

 30

 40

· Design

· Specific design

 40

 40

· Coding

· Specific coding

 720

 1020

· Code Review

· Code Review

 30

25

· Test

· Test (self-test, modify the code, submit modifications)

 30

 60

Reporting

report

 145

175

· Test Report

· testing report

 90

 120

· Size Measurement

· Computing workload

 25

 25

· Postmortem & Process Improvement Plan

· Hindsight, and propose process improvement plan

30

 30

total

 

 1325

 1915

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Third, the difficulties encountered and solutions

       Difficult Description:

  1. Since a long time does not come into contact with java, so in the programming process, such as what kind of use, which some of the features implemented in any way, even in grammar, there have been major difficulties;
  2. Initially without first building good procedural framework leading to the back of the East 1 West when writing code, not a clearer structure;
  3. Not familiar with unit testing and knowledge of this type of recursion;

       What did try:

  1. On the review java, on the one hand is to look back to the previous code is written, on the other hand is when you do not understand it to read books or Baidu;
  2. For procedural framework, which flowchart, after a few more changes to the code module of a larger change, decided to give up before the original chaotic code, re-sort the relationship between the project requirements and pass each module;
  3. Read "Building of the law", go online and check the learning unit testing knowledge;

       It is resolved:

    For there on the java source framework review, are found in their own learning process in the sense, after first planning to write, it will also clearer thinking in the late coding them; but due to the last time is not sufficient and its own inadequate knowledge base, unit testing did not understand too clear.

        What harvest:

    We review a lot of content on java, such as building graphical interfaces, such as input and output streams; have a general plan for their future coding, know first plan, then the implementation, rather than on the dry excitedly. Although a lot of knowledge and understanding about unit testing, but it is still difficult to use.

Fourth, the problem-solving ideas

  •     I am beginning to get the title when, in fact extreme panic. First of all because of java rusty, for the achievement of various performance function is not clear, so the analysis of the topic and want to start from where to start here more difficult. Later he decided to solve the problem of the nature of the use of java, and then begin to analyze the topic after the review, making plans.
  •     There are some among some of the features found in the subject did before with text editors for review with the java, is not blind to see some video or something, I mainly look back at the course set before his past, because similar places such statistics the number of characters, number of words, as well as a graphical interface open some file operations.
  •     Once you have the basics of reserves, the project needs analysis.
  •     The first is the overall framework, initially I did not think a lot, the main idea is to first realize each function separately, and then the main function calls these functions to realize the function.
  •     Main functions: user input command, to judge whether to view statistics operator through a graphical interface to select the file, and then according to a user input selecting statistic call "function" "graphical function" display to obtain the corresponding tag value.
  •     Function Function: start compare upset that I was not very clear to build the framework for the entire program code, stay in, all of the features, such as statistics the number of characters, such as the number of comment lines and expand basic features are placed inside a function, then each time the user selects a particular value statistics, the function will call the function, performance function to each variable values ​​are calculated, and then the user needs that value is returned to the main function. Drawbacks of doing so is that the program execution time is longer and have a surplus of computing, unfortunately, I have to finally find this weakness. Also offers some lessons for later coding.
  •     -c, -w, -l these are relatively simple, () method of each character in the document are sequentially scanned, and then make the determination by the accumulation can be read according to a character, a word characteristics. For statistical word this is too much trouble, the final decision criterion is, as long as two consecutive letters and above and behind the word is "\ n" or other non-alphabetic characters, words ++, but that there is a problem is that the amount of words every time less one, as the last word in the face, because he does not have any last character, so if a sentence is not a full stop, and that the last word of the sentence, if not into it. So I added a word to the control variable, a continuous two alphabetic characters, words will add 1, then a number of spaces until it encountered calculation at the number of words accumulate operation.
  •     -s recursive processing files in the directory, at the beginning of this unfamiliar, it may be more conflict saw a recursive two words, so why not learn behind the study. Today, suddenly aware of a solution, but due to unreasonable overall framework setting, so in the end there is no way to change after the big frame to add this feature into it.
  •     These statistics -a special line is the most important provisions, a good understanding of division based on a variety of special lines, such as the details are partakers comment line two, one is / * * / branches can write comments, other // One is, so to carry out special treatment for special cases. Then call readline () method within each line progressive scan file statistics on it.
  •     -x graphical interface functions: first review will JFrame, JPanel, JLabel and other java classes on the CSDN, mastered inherit JFrame, custom components, create components, add components to a form set, form is displayed, set the monitor and other steps after , you need to be designed for the needs of the code. JTextArea class when calling the text box component, due to the JPanel, as well as the layout of the entire window is not set up, resulting in the text box has not achieved the desired display by querying Baidu, found the size of the text box and several layout way, keep trying and finally after successfully achieve the desired effect.
  •     Unit Testing: create the basis of the test file to test the code. Read "Building of the law" to understand the importance of unit testing and website for the relevant steps.

Fifth, the design and implementation process

              wc categories: including a function wc (File file), which function to achieve counts characters, lines, basic and extended functions of word books, special lines. Call the function able to draw all the statistical results.

              gui0 categories: including functions gui0 () function, users advanced features -x, when the user inputs -x, command, select the file box appears, the user can select a file to obtain the appropriate statistical results.

              gui categories: gui0 class derived from a class, when the user selects a file, the interface statistics of the pop-up to select the desired obtained, the interface allows calls gui0 function to re-select the file.

              test classes: class-based class, acquires a user instruction, determines whether to enter the graphical interface, if entered by the user get statistics conditions selected to invoke a method to display statistics wc.

       Overall, the design of Java classes and functions when these master is not clear, so many features are on the side of a whole class inside a function, it is time to realize from the entire program, there will be a lot of unnecessary complex calls. The following is a call to my relationship with the various categories:

 

 

Sixth, the test run

       1. Test directory

 

       2. The program starts

      3. Basic functions

 

 Test basic functionality -c, only a test file for the character "c" of the document

 

 Test basic functionality -l, test file is only one line of "you are so cute" document

 

 Test basic functionality -w, only a test file for the word "cute" document

 

 Test extensions -a, test files as the basic source code files

Testing multiple functions appear together statistical results, the test file is only one line of "you are so cute" document

 

 

 

 

 

 Test advanced features -x, open the file and click graphical interface to display statistical results, the test file is only one line of "you are so cute" document

 

VI Summary

              在本次项目完成前期,我因为对java的学习不够充分,很多java语法还有一些类,构造函数之类的都忘了,所以面对这个项目是手无足措的,面对详细的需求也没有想法。比如说看到统计字数,脑海里只有一些以前做过的比较模糊的记忆,不知道应该具体怎么写。最后通过查阅资料和翻看以前自己写过的代码找回了一些感觉。在重新学习java上也花了不少时间,也警醒了自己之后要经常练习,保持对代码的熟悉感。

              本次项目我学到了很多,首先当然是java的运用,通过实操项目,找回了一些比如说I/O流,函数调用,图形界面设计的知识。同时也从0到1实现了一个程序,从预估,设计,编码,开发,测试,文档等流程中锻炼自己。在Debug当中找自己的问题,最主要的就是,在开始项目之前要规划好项目期间每天的计划,每天要规划好当天内需要解决的事情。在开发的过程中,随时记录自己出现的问题,以便后续解决。总的来说,项目不仅增加了我对代码的熟悉感,而且也吸取了很多流程要点问题。

    在这次个人项目中,我还有不足之处,那就是由于我对递归处理文件这个知识点学习的不充分,导致于在临近截止的时候才想出解决方案,但是由于程序框架已经构建好,而且不够灵活,使得这个函数无法再插入我的程序里,修改起来很麻烦,因此没有实现-s功能。也是一个遗憾。另外一点就是,在做项目初期,对程序整体架构没有构建好,所以导致后面经常出现大幅度的修改,耗费时间长,这是非常不好的习惯。经过这次项目,我也意识到自己的不足。往后的项目中会先计划,边测试边开发,提高代码质量。

 

Guess you like

Origin www.cnblogs.com/clarazhang/p/11588221.html