Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/DevelopmentPlan/DevelopmentPlan.tex
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ \section{Proof of Concept Demonstration Plan}
\begin{enumerate}
\item Determine the code smells we want to address for energy saving.
\begin{itemize}
\item These are items like but not limited to: Large Class (LC), Long Parameter List (LPL), Long Method (LM), Long Message Chain (LMC), Long Scope Chaining (LSC), Long Base Class List (LBCL), Useless Exception Handling (UEH), Long Lambda Function (LLF), Complex List Comprehension (CLC), Long Element Chain (LEC), and Long Ternary Conditional Expression (LTCE).
\item List Comprehension in an \texttt{any} or \texttt{all} statement, Member Ignoring Method, Long Paramter List, Unused Imports, Long Message Chain, Unused Class Attributes and Variables
\end{itemize}
\item Determine the detectability of a specific code smell
\begin{itemize}
\item Many of these code smells are detectable using linters like Pylint, Flake8 and bandit. Hence the detection technology already exists if we choose to use it, and or the tools have been made before if we intend to remake them, proving they are possible to construct.
\item These code smells are detectable using Pylint or manual AST parsing.
\end{itemize}
\item Determine the appropriate refactorings for a particular detected smell that results in decreased energy consumption.
\begin{itemize}
\item There are many tools such as Pyjoule that we can use to measure the energy consumed by a piece of code. This step will involve various phases of trial and error as it is not a 1-1 trivial solution. There could be various refactorings possible for a given situation that all result in different energy consumption levels. We want our tool to choose the most optimal refactoring possible. For our POC this can exist as an algorithm. For our final project we can attempt to implement a neural network to choose between refactorings. There are also prebuilt free to use libraries we can implement to perform simple refactorings.
\item We will use codecarbon to measure the emissions of a python code file. This step will involve various phases of trial and error as it is not a 1-1 trivial solution. There could be various refactorings possible for a given situation that all result in different energy consumption levels. We want our tool to choose the most optimal refactoring possible. For our POC this can exist as an algorithm. For our final project we can attempt to implement a neural network to choose between refactorings. There are also prebuilt free to use libraries we can implement to perform simple refactorings.
\end{itemize}
\item Once we determine preset algorithms mapping detected smells to their appropriate refactorings, we want to then make those changes in the code, measure the energy consumption and test it against the original code ensuring it is less.
\item The code must then ensure that the original code functionallity is preserved. If it is not a different refactoring is required.
Expand Down