Use test-driven development and incremental development by solving ONE problem at a time.
2. In bash, START by going into the homework folder and creating the transform subfolder.
a. In the transform folder create two files with the touch command
b. Launch Atom and 0pen the comp424 folder. In Atom's Project pane you should have the folder comp424 because you'll need access to the review folder in projects.
c. In Atom
python is a cool language
lots of libraries out there
more practice is helpful
best advice do not get discouraged
collaborate more
d. Continue by following the guidelines below.
2. BEFORE you start your design:
a. Write a class header for the class Transform.
b. Write a class docstring that simply says: Has methods that transform data structures.
c. Inside the class, write
3. Write THREE TEST CASES at the end of the Python module in a function named main()
a. Write the function docstring for main(). It simply says: Tests the Transform methods.
b. Create a Transform object and assign it to variable transform_obj.
c. Define a local variable called test_input to store the input value that is passed to the method calls.
d. Write method calls with test_input as argument and assign the return value to the result variable.
e. When ONE test case is completed:
f. Test cases are chosen as follows:
The input variable for each test case of the longest_words(histogram) is defined as follows:
The input variable for each test case of the most_popular_words(self, file_name) is defined as follows:
4. Write your DESIGN in a separate file named README.md
a. Use Markdown simple tags to create heading with the names of the methods (use ###)
b. Include the header and docstring of the method and encompass it within the backticks ``` and ```
c. Describe the logical steps that the method will carry out.
d. Itemize the logical steps using the Markdown tag *
e. As you describe the logical steps:
f. Choose descriptive names for the new variables and use them in your explanations
g. Test the current state of your module with $ python transform.py
5. Write the IMPLEMENTATION of your method definitions
a. Follow the logical steps in the DESIGN
b. Use the f-string to form the string that prints out the result.
c. Test the current state of your module
d. Debug if necessary until you have no Python errors.
6. Apply Python coding style conventions and verify them with pycodestyle and pylint tools.
7. When you are satisfied with the DESIGN, IMPLEMENTATION, TESTING, and CODING STYLE of the FIRST problem
a. Move on to tackle the SECOND problem
b. Repeat the steps 3 to 6.
Problem 1
Define a method longest_words(self, histogram) that finds and returns a list of the longest unique words corresponding to the keys in the dictionary histogram
histogram: dictionary
keys: strings
values: non-negative integers
Returns: list of strings of the same size
Testing requirements: To test the implementation of this method you must use three test cases
Problem 2
Define a method most_popular_words(self, file_name) that finds and returns a list of unique words that have the highest frequency in a text file.
file_name: name of a text file in current directory
Returns: list of strings
Testing requirement: To test the implementation of this method you must use three test cases