README
======


Content of this archive
-----------------------

* `data` directory contains the required data to replicate our evaluations:
	* `case-study`: CSS files used to the industrial case study
	* `experiment`: CSS files used to the experiment
* `results` directory contains the results of our evaluations,
	especially answers to the survey into `survey-responses.pdf`.
* `scripts` directory contains scripts to replicate our evaluations
* `mocss-1.0.3.zip` is the source code of our tool `Mocss`,
	that we make publicly available from the GitHub platform: https://github.com/acharpen/mocss


Experiment
----------

### Data Collection

1. Create a working directory.
	````
	mkdir work
	````

2. Run the script `webapps.rb`
	to compute characteristics of several CSS files.
	* Input: path to the directory containing CSS files.
	* Output: a csv file containing for each CSS file the number of rules and declarations.
	````
	./scripts/webapps.rb data/experiment work/webapps.csv
	````

3. Run the script `running-times.rb`
	to compute running time of Mocss on several CSS files.
	* Input: path to the directory containing CSS files.
	* Output: a csv file containing for each file ten running times.
	````
	./scripts/running-times.rb data/experiment work/running-times.csv
	````

4. Run the script `mixins.rb`
	to compute the number of generated mixins according to different thresholds.
	You may want to reduce the number of CSS files to analyze
	or the number of thresholds to test (line 24) in order to decrease the running time.
	* Input: path to the directory containing CSS files.
	* Output: a csv file containing for each CSS file the number of generated mixins.
	````
	./scripts/mixins.rb data/experiment work/mixins.csv
	````

### Data analysis

* Run the script `experiment.r`
	to produce figures.
	You may have to edit the location of the directory containing all data (line 4).
	````
	R --no-save -f ./scripts/experiment.r
	````
