Code Quality

The MOEA Framework is an academic tool. To meet the requirements of academic rigor, the developers have taken steps to ensure the correctness, robustness, reliability and quality of the MOEA Framework code. This page documents our efforts towards maintaining high standards for code quality. The information reported below is for the latest release, version 2.5.

Developer Tools

We use a number of developer tools behind the scenes to help identify problematic code prior to releases. These tools include:

  • JUnit - A unit testing framework
  • EclEMMA - Code coverage tool for Eclipse to identify code not covered by unit tests
  • FindBugs - Uses static analysis to find potential bugs in code
  • CodePro Analytix - For auditing code quality and metric calculation
  • CheckStyle - For ensuring source code follows coding guidelines

In addition, prior to every release, the library must pass all unit tests on popular Java implementations (Java SE 6, OpenJDK 6, OpenJDK 7) on Windows and Unix/Linux systems. These measures help ensure the library works consistently across various environments.

Code Statistics

The following table provides an overview of the size and complexity of the MOEA Framework. Note that lines of code only measures executable lines of code, ignoring comments and whitespace. See the Source Code Evolution chart to see how these values have changed over all releases.

Source Statistics
Lines of Source Code 25,561
Number of Comments 3,502
Number of Packages 38
Number of Classes 445
Number of Constructors 516
Number of Methods 1,832
Average Cyclomatic Complexity 2.04
Test Statistics
Lines of Test Code 16,932
Number of Unit Tests 1,163
Number of Unit Test Errors 0
Number of Unit Test Failures 0
Test Coverage 77.4%

Test Coverage

Test coverage measures the percentage of code which is in some way used during testing. Coverage makes no claims regarding the effectiveness of the unit tests, but helps identify code which is in no way covered by any unit tests. The table below shows the test coverage for each package in the MOEA Framework.

Legend: 0 - 50 % 50 - 80 % 80 - 100 %
Package Coverage Notes
org.moeaframework 81.9 %
org.moeaframework.algorithm 82.7 %
org.moeaframework.algorithm.jmetal 95.9 %
org.moeaframework.algorithm.pisa 86.7 %
org.moeaframewwork.analysis.collector 87.1 % Tests only check functionality, not correctness
org.moeaframework.analysis.diagnostics 0.0 % GUI, not covered by unit tests
org.moeaframework.analysis.sensitivity 88.0 %
org.moeaframework.analysis.tools 62.9 %
org.moeaframework.core 92.1 %
org.moeaframework.core.comparator 100.0 %
org.moeaframework.core.fitness 100.0 %
org.moeaframework.core.indicator 84.2 %
org.moeaframework.core.operator 92.8 %
org.moeaframework.core.operator.binary 95.3 %
org.moeaframework.core.operator.grammar 100.0 %
org.moeaframework.core.operator.permutation 98.6 %
org.moeaframework.core.operator.program 99.3 %
org.moeaframework.core.operator.real 94.9 %
org.moeaframework.core.spi 83.7 %
org.moeaframework.core.variable 98.4 %
org.moeaframework.problem 93.6 %
org.moeaframework.problem.CEC2009 81.9 % Code from CEC 2009 authors
org.moeaframework.problem.DTLZ 95.1 %
org.moeaframework.problem.LZ 63.3 % Code from LZ authors
org.moeaframework.problem.misc 92.3 %
org.moeaframework.problem.WFG 51.1 % Code from WFG authors
org.moeaframework.problem.ZDT 98.3 %
org.moeaframework.util 94.6 %
org.moeaframework.util.distributed 91.7 %
org.moeaframework.util.grammar 94.6 %
org.moeaframework.util.io 82.1 %
org.moeaframework.util.progress 91.4 %
org.moeaframework.util.sequence 92.8 %
org.moeaframework.util.statistics 95.3 %
org.moeaframework.util.tree 86.5 %