(
eval_path: str, dataset: str
)
| 80 | |
| 81 | |
| 82 | def 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 | |
| 103 | if __name__ == "__main__": |
no test coverage detected