Where to Handle an Exception? Recommending Exception Handling Locations from a Global Perspective
收藏Figshare2021-03-08 更新2026-04-28 收录
下载链接:
https://figshare.com/articles/dataset/Where_to_Handle_an_Exception_Recommending_Exception_Handling_Locations_from_a_Global_Perspective/13664039
下载链接
链接失效反馈官方服务:
资源简介:
The Replication Package (data & code) AND A Simple Demo of EHAdvisor.######## Introduction of Replication Package (replication.zip) #########READMEThis is the replication package of the paper **"Where to Handle an Exception? Recommending Exception Handling Locations from a Global Perspective"**.## ContentThis package includes the codes to replicate the experiments in the paper as following:* `Graph`: This folder includes the codes to use AST Parser JDT to parse the source codes in a project and construct the numerical samples that are represented with the four features (i.e. architectural feature, project feature, functional feature, and exception feature). The entry is `App.java`. You can use it to construct samples for any other Java project.* `Dataset`: For the convenience to replicate, we release the extracted samples from the 29 popular Java projects. This folder includes the data we adopt in the experiments.* `Train`: This folder includes the scripts to train the binary classification model with AutoGluon.* `FeatImportanceAnalysis`: This folder includes the scripts to calculate the importance score of each feature with AutoGluon.## Replication Instruction### Package Requirement* Python 3.8* AutoGluon 0.15For more details about the package requiment, we provide a package list in `requirements.txt`. You can type the command `pip install -r requirements.txt` to easily construct the experiment environment.### Exepriment Instruction:* Train and apply the classification model with a specific scenario (i.e. one of across-project, intra-project, and intra-project+) as following, where PROJECTID is the id of the target project that request for the recommendation. This step will generate a binary-classification model as well as the predicted catch probability on each method for each its related exception. * Across-project recommendation: Run the `across.py` script in `train` directory as `python across.py --train_id=PROJECTID`. * Intra-project recommendation: Run the `intra.py` script in `train` directory as `python intra.py --train_id=PROJECTID`. * Intra-project+ recommendation: Run the `intraplus.py` script in `train` directory as `python intraplus.py --train_id=PROJECTID`.* Run the `top.py` script in `train` directory to get the recommendation result and the recommendation performance in terms of SuccRate@1,2,3.* Other: * You can run the `calcImportance.py` script in `FeatImportanceAnalysis` directory to get the importance score of each type of featres with AutoGluon. * You can specify the training time limit and the output directory for AutoGluon through changing the value of `time_limites` and `oupput_directory` in `across.py`, `intra.py`, `intraplus.py`, and `calcImportance.py`.######## Introduction of Simple Demo (demo.zip) ######### READMEThis is the simple demo of the paper **"Where to Handle an Exception? Recommending Exception Handling Locations from a Global Perspective"**. We release this demo to simply illustrate the preliminary use flow of EHAdvisor.Given a project and a specific method, this demo will output the location recommendations to handle the exceptions thrown by this method on all its call chains.## Usage1. Obtain a base binary-classification model. You can use a pre-trained model we release on our webpage or train a model with `python trainModel.py` (please refer to the replication package instruction for the details about training).2. Run `python tools.py` to execute the demo script.3. Input the path to the source code of the target project after the script prompts "Please input the path of the source folder:", e.g., `shiro`.4. Input the path to the description text of the target project after the script prompts "Please input the path of the project document file:", e.g., `shiro/readme.txt`.5. Input the method requiring for the location recommendations after the scripts promts "Please input the name of method:", e.g., `org.apache.shiro.cache.ehcache.EhCacheManager$ensureCacheManager`.6. Then, you will get the location recommendations to handle the exceptions thrown by this method on all its call chains.
创建时间:
2021-03-08



