Arcan is available both from Terminal and GUI. Usage examples are presented below:

Arcan Terminal

AS Detection Example

Download Arcan from the download page. Arcan analyzes the project contained in my_project_location, stores the generated graph database at my_database_location, and performs the detection of all architectural smells (Cyclic Dependency, Hub-like dependency and Unstable dependency), with filtered results (saved in separated files), and computation of all metrics at class and package level (i.e. fan-in, CBO, LCOM), through the following command which will generate results reports (csv files) in the my_project_location/output folder:

 java -jar Arcan.jar -p my_project_location -neo4j -d my_database_location -all

Console

14:40:12.059 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start of Terminal Executor***
-projectFolder my_project_location
14:40:12.123 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - *** args:4***
14:40:12.123 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start graph building***
14:40:12.124 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start graph building***
14:40:12.483 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start Writing Neo4j***
14:40:12.484 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start Writing Neo4j*** - my_project_location/Neo4j/default.graphdb
2017-02-12 14:40:20 [WARN ] Neo4jGraph multi/meta-properties feature is considered experimental and should not be used in a production setting until this warning is removed
14:40:20.296 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Graph initializated***
14:40:20.299 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Graph initializated*** - graph:   neo4jgraph[Community [my_project_location/Neo4j/default.graphdb]]
14:40:20.299 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Graph initializated*** - builder: it.unimib.disco.essere.main.graphmanager.GraphBuilder@6318b7be
14:40:30.150 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Graph readed from compiled file***
14:40:30.841 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of graph building***
14:40:30.845 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start Cycle detection***neo4jgraph[Community [my_project_location/Neo4j/default.graphdb]]
14:40:32.228 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of Cycle detection***neo4jgraph[Community [my_project_location/Neo4j/default.graphdb]]
14:40:32.228 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start Unstable dependencies detection***neo4jgraph[Community [my_project_location/Neo4j/default.graphdb]]
14:40:32.988 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of Unstable dependencies detection***
14:40:32.988 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start of Hub-Like dependencies detection***
14:40:33.167 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of Hub-Like dependencies detection***
14:40:33.167 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start of Package Metrics Calculation***
14:40:33.221 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of Package Metrics Calculation***
14:40:33.221 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***Start of Class Metrics Calculation***
14:40:34.256 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of Class Metrics Calculation***
14:40:34.536 [main] INFO  it.unimib.disco.essere.main.TerminalExecutor - ***End of Terminal Executor***

Download Arcan from the download page. Arcan analyzes the project contained in my_project_location, and performs the detection of Unstable dependency, with filtered results, through the following command:

 java -jar Arcan.jar -p my_project_location -UD

Console

15:50:19.260 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Start of Terminal Executor***
15:50:19.328 [main] INFO  it.unimib.d.e.m.TerminalExecutor - *** args:4***
15:50:19.328 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Start graph building***
15:50:19.329 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Start graph building*** - \.
15:50:21.066 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Start Opening Tinkerpop***
15:50:21.226 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Graph initializated***
15:50:21.227 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Graph initializated*** - graph:   tinkergraph[vertices:0 edges:0]
15:50:21.227 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Graph initializated*** - builder: it.unimib.d.e.m.g.GraphBuilder@33d512c1
15:50:23.455 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Graph created from compiled file***
15:50:23.456 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Graph created from compiled file*** - graph:tinkergraph[vertices:428 edges:3405]
15:50:23.456 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***End of graph building***
15:50:23.457 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Start Unstable dependencies detection***tinkergraph[vertices:428 edges:3405]
15:50:23.506 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***End of Unstable dependencies detection***
15:50:23.506 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***Start Unstable dependencies filtering***tinkergraph[vertices:436 edges:3424]
15:50:23.518 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***End of Unstable dependencies filtering***tinkergraph[vertices:436 edges:3424]
15:50:23.518 [main] INFO  it.unimib.d.e.m.TerminalExecutor - ***End of Terminal Executor***

Summarized Documentation of Terminal Commands

Few parameters are needed to run Arcan. To specify what project has to be analyzed, use option -p and add the folder which contains it. Arcan supports three different kinds of input: a folder of compiled java files, a jar file, and a folder of jar files. Use respectively options -CL, -JR and -FJ to set the input type.

