Skip to content

CMD Configuration

Antonela edited this page Jun 20, 2019 · 4 revisions

Once everything is set up, we can start using the tool!

Parameterisation Options

As described in the Software Architecture page, Sen4Smells is designed as a pipeline to be used from the command line. Tool has a few parameters:

usage: Architectural Debt Index Sensitivity Analysis [-path <arg>] [-index
       <arg>] [-versions <arg>] [-features <arg>] [-level <arg>] [-morris]
       [-sobol] [-logger <arg>] [-help]
 -path <arg>       Directory with the input data.
 -index <arg>      Specifies the index over which run the sensitivity
                   analysis. Possible options: arcan, sonargraph. In the
                   case of Arcan, input must include the .jar
                   corresponding to the selected versions.In the case of
                   Sonargraph input must include the .xml reports
                   corresponding to the selected versions.
 -versions <arg>   The span of versions to analyse.
 -level <arg>      Specifies the abstraction level at to which perform the
                   sensitivity analysis. The availability of this option
                   depends on the index under analysis.Possible options:
                   smell-instance, smell-type, package-group.
 -sobol            Runs the Sobol analysis.
 -logger <arg>     The default logger is ALL. It can be changed to
                   WARNING, SEVERE, INFO or OFF
 -help             Prints this message

Path

Must contain the files needed for the evaluation. In principle, the needed files vary according to the selected Architectural Debt Index:

  • The Arcan index is selected, .jar files representing the system versions are needed.
  • The Sonargraph index is selected, .xml files represeing the Sonargraph analysis over the corresponding versions are neded.

Index

Represents the Debt Index to analyse. It must be in accordante to the files provided as input. Default value: arcan.

Versions

Optional argument that allows to specify the span of versions to analyse. It accepts two arguments, which define the first and last version to consider in the analysis. It is important to note that the names of the versions passed as parameters must match the names of the files in the input path without the extension. For example, given the following versions in the input path:

input_path/
├── version1.jar
├── version2.jar
├── version3.jar
├── ...
├── versionN.jar

Valid examples of versions parameterisation are:

version1 version3
version2 versionN

Invalid examples of versions parameterisation are:

version1.jar version3.jar
version2 versionN.jar

Default value: all versions in the input path.

Level

Indicates the granularity level of the Sensitivity Analysis to perform. Supports three options:

  • smell-instance. Individually analyses the detected smells. The output is a ranking of smells.
  • smell-type. Group smells according to their types. The output is a ranking of smell types.
  • package-group. Group smells according to the package their affect. In the case of cycles, the smell is assigned to every package involved in the cycle. The grouping works considering the set of top level packages. The output is a ranking of packages. Default value: smell-instance.

Sobol

Runs the Sobol analysis. During the execution several files will be created on a directory called sa inside the defined input-path. Those auxiliary files will be deleted before finishing the execution.

Logger

Specifies the desired logger level. It can be set to WARNING, SEVERE, INFO or OFF. Default value: INFO.

The executable .jar provided as the release as well as the .jar created when executing the mvn package command is packaged with everything needed for running the tool. In case the following message appears on the console:

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

And the output effectively only show ERROR messages, add the following flag to the java invocation:

-Dlog4j.configurationFile=\PATH-TO-FILE\log4j2.xml 

The log4j2.xml file can be found under .\src\resources.