Individual projects -WC (C / C ++ Linux / Windows)

1. Github Address

https://github.com/S-TRAVELER/WC 

2.  PSP table

PSP2.1 Personal Software Process Stages Estimated time consuming (minutes) The actual time-consuming (minutes)
Planning plan 20 20
· Estimate • Estimate how much time this task requires 20 20
Development Develop 1370 1405
· Analysis · demand analysis  80 80
· Design Spec Generate design documents 60 50
· Design Review · Design Review  30 45
· Coding Standard · Code Specification 20 30
· Design · Specific design 60 60
· Coding · Specific coding 900 950
· Code Review · Code Review 100 90
· Test · Test (self-test, modify the code, submit modifications) 120 100
Reporting report 150 140
· Test Report · testing report 60 50
· Size Measurement · Computing workload 30 20
· Postmortem & Process Improvement Plan · Hindsight, and propose process improvement plan 60 70
Total  total 1540 1565


3.  Problem-solving ideas

       Since before the development is basically on Linux, see the topic needs to exe, so he plans to complete the development of the basic functions on the Linux platform, then compatible with Windows platforms.

3.1 Cross-Platform

        In consideration of the cross-platform (Linux + Windows), so I chose a combination of CMake + Qt; compiling with CMake to achieve cross-platform, Qt cross-platform GUI display.

In the source code, in addition to Gui is Qt implementation does not need to consider their own cross-platform, all other functions of the system needs its own judgment, and then operate the appropriate platform.

3.2 program basically

        To improve the scalability of programs, commands, options parser, respectively statistics were processed loosely coupled; makes the option parser, statistics can be different needs for policy replacement; command through inheritance decorative way to enhance the command function. Then, build a single command registrar example, commands to manage (see here, you can probably guess the command registry so that the program can support multiple commands simultaneously, rather than just a wc), improves the scalability.

 

3.2 wildcard support

        The idea is to achieve a wildcard wildcard expression into a regular expression, then realized poller directory, and then recursively traverse, in line with the wildcard file name as an argument callback. Note: Because Linux and Windows terminal CMD wildcard will be resolved, so the need to use double quotes (Windows is a single quotation marks) to the wildcard expression in quotes.

3.3 graphical interface

       The graphical interface is implemented using Qt, Qt provides a more aesthetically pleasing user interface.

More than 3.4 language support (customized -L)

        This function is regarded as a comment line to statistics, options lines of code (-a) expansion. When implementing functionality requirements of the subject, we recognize that different languages ​​have different ways of annotation, allows users to select the language, and then comment syntax statistics according to a user-selected language.

        By way of the configuration file, read different languages ​​comment syntax to achieve extend the language without the need for recompilation.


Fourth, design and implementation
 

 

Fifth, test run

5.1 input file that does not exist

Linux:

Windows:

 

5.2 is not selected file

Linux:

Windows:

5.3 No test option

Linux:

Windows:

More than 5.4 file test

Linux:

 Windows:

5.5 Wildcard test

Linux:

Windows:

5.6 Options disorder test 

Linux:

 

Windows:

 5.7 recursive directory

Linux:

 Windows:

 

 5.8 GUI test

Linux:

Windows:

 

 

5.9 Code Coverage

 

VI project summary

  The project selected C / C ++ as a development language, CMake + Qt as a development tool, GCov \ LCov do code coverage checking.

  The development effort follows the use of object-oriented thinking to solve the problem, continue to consider the level of software modules to minimize coupling module. Spend more software modules in the design aspects of time. In addition, this development is compatible with Linux and Windows two systems, in part to write compatible code also spent a lot more time.

        The development process using a relatively large number of callbacks to enhance code reuse rate, which is relatively satisfied with their own place; but there is still insufficient, the code redundancy is still relatively high.

 

 

 

Guess you like

Origin www.cnblogs.com/ZWJCNBLOG/p/11569859.html