Skip to content

Commit

Permalink
scripts readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Tufano committed Jan 20, 2022
1 parent 1904da5 commit 574b84b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The `script` folder contains the following files:
- `find_map_test_cases.py`: the main script to find and map test cases in a repository
- `TestParser.py`: an utility class that parses test cases
- `java-grammar.so`: tree-sitter Java grammar file


## Extraction & Mapping
To extract test cases and map them to focal methods, we can run the `find_map_test_cases.py` script, which takes the following arguments:

- `--repo_url`: GitHub URL of the repo to analyze
- `--repo_id`: ID used to refer to the repo
- `--grammar`: Filepath of the tree-sitter grammar
- `--tmp`: Path to a temporary folder used for processing
- `--output`: Path to the output folder


### Example
Let us analyze the Apache Hadoop project (url: https://github.com/apache/hadoop), extract and map test cases using this command:

```
python find_map_test_cases.py
--repo_url https://github.com/apache/hadoop
--repo_id 23418517
--grammar ./java-grammar.so
--tmp /tmp/tmp/
--output /tmp/output/
```

0 comments on commit 574b84b

Please sign in to comment.