In this series of exercises, we practice various refactoring techniques. You may want to run pylint on this script to find any pep8 compliance issues. Fix as much as issues you can.
Study the file 'extract_method.py'. Use 'extract method' technique to improve modularity of the code.
Study the file 'inline_method.py'. Use 'inline method' technique to improve readability of the code.
Study the file 'replace_temp_with_query_fowler.py'. Use Replace Temp with query' technique to improve readability of the code.
Study the file 'introduce_explaining_variable3.py'. Use Replace Temp with query' technique to improve readability of the code.
Study the file 'extract_method3.py'. Use 'extract method' technique to improve modularity of the code.
Study the file 'replace_temp_with_query.py'. Use 'Replace Temp with query' and 'Extract Method' techniques to improve readability of the code.
Study the file 'split_temp_variable.py'. Use 'split temporary variable' technique to clarify the code (make it easier to understand its intent.)
Study the file 'remove_assignment_to_param.py'. Use 'remove assignment to method parameter' technique to prevent future mistakes/bugs.
Study the file 'rename_method.py'. Use 'rename method' technique to clarify the code (make it easier to understand its intent.)
Study the file 'split_temp_variable2.py'. Use 'split temporary variable' technique to clarify the code (make it easier to understand its intent.)
Study the file 'introduce_explaining_variable.py'. Use 'Replace Temp with query' technique to improve readability of the code.
Study the file 'decompose_conditional2.py'. Use 'decompose conditional' technique to improve readability of the code.
Study the file 'consolidate_conditional.py'. Use 'consolidate conditional expression' technique to improve readability of the code.
Study the file 'consolidate_duplicate_conditional_fragments.py'. Use 'consolidate duplicate conditional fragments' technique to improve readability of the code.
Study the file 'remove_control_flag'.py. Use 'remove control flag' technique to improve readability of the code.
Study the file 'replace_nested_conditional_with_gaurd_clauses2.py'.py. Use 'Replace Nested Conditional with Gaurd Clauses' technique to improve readability of the code.
Study 'decompose_conditional.py' file. Use 'decompose conditional' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'consolidate_duplicate_conditional_fragments2.py' file. Use 'consolidate duplicate conditional fragments' Technique to improve the code.
Study 'remove_control_flag2.py' and 'remove_control_flag3.py'. Use 'remove control flag' technique in combination with any other refactoring technique you've learned to improve readability of the code.
Study 'replace_nested_conditional_with_gaurd_clauses.py'. Use 'replace nested conditional with gaurded clauses' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'move_field2.py'. Use 'move attribute' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'extract_class.py'. Use 'extract class' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'extract_class2.py'. Use 'extract class' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'extract_class3.py'. Use 'extract class' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'replace_magic_numbers_with_named_constants.py'. Use 'replace magic number with symbolic constant' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Study 'extract_superclass2.py'. Use 'extract class' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
Please submit your work to Gradescope.
-
Submit your work for Exercise 7 to Exercise 10 at Refactoring - Composing Methods (2)
-
Submit your work for Exercise 12 to 20 at Refactoring - Simplifying Conditional Expressions
-
Submit your work for Exercise 21 to 26 at Refactoring - other refactoring