# Raw Data for Experiments of Automated Evolution of Logging Statement Levels Using Git Histories and Degree of Interest

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3698983.svg)](https://doi.org/10.5281/zenodo.3698983)

## File Descriptions

### Quantitative Analysis

#### Tabular Data

File | Description
--- | ---
`result.csv` | Raw evaluation result summary of subjects. Includes (sub)project name, repo URLs, and running times per subject.
`repos.csv` | Statistics on subject repositories.
`log_tranformation_actions.csv` | Raw data for logging level transformation actions.
`input_log_invocations.csv` | Raw data for input log invocations.
`candidate_log_invocations.csv` | A subset of `input_log_invocations.csv` that are considered candidate for transformation.
`failures.csv` | Candidate log invocations that failed transformation preconditions.
`git_commits.csv` | Statistics on git commits used in the analysis. Includes running times per commit.
`SLOC.csv` | Number of source lines of code of subjects at the version analyzed.
`DOI_boundaries.csv` | DOI intervals mapping logging levels to degree of interest by subject.
`not_lower_levels_due_to_keywords.csv` | Log invocations whose logging levels are not lowered due to having particular keywords in their logging messages.
`not_raise_levels_due_to_keywords.csv` | Log invocations whose logging levels are not raised due to not having particular keywords in their logging messages.
`not_lower_levels_in_catch_blocks.csv` | Log invocations whose logging levels are not lowered due to catch blocks.
`not_lower_levels_in_if_statements.csv` | Log invocations whose logging levels are not lowered because they immediately follow `if` statements.
`not_transform_levels_due_to_if_condistion.csv` | Log invocations whose logging levels are not transformed because the they immediately follow `if` statements whose condition contain a logging level (log "wrapping").
`adjust_level_by_inheritance.csv`| Log invocations whose logging levels are transformed consistently across overriding methods.

#### SQL Dumps

File | Description
--- | ---
`experiments_dump.sql` | SQL dump file for the database building table 1 in the paper except for standard deviation of logging levels.
`distribution_dump.sql` | SQL dump file for the database computing standard deviation of log levels.

#### SQL Queries

File | Description
--- | ---
`experiments_gen.sql` | SQL file to build intermediate data for table 1 in paper.
`distribution_gen.sql` | SQL queries for computing standard deviation of logging levels before and after the transformation.

### Comparison With Manual Logging Level Changes

#### Tabular Data

File | Description
--- | ---
`actual_level_changes.csv` | Actual level changes extracted from git history.
`earliest_common_level_changes_minus_one.csv` | SHA-1s of the SHA-1 immediately before the earliest common logging level change in `actual_level_changes.csv`. These were used for analysis.

#### SQL Dumps

File | Description
--- | ---
`confusion_matrix_dump.sql` | SQL dump file for the confusion matrix database.

#### SQL Queries

File | Description
--- | ---
`confusion_matrix_gen.sql` | SQL queries to build the confusion matrix.
`confusion_matrix_gen_helper.sql` | Intermediate SQL queries to build the confusion matrix (see notes below).

### Pull Request Study

File | Description
--- | ---
`pulls.csv` | List of pull request URLs.

### Bug Study

File | Description
--- | ---
`logging_statements_in_change_contexts.csv` | Logging statements in buggy and non-buggy change contexts.

## Notes

The following notes provide information about the queries and tables included in the databases.

### `experiments_gen.sql`

#### Tables

1. `tool_results`: it is used to store data for "result" CSV file. It has one more column (subject) than the raw "result" CSV file.
2. `tool_repos`: storing data for "repos" CSV file.
3. `sequence_number`: storing all sequence numbers for evaluation.
4. `log_actions`: storing all log transformation actions with direction and distance.
5. `input_log_invocations`: all input log invocations, which are the same as raw input log invocations CSV file.
6. `git_commits`: all git commits, same as raw git commit CSV file.
1. `needed_log_actions`: used in a query in the file.
2. `framework_number`: used in a query in the file.
3. Query with comment "Pivot table": runs the final query in the file.
4. Query with comment "Data for git": used to generate git statistics in table 1.

### `confusion_matrix_gen.sql`

#### Tables

1. `sequence_number`: list of needed sequence numbers.
2. `raw_results`: it has one more column (subject) than the raw "result" CSV file.
3. `raw_repos`: storing data for "repos" CSV file.
4. `raw_log_actions`: storing all log transformation actions.

Run `confusion_matrix_gen_helper.sql` to get intermediate data and tables. The query results from `confusion_matrix_gen.sql` should be imported to the tables created by `confusion_matrix_gen_helper.sql`.

#### Scripts

1. Run `./import.sh`, giving the directory that has the raw CSV files as a command-line argument.
2. Edit `run.sh` to include the desired correct sequence numbers.
3. Run `./run.sh`

### `distribution_gen.sql`

#### Tables

1. `sequence_number`: list of needed sequence numbers.
2. `raw_log_actions`: import raw log transformation action file into this table.
3. `input_log_invocations`: notice that we only consider the JUL logging framework for this part of the study. The raw data should be filtered by the logging framework before importing.
4. `distribution`: the data is from the result of the query in the file.
5. `needed_log_actions`: using the query to build it. It only stores actions for the JUL logging framework.

Distribution results are obtained using the last two queries.
