Dynamic specification inference attempts to infer specifications of software's correct behaviors from execution traces. Automatic online specification mining (AOSM) automatically infers software specifications from online behaviors of in-field programs. Compared with off-line approaches, AOSM is more challenging. On the one hand, it is necessary to divide the evolving trace into small learning units, which we call scenario identification. On the other hand, if online programs encounter failure, erroneous traces which may make specifications inferred very possibly wrong will be produced. This paper gives the solutions of these two problems. For scenario identification, we extract sub-traces of methods issued by one method execution, and infer a FSM (Finite State Machine) model for each method. For the second problem, we assume that software functions are correct in most cases. So we utilize statistical approach to filter out failed software behavior. Meanwhile, based on such strategies, we present a framework for inferring specifications automatically for in-field software. The experiment result demonstrates that precision and completeness of specifications inferred by AOSM respectively have increases of 25% and 7.2% more than these inferred by off-line approach and that AOSM can effectively deal with software failure.
展开▼