The reverse engineering of test-oracles is a notoriously hard problem. A popular approach is to use a tool like Daikon to dynamically infer pre- and post-conditions from execution traces (logs). Unfortunately, the underlying expressiveness of Daikon is very limited, so it cannot infer complex specifications. In this paper, we use sub-cases to circumvent the restriction. For a given target method, this paper proposes to first divide it into sub-cases. A sub-case may represent a complex subset of the method’s executions, but without necessarily requiring a complex formula to express it. E.g. we use visits (or visit-patterns, if we want to be more general) over the method’s control flow nodes to identify subcases. For each sub-case, pre- and post-conditions are inferred with Daikon. Daikon’s limitations still apply, but more useful oracles can be inferred, as we shall illustrate by a case study.
|Name||Technical Report Series|