WC final report for mbaxswx3
Overview
Requirement met:
- Counting lines, words, bytes, chars and the number of longest sentences.
- Supporting different input files.
- Supporting different combination of flags(-l,-w,-c,-m,-L)
- Verifying illegal options.
- Calculating total result for multiple input files.
- Displaying version and manual information.
- Supporting ' Stdin ' mode with a combination of flags.
Requirement missed:
- flags from -lwc, -lm etc.
Product: Design and implementation
- Architecture:
The wc.py follows the MVC design pattern:
- Controller Layer: The argparse module receives parameters from users and then to determine which function should be called.
- Model Layer: The functions(countLine, countWord and countBytes) are responsible to count the correct result of input files.
- View Layer: The displaying function(miniwc1,miniwc2 etc) receives the data from Model Layer and then print it out on the terminal
Source code metrics
As for the input data, it is suitable to give various types of data in order to test the robustness under different situations to the software.
separating each output variable by using \t tag.
Sometimes forget some possible combinations of different flags
网友评论