diff --git a/main.py b/main.py index 6eb18e7..b9f056e 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ import json import os +import sys import subprocess import shutil from Keyvalue import JsonKeys @@ -334,7 +335,17 @@ def main(): print("Local Specimin not found. Cloning a Specimin copy") clone_specimin(issue_folder_dir, specimin_source_url) - json_file_path = 'resources/test_data.json' + args = sys.argv + specified_targets: str = "" + if (len(args) - 1) >= 1: + specified_targets = args[1] # paper_target/bug_target + + json_file_path: str + if specified_targets.lower() == "bugs": + json_file_path = os.path.join("resources", "sp_issue.json") + else: + json_file_path = os.path.join("resources", "test_data.json") + parsed_data = read_json_from_file(json_file_path) evaluation_results = [] diff --git a/resources/sp_issue.json b/resources/sp_issue.json new file mode 100644 index 0000000..fcf695c --- /dev/null +++ b/resources/sp_issue.json @@ -0,0 +1,142 @@ +[ + { + "issue_id" : "sp-151", + "url": "https://github.com/typetools/checker-framework.git", + "branch": "", + "commit_hash": "", + "project_name": "checker-framework", + "build_command": "", + "root_dir": "dataflow/src/main/java/", + "targets": [ + { + "method": "getReturnStatementStores()", + "file": "ForwardAnalysisImpl.java", + "package": "org.checkerframework.dataflow.analysis", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + }, + { + "issue_id" : "sp-150", + "url": "https://github.com/typetools/checker-framework.git", + "branch": "", + "commit_hash": "", + "project_name": "checker-framework", + "build_command": "", + "root_dir": "dataflow/src/main/java/", + "targets": [ + { + "method": "performAnalysisBlock(Block)", + "file": "ForwardAnalysisImpl.java", + "package": "org.checkerframework.dataflow.analysis", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + }, + { + "issue_id" : "sp-149", + "url": "https://github.com/typetools/checker-framework.git", + "branch": "", + "commit_hash": "", + "project_name": "checker-framework", + "build_command": "", + "root_dir": "dataflow/src/main/java/", + "targets": [ + { + "method": "performAnalysis(ControlFlowGraph)", + "file": "ForwardAnalysisImpl.java", + "package": "org.checkerframework.dataflow.analysis", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + }, + { + "issue_id" : "sp-148", + "url": "https://github.com/typetools/checker-framework.git", + "branch": "", + "commit_hash": "", + "project_name": "checker-framework", + "build_command": "", + "root_dir": "dataflow/src/main/java/", + "targets": [ + { + "method": "getStoreAfter(Block)", + "file": "AnalysisResult.java", + "package": "org.checkerframework.dataflow.analysis", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + }, + { + "issue_id" : "sp-152", + "url": "https://github.com/typetools/checker-framework.git", + "branch": "", + "commit_hash": "", + "project_name": "checker-framework", + "build_command": "", + "root_dir": "dataflow/src/main/java/", + "targets": [ + { + "method": "getValue(Tree)", + "file": "AbstractAnalysis.java", + "package": "org.checkerframework.dataflow.analysis", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + }, + { + "issue_id" : "sp-153", + "url": "https://github.com/randoop/randoop.git", + "branch": "", + "commit_hash": "", + "project_name": "randoop", + "build_command": "", + "root_dir": "agent/replacecall/src/main/java/", + "targets": [ + { + "method": "toString()", + "file": "MethodSignature.java", + "package": "randoop.instrument", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + }, + { + "issue_id" : "sp-154", + "url": "https://github.com/randoop/randoop.git", + "branch": "", + "commit_hash": "", + "project_name": "randoop", + "build_command": "", + "root_dir": "agent/replacecall/src/main/java/", + "targets": [ + { + "method": "premain(String, Instrumentation)", + "file": "ReplaceCallAgent.java", + "package": "randoop.instrument", + "inner_class": "" + } + ], + "cf_version": "", + "java_version": "jdk-17", + "note": "" + } +] \ No newline at end of file diff --git a/resources/test_data.json b/resources/test_data.json index a0eb6e0..364de9e 100644 --- a/resources/test_data.json +++ b/resources/test_data.json @@ -345,145 +345,5 @@ "cf_version": "3.40.0", "java_version": "jdk-17", "note": "" - }, - { - "issue_id" : "sp-151", - "url": "https://github.com/typetools/checker-framework.git", - "branch": "", - "commit_hash": "", - "project_name": "checker-framework", - "build_command": "", - "root_dir": "dataflow/src/main/java/", - "targets": [ - { - "method": "getReturnStatementStores()", - "file": "ForwardAnalysisImpl.java", - "package": "org.checkerframework.dataflow.analysis", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" - }, - { - "issue_id" : "sp-150", - "url": "https://github.com/typetools/checker-framework.git", - "branch": "", - "commit_hash": "", - "project_name": "checker-framework", - "build_command": "", - "root_dir": "dataflow/src/main/java/", - "targets": [ - { - "method": "performAnalysisBlock(Block)", - "file": "ForwardAnalysisImpl.java", - "package": "org.checkerframework.dataflow.analysis", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" - }, - { - "issue_id" : "sp-149", - "url": "https://github.com/typetools/checker-framework.git", - "branch": "", - "commit_hash": "", - "project_name": "checker-framework", - "build_command": "", - "root_dir": "dataflow/src/main/java/", - "targets": [ - { - "method": "performAnalysis(ControlFlowGraph)", - "file": "ForwardAnalysisImpl.java", - "package": "org.checkerframework.dataflow.analysis", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" - }, - { - "issue_id" : "sp-148", - "url": "https://github.com/typetools/checker-framework.git", - "branch": "", - "commit_hash": "", - "project_name": "checker-framework", - "build_command": "", - "root_dir": "dataflow/src/main/java/", - "targets": [ - { - "method": "getStoreAfter(Block)", - "file": "AnalysisResult.java", - "package": "org.checkerframework.dataflow.analysis", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" - }, - { - "issue_id" : "sp-152", - "url": "https://github.com/typetools/checker-framework.git", - "branch": "", - "commit_hash": "", - "project_name": "checker-framework", - "build_command": "", - "root_dir": "dataflow/src/main/java/", - "targets": [ - { - "method": "getValue(Tree)", - "file": "AbstractAnalysis.java", - "package": "org.checkerframework.dataflow.analysis", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" - }, - { - "issue_id" : "sp-153", - "url": "https://github.com/randoop/randoop.git", - "branch": "", - "commit_hash": "", - "project_name": "randoop", - "build_command": "", - "root_dir": "agent/replacecall/src/main/java/", - "targets": [ - { - "method": "toString()", - "file": "MethodSignature.java", - "package": "randoop.instrument", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" - }, - { - "issue_id" : "sp-154", - "url": "https://github.com/randoop/randoop.git", - "branch": "", - "commit_hash": "", - "project_name": "randoop", - "build_command": "", - "root_dir": "agent/replacecall/src/main/java/", - "targets": [ - { - "method": "premain(String, Instrumentation)", - "file": "ReplaceCallAgent.java", - "package": "randoop.instrument", - "inner_class": "" - } - ], - "cf_version": "", - "java_version": "jdk-17", - "note": "" } ]