FINDER is a design pattern detection tool for software written in Java. MoRe is a tool suite that helps the evaluation of design pattern detection results. This page describes how to install and use FINDER and MoRe.

Minimum requirements:
FINDER depends on Grok which means that at the moment it can only be run on Unix systems. Your Unix installation must include tcsh. The amount of memory required depends on the size of the software system you will apply FINDER on. Unless you are extracting design patterns from very large software, this is unlikely to be an issue.

Prerequisites:
In order to run FINDER, you need to have Javex, Grok, and QL installed in advance. These tools are developed by the Software Architecture Group (SWAG) at the University of Waterloo, and they can be found at SWAG site. (Note: FINDER is not compatible with all versions of the aforementioned tools. Some low versions of Javex may not work properly in FINDER. We suggest using FINDER equipped with Javex 1.0.8+. Some latest versions of Grok such as v95 which currently is the default downloadable version may report some warnings at runtime, although it doesn't influence the final results. However, the Grok (v83) that comes with QL should always work.)

Make sure you have set up certain environment variables for using all these tools, so that FINDER knows where they are. You can test this by calling the three tools at terminal. Messages such as “command not found” should not be there.

However, these prerequisites do not apply to MoRe since MoRe is not involved in the phase of design pattern detection. In fact, it is only used to the evaluation of detection results. Also, MoRe is written in Java which means it is not restricted to Unix systems.

Installation:
Download and extract FINDER and MoRe (all in one package) anywhere in your system. A number of configuration files need to be configured in order to apply FINDER and MoRe.
Let's assume that the path to the top level extracted directory is <path>.
Add the following commands to your .tcshrc file (adjust accordingly for other shells):

setenv FINDER_DIR <path>
setenv PATH ${PATH}:${FINDER_DIR}/bin

In order to detect patterns by FINDER, you will need to edit the following 4 files in the conf directory:

(Note: FINDER relies on both class files and source code of the target system.)

To run FINDER, simply give:

finderDPD “path to run.properties file”



The MoRe tool suite contains the following applications:

<FinderConf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<systemName>TAB2PS</systemName>
 <moreInstanceDestination>FINDERInstance/</moreInstanceDestination>
 <pattern patternName="Composite" inputFile="rawResults/TAB2PS.composite.out"/>
 <pattern patternName="Decorator" inputFile="rawResults/TAB2PS.decorator.out"/>
 <pattern patternName="Template Method" inputFile="rawResults/TAB2PS.templatemethod.out"/>
 </FinderConf>
Usage: finderConverter "path to the configuration file"
Usage: pinotConverter "software system name" "path to the raw result file" "output path (optional)"
Usage: ssaConverter "software system name" "path to the raw result file" "output path (optional)"
 Usage: presenter "path to a MoRe instance (optional)"

Usage: comparator “path to the Automatic MoRe instance” “path to the Benchmark MoRe instance” “one of the options below”

 options:
 -gap-b      Gross anchor precision based on Benchmark roles.
 -gar-b      Gross anchor recall based on Benchmark roles.
 -dap-b      Detailed anchor precision based on Benchmark roles.
 -dar-b      Detailed anchor recall based on Benchmark roles.
 -dapd-b     DAP diagram based on Benchmark roles.
 -dard-b     DAR diagram based on Benchmark roles.
 -gap-i      Gross anchor precision based on intersection of roles.
 -gar-i      Gross anchor recall based on intersection of roles.
 -dap-i      Detailed anchor precision based on intersection of roles.
 -dar-i      Detailed anchor recall based on intersection of roles.
 -dapd-i     DAP diagram based on intersection of roles.
 -dard-i     DAR diagram based on intersection of roles.
 -precision  Regular precision
 -recall     Regular recall

Combination of two MoRe instances can also be obtained by the comparator in the following way:

 Usage: comparator "path to one MoRe instance" "path to another MoRe instance" "the target combined file" -c

Note: Since there are quite a few options, in most cases, we use the next tool instead to obtain all metric results for convenience.

<CompareAll xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<systemName>TAB2PS</systemName>
<automaticTool>SSA</automaticTool>
<benchmarkTool>FINDER</benchmarkTool>
<baseType>intersection</baseType>
<listOfComparison>
<comparison patternName="Decorator" benchFile="FINDERInstance/TAB2PS_Decorator.xml"
 autoFile="SSAInstance/TAB2PS_Decorator.xml"/>
<comparison patternName="State" benchFile="FINDERInstance/TAB2PS_State.xml" 
 autoFile="SSAInstance/TAB2PS_State.xml"/>
<comparison patternName="Strategy" benchFile="FINDERInstance/TAB2PS_Strategy.xml" 
 autoFile="SSAInstance/TAB2PS_Strategy.xml"/>
<comparison patternName="TemplateMethod" benchFile="FINDERInstance/TAB2PS_TemplateMethod.xml" 
 autoFile="SSAInstance/TAB2PS_TemplateMethod.xml"/>
</listOfComparison>
</CompareAll>



A sample (located in the “sample” directory) is also provided in our package for the purpose of illustration and testing. This sample is based on a small software system – TAB2PS. In the “sample” directory, “TAB2PS” contains the software system, “sampleConf” contains all the above mentioned configuration files as an example, and “tab2ps_pinot.out” and “tab2ps_ssa.xml” are raw detection results provided by PINOT and SSA, respectively. In order to run the sample, simply give:

'runSample_tab2ps'

This command involves using FINDER to detect design patterns used in TAB2PS system, converting FINDER, PINOT and SSA raw results into MoRe instances, obtaining all the metric values among the results, and finally presenting the combination of all the results of Decorator pattern of the three tools as an example.