The dependency graph resulting from the analysis can be stored in a database using the command -neo4j, otherwise a default in-memory one will be instantiated. Use command -d followed by the database location to save the graph in it (only Neo4j is supported currently), otherwise will stored inside in a folder inside the project path.

Once the project to analyze and the database folder are set, use the analysis options to choose which analyses should be performed: architectural smells and/or metrics.

The output csv files will be stored in a specified folder using the -out parameter, otherwise will be created by default a sub-folder in the project called output.

The tool supports the following main command line parameters:

  • Default:
    • -projectFolder, -p: The project folder (default is a folder of java classes)
    • -all: Calculates all metrics and all type of architectural smells
  • Architectural smells detection parameter:
    • -CycleDependency, -CD, -cd: Calculates the class and package cycles of the graph. If the graph is already written and it is specified the project folder it will be read from the db folder.
    • -HubLikeDependencies, -HL, -hl: Search for Hub-Like dependencies
    • -UnstableDependencies, -UD, -ud: Search for Unstable dependencies
  • Metric:
    • -ClassMetrics, -CM, -cm:: Compute the metrics on classes
    • -PackageMetrics, -PM, -pm: Compute Robert C. Martin metrics on packages
  • Project read configuration parameter:
    • -class, -CL, -cl: The project folder contains only classes
    • -folderOfJars, -FJ, -fj: The project folder contains only jars
    • -jar, -JR, -jr: The project to analyze is only one jar
  • Neo4j database parameter:
    • -neo4j: if set write the neo4j database
    • -neo4jDBFolder, -d: Database folder (default here_path\Neo4j\default.graphdb)
  • Output folder of CSV files:
    • -outputDir, -out: output dir of results
  • Other:
    • -log, -verbose, -v: Level of verbosity
    • -help, -h: Print this help

Use parameter -h to resume the command list with associated description. This is the result for Arcan:

 java -jar Arcan.jar -h

Console

Usage: java -jar Arcan.jar -p project_path [options] [command] [command options]
		-projectFolder, -p
		   Description: The project folder (default is a folder of java classes)
		   Default: null
   Options:
		-all
		   Description: Calculates all metrics and all type of architectural smells
		   Default: false
	Architectural smells detection parameter:
		-CycleDependency, -CD, -cd
		   Description: Calculates the class and package cycles of the graph. If the graph is already written and it is specified the project folder it will be read from the db folder.
		   Default: false
		-HubLikeDependencies, -HL, -hl
		   Description: Search for Hub-Like dependencies
		   Default: false
		-UnstableDependencies, -UD, -ud
		   Description: Search for Unstable dependencies
		   Default: false
	Metrics computation:
		-ClassMetrics, -CM, -cm
		   Description: Compute the metrics on classes
		   Default: false
		-PackageMetrics, -PM, -pm
		   Description: Compute Robert C. Martin metrics on packages
		   Default: false
	Project read configuration parameter:
		-class, -CL, -cl
		   Description: The project folder contains only classes
		   Default: true
		-folderOfJars, -FJ, -fj
		   Description: The project folder contains only jars
		   Default: false
		-jar, -JR, -jr
		   Description: The project to analyze is only one jar
		   Default: false
	Neo4j database parameter:
		-neo4j
		   Description: if set write the neo4j database
		   Default: false
		-neo4jDBFolder, -d
		   Description: Database folder (default here_path\Neo4j\default.graphdb)
		   Default: .\Neo4j\default.graphdb
	Output folder of CSV files:
		-outputDir, -out
		   Description: output dir of results
		   Default: null
	Other:
		-log, -verbose, -v
		   Description: Level of verbosity
		   Default: 0
		-help, -h
		   Description: Print this help
		   Default: false              

Arcan GUI

Video tutorial of Arcan GUI

Video tutorial of Arcan is available on YouTube:

Tutorial of Arcan GUI

Tutorial of Arcan:

Download Arcan from the download page. Select from welcome window Build new project:

Select a .jar file or a folder with .class files or .jar files. Indicate a name folder where save the data base. Indicate the path of the folder where the results of the computation will be saved (in csv file). (n.b. if database folder and output folder will be not indicated where chosen default location instead).

