Make UtExecution abstract, introduce UtFailedExecution as its child #804
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.
Description
Make
UtExecution
abstract, introduceUtFailedExecution
as its child.Rationale
There is a
UtExecution
class that represent any execution regardless of the way it has been found. It has two subclasses,UtSymbolicExecution
andUtFuzzedExecution
. The separation of these entities is artificial:UtSymbolicExecution
contains data provided by the symbolic engine and used by the summarizer thatUtFuzzedExecution
does not have. Having two distinct child classes instead of a singleUtExecution
allowed the summarizer to correctly handle executions coming from two sources, the symbolic engine and the fuzzer.There is another special kind of execution: an execution that is produced by a concrete executor when running the method leads to a failure (e.g., JVM crash). It is not possible to produce any "after state" in this case, and the execution result is always a failure.
Currently these executions are created as just
UtExecution
instances, and summarizer ignores them (see #800). As a result, executions may be lost.It is necessary to correctly process these failed executions in the summarizer, and to distinguish them from "normal" executions. It seems not very convenient to make explicit checks to distinguish between a parent class and its subclasses.
This PR uses the following approach.
UtFailedExecution
, that is a subclass ofUtExecution
but has a restricted set of parameters so we can't create a "successful" failed execution instance by mistake.UtExecution
abstract to prevent creating "unclassified" execution instances.That way the summarizer can explicitly handle failed executions and generate correct summaries for them.
Limitations
This solution seems not to be "final" in any way. We have to properly define the interface between execution producers (fuzzer, symbolic engine, concrete executor, or any other kind of producer that can be added in the future) and the summarizer. In particular, it seems right to separate executions not by their source but by a set of available information (e.g., basic executions, executions with attached Jimple/bytecode/source code information, summarizer-annotated executions and so on). Maybe the additional data can be attached in some general form as annotations instead. This "correct" refactoring is a major enterprise and can't be performed immediately.
At the same time, we need to fix the issue with lost executions, so an "intermediate" refactoring is necessary.
Related issue: #800
Type of Change
How Has This Been Tested?
Automated Testing
All existing unit tests should pass.
Manual Scenario
None (it will be possible to test the fix for #800, for which this refactoring is a prerequisite).
Checklist (remove irrelevant options):
This is the author self-check list