order for the program to calculate when the im-
portant classes are inspected. There is also an option
to include a list of “non-priority classes” which, if
refactored, will have a negative effect on the priority
score. This objective helps the search to generate
refactoring solutions that have focused on what a
software developer envisions to be the more im-
portant areas of the software code, and away from
other areas that should be avoided. The priority ob-
jective was tested in conjunction with a quality ob-
jective (derived from previous experimentation) in a
multi-objective setup. To measure the effectiveness
of the priority objective, the multi-objective ap-
proach is compared with a mono-objective approach
using just the quality objective. The quality objec-
tive values are inspected to deduce whether im-
provements in quality can still be derived in this
multi-objective approach and the priority scores are
compared to measure whether the developed priority
function can be successful in improving the focus of
the refactoring approach.
The average quality improvement scores were
compared across six different open source inputs
and, for the most part, the mono-objective approach
gave better improvements. The likely reason for the
better quality score in the mono-objective approach
is due to the opportunity for the mono-objective GA
to focus on that single objective without having to
balance the possibly contrasting aim of favoring
priority classes and disfavoring non-priority classes.
The multi-objective approach was able to yield im-
provements in quality across all the inputs. In one
case, with the Beaver input, the multi-objective was
able to not only yield an improvement in quality, but
also generate a better improvement on average than
the mono-objective approach. This may be due to
the smaller size of the Beaver input, which could
mean a restricted number of potential refactorings in
the mono-objective approach. It could also be influ-
enced by the larger range of results gained the mul-
ti-objective approach for that input. The average
priority scores were compared across the six inputs
and, for the mono-objective approach, were able to
give some improvement. However, in some specific
runs, the priority scores were negative. This would
relate to there being more non-priority classes being
refactored in a solution than priority classes, which,
for the mono-objective approach, is unsurprising.
The average priority scores for the multi-objective
approach were better in each case. It is presumed
that, as the mono-objective approach has no
measures in place to improve the priority score of its
refactorings, the solutions are more likely to contain
non-priority classes and less likely to contain priori-
ty classes than the solutions generated with the mul-
ti-objective approach.
The average execution times for each input were
inspected and compared for each approach. For most
inputs, the multi-objective approach was slightly
quicker than the mono-objective counterpart. The
times for each input program increased depending
on the size of the program and the number of classes
available. The average times ranged from two
minutes for the Mango program, to 53 minutes for
GanttProject. While the increased times to complete
the tasks for larger programs makes sense due to the
larger amount of computation required to inspect
them, XOM took less time than GanttProject and
JHotDraw. Although XOM has more lines of code
than these inputs, the reason more this is likely due
to the number of classes available in each program,
which is more reflective to the time taken to run the
tasks for them. Therefore, it seems to be implied that
the number of classes available in a project will have
a more negative effect on the time taken to execute
the refactoring tasks on that project than the amount
of code. It was expected that, due to the higher com-
plexity of the multi-objective GA in comparison to
the basic GA, the execution times for the mul-
ti-objective tasks would be higher also. Although the
times taken were similar for each approach, and
were more affected by the project used, this wasn’t
the case for all of the inputs. This may have been
due to the stochastic nature of the search. Depending
on the iteration of the task run, there may be any
number of refactorings applied in a solution. If one
solution applied a large number of refactorings, this
could likely have a noticeable effect on the time
taken to run the task. The counterintuitive execution
times between the mono-objective and mul-
ti-objective tasks may be a result of this property of
the GA.
In order to test the aims of the experiment and
derive conclusions from the results a set of research
questions were constructed. Each research question
and their corresponding set of hypotheses looked at
one of two aspects of the experiment. RQ1 was
concerned with the effectiveness of the quality ob-
jective in the multi-objective setup. To address it,
the quality improvement results were inspected to
ensure that each run of the search yielded an im-
provement in quality. In all 30 of the different runs
of the multi-objective approach, there was an im-
provement in the quality objective score, therefore
rejecting the null hypothesis H1
0
and supporting H1.
RQ2 looked at the effectiveness of the priority ob-
jective in comparison with a setup that did not use a
function to measure priority. To address this, a non-
An Approach to Prioritize Classes in a Multi-objective Software Maintenance Framework
221