Press execute button of the architectural smells you need analyse and/or metrics you need compute.

File Output

Hub Like dependency

HL.csv file collect all the Hub Like architectural smells founded in the analyzed project.

  • Class: class name
  • FanIn: value of the FanIn metrics of the class
  • FanOut: value of the Fan Out metrics of the class
  • TotalDependency: total amount of dependency of the class

Example:

 HL.csv: Class,FanIn,FanOut,Total Dependences
         org.apache.hadoop.security.SecurityUtil,40,36,76
         ...

Unstable Dependency

UD.csv file collect all the Unstable Dependency architectural smells founded in the analyzed project. UD30.csv has the same structure of the UD.csv file but it contains only filtered results.

  • UnstableDependenciesPackage: package name with Unstable dependency
  • InstabilityUnstableDependenciesPackage: value of the Instability metrics of Robert C. Martin of the UnstableDependenciesPackage
  • CorrelatedPackage: package name of correlated to UnstableDependenciesPackage
  • InstabilityCorrelatedPackage: value of the Instability metrics of Robert C. Martin of the CorrelatedPackage

Example:

 UD.csv: UnstableDependenciesPackage,InstabilityUnstableDependenciesPackage,CorrelatedPackage,InstabilityCorrelatedPackage
         org.apache.hadoop.hdfs.server.namenode.metrics,0.6666666666666666,org.apache.hadoop.metrics2.source,0.6842105263157895
         ...

Cyclic Dependency

classCycleShapeTable.csv file collect all the Cyclic dependency architectural smells by shape founded in the analyzed project. The file packageCycleShapeTable.csv reports in addition packages cycles and the classes involved in the package cycle.

  • IdCycle: ID of the cycle (a number)
  • CycleType: shape of the cycle
  • MinWeight: min weight of all dependsOn edges
  • MaxWeight: max weight of all dependsOn edges
  • numVertices: number of vertex class type involved in the cycle
  • ElementList: list of the class involved in the cycle

Example:

 classCycleShapeTable.csv: IdCycle,CycleType,MinWeight,MaxWeight,numVertices,ElementList
                           3559,circle,1,12,3,"org.apache.hadoop.mapred.FileInputFormat,..."
                           ...

classCyclicDependencyMatrix.csv file collect all the Cyclic dependency architectural smells among two classes founded in the analyzed project. The file packageCyclicDependencyMatrix.csv is similar but at packages level.

  • Cycle: class name
  • ClassX: 0 if there isn't a cycle, else 1

Example:

 classCyclicDependencyMatrix.csv: Cycle,Class1,Class2,...
                                  Class1,0,1...
                                  ...

classCyclicDependencyTable.csv file collect all the Cyclic dependency architectural smells among classes founded in the analyzed project. The file packageCyclicDependencyTable.csv is similar but at packages level.

  • Cycle: class id
  • ClassX: 0 if the class isn't in the cycle, else 1

Example:

 classCyclicDependencyTable.csv: Cycle,Class1,Class2,...
                                 Cycle1,0,1...
                                 ...

Class Metrics

CM.csv file collect all the classes metrics of the analyzed project

  • Class: class name
  • FI: Fan In metric value of the class
  • FO: Fan Out metric value of the class
  • CBO: coupling between objects metric value
  • LCOM: Lack of Cohesion of Methods

Example:

 CM.csv: Class,FI,FO,CBO,LCOM
         org.apache.tools.ant.AntClassLoader$ResourceEnumeration,1,3,3,0.5833333333333334
         ...

Package Metrics

PM.csv file collect all the package metrics of the analyzed project

  • Package: Package Name
  • CA: Count Afferent classes of the package
  • CE: Count Efferent classes of the packege
  • RMI: Robert C. Martin instability metrics
  • RMA: Robert C. Martin abstraction metrics
  • RMD: Robert C. Martin Distance from the main sequence metrics

Example:

 PM.csv: Package,CA,CE,RMI,RMA,RMD
         org.apache.hadoop.hdfs.protocol,73,21,0.22340425531914893,0.12903225806451613,0.4844131200867443
         ...