示例#1
0
from projectLib.AnalyzerInfo import AnalyzerInfo
from projectLib.Comparison import Comparison
from projectLib.Heuristic import Heuristic
from projectTests.ProjectConfig_test import *

# REQUIRES: mine tests should be passed!

juliet_res_dir = project_source_dir + "/AnalyzerOutputs/juliet_output_lines.svres"
svace_res_dir = project_source_dir + "/AnalyzerOutputs/svace_output_lines.svres"

juliet_info = AnalyzerInfo()
juliet_info.mine_info("juliet", juliet_res_dir, code_project_source_path, cwe_num_list, warnings_list["juliet"])

svace_info = AnalyzerInfo()
svace_info.mine_info("svace", svace_res_dir, code_project_source_path, cwe_num_list, warnings_list["juliet"])

lines_heuristic = Heuristic(heuristic_name="lines", heuristic_params=dict({"distance": 0}))
lines_comparison = lines_heuristic.compare_info_with_heuristic(svace_info, juliet_info)

print("ANALYZER 1")
lines_comparison.print_comparison("an1")
print("ANALYZER 2")
lines_comparison.print_comparison("an2")
print("ANALYZER BOTH")
lines_comparison.print_comparison("an_both")
print("Test Finish")

示例#2
0
from projectLib.AnalyzerInfo import AnalyzerInfo
from projectLib.Comparison import Comparison
from ProjectConfig import *
from projectLib.Heuristic import Heuristic

from development.developmentTools.JulietSpecific.JulietSpecificAnalyzerInfo import juliet_divide_files, juliet_divide_funcs_svace
# INFO GENERATION PART START
print("INFO GENERATION PART START")

juliet_res_dir = xml_source_path["juliet"]
svace_res_dir = xml_source_path["svace"]
cwe_num_list = cwe_num_list

juliet_info = AnalyzerInfo()
juliet_info.mine_info("juliet", juliet_res_dir, cwe_num_list,
                      warnings_list["juliet"])

svace_info = AnalyzerInfo()
svace_info.mine_info("svace", svace_res_dir, cwe_num_list,
                     warnings_list["svace"])

# EXPERIMENTAL
svace_info, juliet_info = juliet_divide_files(svace_info, juliet_info)
svace_info = juliet_divide_funcs_svace(svace_info)

svace_info.save_info(info_path["svace"], info_ind=0)
juliet_info.save_info(info_path["juliet"], info_ind=0)

print("INFO GENERATION PART END")
# INFO GENERATION PART END
# COMPARISON GENERATION PART START