<commit_before># UFFOptimizer

UFFOptimizer is a slimming JavaScript application tool for identifier and remover of unused foreign functions (UFF). 

## Installation

UFFOptimizer is developed on Node.js execution environment (v6.1.0). The following steps are needed for run the tool:

1- install Node.js environment  
Node.js can be download from (https://nodejs.org)

2- Download the project from github:

    git clone git://github.com/icpc17/UFFOptimizer.git
    cd UFFOptimizer

3- Install the project dependencies:

    npm install

## Usage

To use the UFFOptimizer on a project, first need to ensure that the following steps were performed:

1- Download the source code of the project to optimize from the benchmark or try another project. 
	
2- Install the dependencies

	cd projectToOptimize
	npm install

2- Create the bundle from the source code using the instructions and tools provided by the application. For example:

	npm run-script bundle

3- Run all the tests and verify that they all pass. For example:

	npm run-script test

Once those steps were executed you are already to executing the UFFOptimizer commands. The tool need to be used inside the project to optimize:
		
	cd projectToOptimize
	node [UFFO_path]/UFFOptimizer [command] [parameters]
	

## Commands and parameters

### Identify the required modules

To identify the required modules of the application you can execute the following command:

	node [UFFO_path]/UFFOptimizer modules [main file]
	
For Example:

	node ../../UFFOptimizer modules src/index.js

### Instrument the required modules

To instrument the required modules of the application you can execute the  following command:

	node [UFFO_path]/UFFOptimizer instrument [main file]
	
For Example:

	node ../../UFFOptimizer instrument src/index.js
	
### Optimize the required modules

To optimize the required modules of the application you need to run the tests of the project to optimize with the required modules instrumented. Additionally you need to put the results of the tests in a file named "profiling.txt" in the root of the project to optimize. Then you can execute the following command:

	node [UFFO_path]/UFFOptimizer optimize [main file]<commit_msg>Test slack github<commit_after># UFFOptimizer

UFFOptimizer is a slimming JavaScript application tool for identifier and remover of unused foreign functions (UFF). 

## Installation

UFFOptimizer is developed on Node.js execution environment (v6.1.0). The following steps are needed for run the tool:

1- install Node.js environment  
Node.js can be download from (https://nodejs.org)

2- Download the project from github:

    git clone git://github.com/icpc17/UFFOptimizer.git
    cd UFFOptimizer

3- Install the project dependencies:

    npm install

## Usage

To use the UFFOptimizer on a project, first need to ensure that the following steps were performed:

1- Download the source code of the project to optimize from the benchmark or try another project. 
	
2- Install the dependencies

	cd projectToOptimize
	npm install

2- Create the bundle from the source code using the instructions and tools provided by the application. For example:

	npm run-script bundle

3- Run all the tests and verify that they all pass. For example:

	npm run-script test

Once those steps were executed you are already to executing the UFFOptimizer commands. The tool need to be used inside the project to optimize:
		
	cd projectToOptimize
	node [UFFO_path]/UFFOptimizer [command] [parameters]
	

## Commands and parameters

### Identify the required modules

To identify the required modules of the application you can execute the following command:

	node [UFFO_path]/UFFOptimizer modules [main file]
	
For Example:

	node ../../UFFOptimizer modules src/index.js

### Instrument the required modules

To instrument the required modules of the application you can execute the following command:

	node [UFFO_path]/UFFOptimizer instrument [main file]
	
For Example:

	node ../../UFFOptimizer instrument src/index.js
	
### Optimize the required modules

To optimize the required modules of the application you need to run the tests of the project to optimize with the required modules instrumented. Additionally you need to put the results of the tests in a file named "profiling.txt" in the root of the project to optimize. Then you can execute the following command:

	node [UFFO_path]/UFFOptimizer optimize [main file]
{'fraction_non_alphanumeric': 0.05069020140303236, 'fraction_numerical': 0.005431093007467753, 'mean_word_length': 4.187793427230047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3560991', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1144, 'n_words': 599}