Refactor Result Classes with Unified Data Container and Improved Extensibility #948
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because the old PR: #941 is accidentally closed and cannot be reopened. I created this new PR with new nits fixed commit.
Description:
This pull request introduces a major refactor to the
Result
class and its associated data classes. The key improvements and changes are:1. UML Design: Inheritance → Composition
BuildResult
andRunResult
inbuilder_runner.py
andresults.py
) to streamline data containers.UML Diagram Link
2. Class Renaming for Clarity
BuildResult
,RunResult
, andAnalysisResult
to:BuildInfo
RunInfo
AnalysisInfo
3. Migration to New Result Class
results.py
fuzz_target_error.py
builder_runner.py
run_one_experiment.py
semantic_analyzer.py
pipeline.py
evaluator.py
execution_stage.py
prototyper.py
enhancer.py
4. New Class Field Semantic Definition
succeeded
→compiles
inBuildInfo
succeeded
→crashes
inRunInfo
get_build_script_source()
andget_fuzz_target_source()
inResult
for better access.5. Crash and Coverage Adaptations
Result
:true_bug
andinsight
fromCrashResult
run_error
,crash_func
,crash_symptom
,crash_stacks
fromSemanticCheckResult
CoverageAnalysis
to include:improve_required
insight
suggestions
success
property toAnalysisInfo
.6. Error Type Consolidation
SemanticCheckResult
into an enumeration:FuzzTargetResult
.NORM_NO_SEMANTIC_ERR
)FP_TARGET_CRASH
)COV_NO_INCREASE
)NON_SEC_CRASH_NULL_DEREF
,NON_SEC_CRASH_SIGNAL
)GEN_OVERWRITE_CONST
)error_type
toAnalysisInfo
for better alignment with analysis stages.7. Backward Compatibility and New API Methods
is_build_successful()
to preserve backward compatibility for current business logic.8. Code Quality and Refactor Considerations
Result
class can be safely consumed across multiple stages without boundary errors.Great thanks to @DonggeLiu for input on refining the UML Design and background context clariying and @oliverchang for reviewing the first version commits.