An Automatic Object State Machine Extraction Method Using Dynamic Analysis
Object behavior protocols are of great significance in guiding developers to understand and properly use the external functions provided by the object.Nevertheless,the related documents are often missed or inconsistent.Therefore,reverse analysis is used to recover the protocols.To achieve this goal,this paper presents a new method to extract Object State Machine(OSM) based on intentional method invoking and dynamic analysis.This method firstly extracts condition expressions containing class attributes from source code and defines states to be the sets of values of expressions at run-time as well as the exceptions;then gets states transition information by intentional method invoking;and finally uses the sates and the states transition information to construct object state machine.The corresponding prototype system has been realized and the preliminary experimental results show that this method can efficiently and accurately recovers behavior protocols.