Skip to content
Merged
Show file tree
Hide file tree
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
107 changes: 67 additions & 40 deletions docs/Design/SoftArchitecture/MG.tex
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,15 @@ \section{Module Hierarchy} \label{SecMH}
actually be implemented.

\begin{description}
\item [\refstepcounter{mnum} \mthemnum \label{mHH}:] Hardware-Hiding Module
\item [\refstepcounter{mnum} \mthemnum \label{mSmell}:] Smell Module
\item [\refstepcounter{mnum} \mthemnum \label{mBR}:] BaseRefactorer Module
\item [\refstepcounter{mnum} \mthemnum \label{mMIMR}:] MakeStaticRefactorer Module
\item [\refstepcounter{mnum} \mthemnum \label{mSCLR}:] UseListAccumulationRefactorer Module
\item [\refstepcounter{mnum} \mthemnum \label{mUGENR}:] UseAGeneratorRefactorer Module
\item [\refstepcounter{mnum} \mthemnum \label{mCRC}:] CacheRepeatedCallsRefactorer Module
\item [\refstepcounter{mnum} \mthemnum \label{mLEC}:] LongElementChainRefactorer Module
\item [\refstepcounter{mnum} \mthemnum \label{mPyA}:] Pylint Analyzer Module
\item [\refstepcounter{mnum} \mthemnum \label{mTest}:] Testing Functionality Module
\end{description}


Expand All @@ -205,10 +210,15 @@ \section{Module Hierarchy} \label{SecMH}
\textbf{Level 1} & \textbf{Level 2}\\
\midrule

{Hardware-Hiding Module} & ~ \\
{Hardware-Hiding Module} & None \\
\midrule

\multirow{7}{0.3\textwidth}{Behaviour-Hiding Module} & CacheRepeatedCallsRefactorer Module\\
\multirow{7}{0.3\textwidth}{Behaviour-Hiding Module} & Smell Module\\
& BaseRefactorer Module\\
& CacheRepeatedCallsRefactorer Module\\
& MakeStaticRefactorer Module\\
& UseListAccumulationRefactorer Module\\
& ?\\
& UseAGeneratorRefactorer Module\\
& ?\\
& LongElementChainRefactorer Module\\
Expand All @@ -218,9 +228,9 @@ \section{Module Hierarchy} \label{SecMH}
& ?\\
\midrule

\multirow{3}{0.3\textwidth}{Software Decision Module} & {?}\\
& ?\\
& ?\\
\multirow{3}{0.3\textwidth}{Software Decision Module} & Pylint Analyzer Module\\
& Testing Functionality Module\\
& Measurements Module\\
\bottomrule

\end{tabular}
Expand Down Expand Up @@ -257,53 +267,48 @@ \section{Module Decomposition} \label{SecMD}
(\emph{--}) is shown, this means that the module is not a leaf and will not have
to be implemented.

\subsection{Hardware Hiding Modules (\mref{mHH})}
\subsection{Hardware Hiding Modules}

\begin{description}
\item[Secrets:]The data structure and algorithm used to implement the virtual
hardware.
\item[Services:]Serves as a virtual hardware used by the rest of the
system. This module provides the interface between the hardware and the
software. So, the system can use it to display outputs or to accept inputs.
\item[Implemented By:] OS
\end{description}
This system has no hardware components.

\subsection{Behaviour-Hiding Module}

\subsubsection{Smell Module (\mref{mSmell})}

\begin{description}
\item[Secrets:]The contents of the required behaviours.
\item[Services:]Includes programs that provide externally visible behaviour of
the system as specified in the software requirements specification (SRS)
documents. This module serves as a communication layer between the
hardware-hiding module and the software decision module. The programs in this
module will need to change if there are changes in the SRS.
\item[Implemented By:] --
\item[Secrets:] Data structure of a code smell.
\item[Services:] Provides an interface for other modules to access information of a smell object.
\item[Implemented By:] EcoOptimizer
\item[Type of Module:] Abstract Data Type
\end{description}

\subsubsection{Long Element Chain Module (\mref{mLEC})}
\subsubsection{Base Refactorer Module (\mref{mBR})}

% [Record, Library, Abstract Object, or Abstract Data Type]

