Skip to content

GreenLab-Kebab/gl-kebab-r

Repository files navigation

Green Lab - Kebab Team - R Package

This repository is part of the project An Empirical Analysis of JavaScript Dead Code in the Wild, described in Kebab Team Base Repository. This repository contains the R package responsible for the experiment design and data analysis.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for experiment replication purpose.

Prerequisites

Tools

R Libraries

  • Tidyverse – ggplot2: Provides neat plots, with a more appealing visual and more options to configurate.
  • Data Table: Provides more versatile operations with dataframes.

Installation

After installing the tools, you can open and run the scripts in R Studio.

Scripts

The data analysis was split in scripts by domain to improve readability. There are 5 main scripts with additional 6 helper scripts with auxiliary functions.

Main files

  • Aggregate all results: Process the raw results from Android Runner located at data/androidrunner/output. It searches the directory for all CSV files in the format Aggregated_Results_Batterystats.csv. Unnecessary columns are dropped and new columns are created with information about the treatment and subject. The formating results are saved at data/androidrunner. All other scripts use the formatted CSV resulted from this script.
  • Descriptive Analysis: Provide basic descriptive static of the data.
  • Generate Plots: Provide all plots used in the project and the data analysis. ALl generated plots are saved at plots/
  • Hypothesis Test: Provide all tests used in this experiment: Shapiro and Kruskal. All results are saved at data\tests\, including a CSV containing a summary of the results.
  • Sandbox: Script used for open tests and exploration of the data. To make git stop tracking this file, run git rm --cached sandbox.R

Library scripts

  • Constants: Defines all constants used in the scripts.
  • IO: Defines all access to read and write data in the file system or the command line.
  • Plots: Wraps ggplot2 functions with configurations relevant for this project.
  • Preprocessing: Wraps functions for the preprocessing phase, keeping the main file clean and clear.
  • Subject: Provides information about subjects.
  • Test: Wraps functions for the hypothesis tests.

Authors

License

This project is licensed under the GLP-3.0 License - see the LICENSE file for details.