MCPcopy Index your code
hub / github.com/evalplus/evalplus / collect_mutation_info

Function collect_mutation_info

tools/tsr/mutation_init.py:82–100  ·  view source on GitHub ↗
(
    eval_path: str, dataset: str
)

Source from the content-addressed store, hash-verified

80
81
82def collect_mutation_info(
83 eval_path: str, dataset: str
84) -> Dict[str, Dict[str, List[Any]]]:
85 mutation_info = {task_id: {} for task_id in get_task_ids(dataset)}
86 assert os.path.isfile(
87 eval_path
88 ), f"mutation testing result file {eval_path} missing!"
89 eval_res = json.load(open(eval_path, "r"))["eval"]
90 for task_id, v in eval_res.items():
91 for i_code, (status, res_list) in enumerate(v["plus"]):
92 if status == "success":
93 continue
94 for i_test, res in enumerate(res_list):
95 test_id = f"plus_{i_test}"
96 if res == False:
97 mutation_info[task_id].setdefault(test_id, []).append(
98 ("mutant", i_code)
99 )
100 return mutation_info
101
102
103if __name__ == "__main__":

Callers 2

get_mutation_set_coverFunction · 0.90
mutation_init.pyFile · 0.85

Calls 1

get_task_idsFunction · 0.90

Tested by

no test coverage detected