Skip to content

Refactor results.py #927

Open
Open
@DonggeLiu

Description

@DonggeLiu

Unify and redesign all result classes:

  1. Most result classes are in results.py but some others scattered in different files with duplicated names/attributes. For example, buildresult and runresult in builder_runner.py, SemanticCheckResult, and AggregatedResult. We should move them to one place for easier maintenance, merge some of them to avoid duplications, and redesign them for simpler accesses.
  2. Many result classes in results.py are too complex due to inheritance. For example, RunResult has more than 20 attributes, many of them come from BuildResult and Base Result classes. We need to simplify their design. For example, having a result class with multiple subclasses for build/run/analysis status:
class Result:
  benchmark: Benchmark
  build: optional[BuildStatus] = None
  run: optional[RunStatus] = None
  analysis: optional[AnalysisStatus] = None
 ...

class BuildStatus:  # Or other names, same below.
  fuzz_target_source: str
  build_script_source: str
  compiles: bool
  ...

class RunStatus:
  crashes: bool
  ...

class AnalysisStatus:
   crash_analysis: CrashAnalysis
   coverage_analysis: CoverageAnalysis
   ...

class CrashAnalysis:
  vulnerability: bool
  ...

class CoverageAnalysis:
  needs_improvements: bool
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions