0% found this document useful (0 votes)
9 views

Code Refactoring Technique Lab Sheet

The document provides instructions on refactoring a project to follow Java coding conventions. It lists 10 steps to refactor the project including adding design patterns, modifying classes and methods, removing unnecessary variables, adding comments, improving exception handling with loggers, and removing hard coded values.

Uploaded by

kalana heshan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Code Refactoring Technique Lab Sheet

The document provides instructions on refactoring a project to follow Java coding conventions. It lists 10 steps to refactor the project including adding design patterns, modifying classes and methods, removing unnecessary variables, adding comments, improving exception handling with loggers, and removing hard coded values.

Uploaded by

kalana heshan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Modern Topics in IT (MTIT)

4th Year – Semester 01


Coding Conventions and Refactoring
by Udara Samaratunge

 Download the Project Hackerthon2015Input in the course web and Refactor the project as
follows.

1) Refactor the Project with adding proper design patterns (Add Template method, Singleton
Design Patterns for the project).

2) Modify project Classes, Methods and all implemented variables according to Java coding
conventions.

3) Remove all unnecessarily created variables and use meaning full variables according to
Java coding conventions.

4) Use enhanced for loops for iterations

5) Put all Xpaths, and resource file paths in the configuration file. (Remove all hard coded
paths/Xpaths in the project.)

6) Modify each class with adding class-level, method-level, single-line comments and multi-
line comments.

7) Modify Exception handling hierarchy with catching specific exception and each exception
should be logged.

8) Add loggers for necessary places.

9) Remove all hard coded Strings and magic numbers with using proper constants.

10) Refactor whole project according Java coding conventions.

Modern Topics in IT (MTIT) by Udara Samaratunge Page 1

You might also like