diff --git a/src/orchestrator/blacklist.py b/src/orchestrator/blacklist.py index b4ed58f..91860a5 100644 --- a/src/orchestrator/blacklist.py +++ b/src/orchestrator/blacklist.py @@ -63,6 +63,7 @@ def is_file_mutable(fn: str) -> bool: 'src/perception_pcl', 'src/orocos_kinematics_dynamics/orocos_kdl/src/path_roundedcomposite.cpp', 'src/orocos_kinematics_dynamics/orocos_kdl/src/velocityprofile.cpp', + 'src/rospack/src/utils.cpp', 'src/image_pipeline/depth_image_proc/src/nodelets/convert_metric.cpp', 'src/image_pipeline/depth_image_proc/src/nodelets/crop_foremost.cpp', diff --git a/src/orchestrator/coverage.py b/src/orchestrator/coverage.py index bb3a0db..af02321 100644 --- a/src/orchestrator/coverage.py +++ b/src/orchestrator/coverage.py @@ -42,8 +42,8 @@ def compute_mutant_coverage(client_bugzoo: BugZooClient, ) -> TestSuiteCoverage: # NOTE coverage appears to become flaky beyond 8 simultaneous threads # threads = max(threads, 8) - logger.info("computing coverage for mutant: %s", mutant) - logger.info("num. coverage threads: %d", threads) + logger.info("computing coverage for mutant: %s", mutant.uuid) + logger.debug("num. coverage threads: %d", threads) coverage_baseline = load_baseline_coverage() snapshot_mutant = client_bugzoo.bugs[mutant.snapshot] @@ -51,19 +51,19 @@ def compute_mutant_coverage(client_bugzoo: BugZooClient, filename = list(mutant.mutations)[0].location.filename tests = [t for t in snapshot_mutant.tests \ if filename in coverage_baseline[t.name].lines.files] - logger.info("restricting coverage for mutant to following tests: %s", - ', '.join([t.name for t in tests])) + logger.debug("restricting coverage for mutant to following tests: %s", + ', '.join([t.name for t in tests])) mutant_instrumented = None try: - logger.info("creating temporary instrumented mutant") + logger.debug("creating temporary instrumented mutant") mutant_instrumented = \ client_boggart.mutate(fetch_instrumentation_snapshot(client_bugzoo), mutant.mutations) snapshot_instrumented = \ client_bugzoo.bugs[mutant_instrumented.snapshot] - logger.info("created temporary instrumented mutant: %s", - mutant_instrumented) + logger.debug("created temporary instrumented mutant: %s", + mutant_instrumented) coverage = compute_coverage(client_bugzoo, snapshot_instrumented, tests, @@ -145,7 +145,7 @@ def load_baseline_coverage() -> TestSuiteCoverage: if __BASELINE_COVERAGE: return __BASELINE_COVERAGE - logger.info("attempting to load precomputed coverage for baseline A.") + logger.debug("attempting to load precomputed coverage for baseline A.") try: with open(BASELINE_COVERAGE_FN, 'r') as f: jsn = json.load(f) @@ -156,7 +156,7 @@ def load_baseline_coverage() -> TestSuiteCoverage: # restrict to mutable files files = [fn for fn in coverage.lines.files if is_file_mutable(fn)] __BASELINE_COVERAGE = coverage.restricted_to_files(files) - logger.info("loaded precomputed coverage for baseline A.") + logger.debug("loaded precomputed coverage for baseline A.") return __BASELINE_COVERAGE diff --git a/src/orchestrator/liveness.py b/src/orchestrator/liveness.py index bf5b64d..a3e5cbd 100644 --- a/src/orchestrator/liveness.py +++ b/src/orchestrator/liveness.py @@ -30,7 +30,8 @@ def mutant_fails_test(client_bugzoo: BugZooClient, mutant.mutations) locations = [r.location for r in replacements] lines = [FileLine(l.filename, l.stop.line) for l in locations] - logger.info("lines changed by mutant: %s", lines) + logger.info("lines changed by mutant: %s", + sorted(set(l.num for l in lines))) # restrict to the test outcomes that may be changed by the mutant coverage = load_baseline_coverage() @@ -38,7 +39,8 @@ def mutant_fails_test(client_bugzoo: BugZooClient, tests = list(snapshot.tests) tests = [t for t in tests \ if any(line in coverage[t.name] for line in lines)] - logger.info("tests covered by mutant: %s", [t.name for t in tests]) + logger.info("tests covered by mutant: %s", + sorted(set(t.name for t in tests))) container = None try: diff --git a/src/orchestrator/localization.py b/src/orchestrator/localization.py index 838bc5b..807ca7c 100644 --- a/src/orchestrator/localization.py +++ b/src/orchestrator/localization.py @@ -64,8 +64,9 @@ def suspiciousness(ep: int, np: int, ef: int, nf: int) -> float: except darjeeling.exceptions.NoImplicatedLines: raise FailedToComputeCoverage - logger.info("computed fault localization (%d files, %d lines):\n%s", - len(localization.files), len(localization), localization) + logger.info("computed fault localization (%d files, %d lines)", + len(localization.files), len(localization)) + logger.debug("fault localization: %s", localization) lines = FileLineSet.from_list([l for l in localization]) logger.info("suspicious lines:\n%s", indent(repr(lines), 2)) return localization diff --git a/src/orchestrator/orchestrator.py b/src/orchestrator/orchestrator.py index f21c015..c087563 100644 --- a/src/orchestrator/orchestrator.py +++ b/src/orchestrator/orchestrator.py @@ -172,13 +172,13 @@ def __init__(self, self.__baseline_with_instrumentation = \ fetch_instrumentation_snapshot(self.__client_bugzoo) - logger.info("fetching coverage information for Baseline A.") + logger.debug("fetching coverage information for Baseline A.") self.__coverage_for_baseline = \ load_baseline_coverage() # type: TestSuiteCoverage logger.debug("mutable files: %s", self.__coverage_for_baseline.lines.files) - logger.info("fetched coverage information for Baseline A.") - logger.info("line coverage for Baseline A: %d lines", len(self.lines)) + logger.debug("fetched coverage information for Baseline A.") + logger.debug("line coverage for Baseline A: %d lines", len(self.lines)) def shutdown(self) -> None: """ @@ -342,7 +342,7 @@ def perturbations(self, else: restrict_to_lines = [line_num] logger.info("Looking for perturbations at lines: %s", - restrict_to_lines) + sorted(set(restrict_to_lines))) generator_mutations = \ boggartd.mutations(baseline, @@ -433,10 +433,10 @@ def perturb(self, perturbation: Mutation) -> None: try: try: # TODO capture unexpected errors during snapshot creation - logger.info("Applying perturbation to baseline snapshot.") + logger.debug("Applying perturbation to baseline snapshot.") mutant = boggartd.mutate(baseline, [perturbation]) snapshot = bz.bugs[mutant.snapshot] - logger.info("Generated mutant snapshot: %s", snapshot) + logger.info("Generated mutant snapshot: %s", snapshot.name) if not mutant_fails_test(bz, boggartd, mutant): raise NeutralPerturbation self.__problem = self._build_problem(mutant)