\begin{description}
\item[Secrets:] How to parse a given code file to its AST representation, traverse the
AST tree to identify dictionary assignments, analyze the structure of nested dictionaries,
and flatten them. Additionally, it identifies all access calls associated with these dictionaries
in the source code and determines how to update them to reflect the new flattened structure.
\item[Services:] Detects nested dictionaries in the source code using AST parsing, simplifies their
structure by flattening them, and updates all associated access calls throughout the file. This improves
code readability, reduces complexity, and ensures correctness while maintaining the program's intended behavior.
\item[Secrets:] None
\item[Services:] Offers an interface for other refactoring modules to implement.
\item[Implemented By:] EcoOptimizer
\end{description}

\subsubsection{Input Format Module (\mref{mInput})}
\subsubsection{MakeStaticRefactorer Module (\mref{mMIMR})}

% [Record, Library, Abstract Object, or Abstract Data Type]
\begin{description}
\item[Secrets:] How to parse a given code file to its AST representation, how to traverse the AST tree, how to modify specific nodes in the AST tree, how to convert the modified AST tree back to source code and write it to an output file.
\item[Services:] Refactors the \textit{\textbf{Member Ignoring Method (MIM)}} smell in a provided code file to improve energy efficiency.
\item[Implemented By:] EcoOptimizer
\end{description}

\subsubsection{UseListAccumulationRefactorer Module (\mref{mSCLR})}

% [Record, Library, Abstract Object, or Abstract Data Type]

\begin{description}
\item[Secrets:]The format and structure of the input data.
\item[Services:]Converts the input data into the data structure used by the
input parameters module.
\item[Implemented By:] [Your Program Name Here]
\item[Type of Module:] [Record, Library, Abstract Object, or Abstract Data Type]
[Information to include for leaf modules in the decomposition by secrets tree.]
\item[Secrets:] How to parse a given code file into its AST representation, how to traverse the AST tree, how to find the initializing variable of the string concatenation, how to find the scope of the concatenation, how to modify the given code file in plain text and write it back to an output file.
\item[Services:] Refactors the \textbf{\textit{String Concatenation Inside Loop (SCL)}} smell in a provided code file to improve energy efficiency.
\item[Implemented By:] EcoOptimizer
\end{description}

\subsubsection{UseAGeneratorRefactorer Module (\mref{mUGENR})}
Expand All @@ -320,8 +325,20 @@ \subsubsection{CacheRepeatedCallsRefactorer Module (\mref{mCRC})}
\item[Implemented By:] EcoOptimizer
\end{description}

\subsubsection{Etc.}
\subsubsection{Long Element Chain Module (\mref{mLEC})}

% [Record, Library, Abstract Object, or Abstract Data Type]

\begin{description}
\item[Secrets:] How to parse a given code file to its AST representation, traverse the
AST tree to identify dictionary assignments, analyze the structure of nested dictionaries,
and flatten them. Additionally, it identifies all access calls associated with these dictionaries
in the source code and determines how to update them to reflect the new flattened structure.
\item[Services:] Detects nested dictionaries in the source code using AST parsing, simplifies their
structure by flattening them, and updates all associated access calls throughout the file. This improves
code readability, reduces complexity, and ensures correctness while maintaining the program's intended behavior.
\item[Implemented By:] EcoOptimizer
\end{description}

\subsection{Software Decision Module}

Expand All @@ -336,7 +353,7 @@ \subsection{Software Decision Module}
\item[Implemented By:] --
\end{description}

\subsubsection{Pylint Analyzer Module}
\subsubsection{Pylint Analyzer Module (\mref{mPyA})}

\begin{description}
\item[Secrets:] The internal design and execution of static code analysis using Pylint and AST parsing, including custom detection and structuring of smells. These details are hidden from external modules.
Expand All @@ -349,6 +366,16 @@ \subsubsection{Pylint Analyzer Module}
\item[Implemented By:] \texttt{EcoOptimizer}
\end{description}

\subsubsection{Testing Functionality Module (\mref{mTest})}

% [Record, Library, Abstract Object, or Abstract Data Type]

\begin{description}
\item[Secrets:] Runs testing suites in a subprocess.
\item[Services:] Checks whether the functionality of a given source code has changed.
\item[Implemented By:] EcoOptimizer
\end{description}


\section{Traceability Matrix} \label{SecTM}

Expand Down Expand Up @@ -428,7 +455,7 @@ \section{Use Hierarchy Between Modules} \label{SecUse}

\begin{figure}[H]
\centering
%\includegraphics[width=0.7\textwidth]{UsesHierarchy.png}
\includegraphics[width=\textwidth]{../../Images/use_hierarchy_modules.png}
\caption{Use hierarchy among modules}
\label{FigUH}
\end{figure}
Expand Down
Loading