Patent Document ID: 9594543
Application ID: 14442653
Patent Status: 1

Claim One:
1. A system behavior simulation method based on an activity diagram model, comprising the following steps: 1) reading a Unified Modeling Language (UML) activity diagram model stored in XML Metadata Interchange (XMI) format from a disk file; 2) parsing out various model elements, including initial node, final node, decision node, merge node, fork node, join node, action node, activity node, transition edge, and decision condition, from the UML activity diagram model, respectively, wherein, a transition edge is a directed edge for connecting nodes and indicating a node hopping direction, wherein a decision condition is a condition attached to a transition edge to control a token transition, and wherein a token is flag data that indicates an accessed node; 3) traversing the UML activity diagram model in a hybrid execution approach that incorporates symbolic execution and actual execution, and generating a set of simulation test cases, wherein the symbolic execution is used to express variables as symbols for operating a set of symbolic expressions of input variables as operation result, and accordingly update a symbol value table of the variables, and wherein the actual execution is used to substitute the variables with specific values and execute operations to obtain a set of specific values as the operation result, and accordingly update a specific value table of the variables; 3.1) initializing a constraint condition stack, a token, variable tables, a node coverage threshold, and a constraint solver, according to the various model elements parsed from the UML activity diagram model, wherein the constraint condition stack is a stack data structure configured to store constraint conditions, wherein the token transition indicates a value change of token flag data, wherein the variable tables include value table and symbol table of variables, wherein a node coverage value is the ratio of the number of accessed nodes to the total number of nodes parsed from the UML activity diagram model, wherein the node coverage value is calculated and updated continuously according to a node access condition while the node coverage threshold is preset, and wherein the constraint solver is configured to solve a set of constraint conditions to obtain specific variable values that meet the set of constraint conditions; 3.2) generating a set of input variable values randomly to enable the token to be transited in the direction of the transition edge, and treating different types of accessed nodes in different ways, respectively, comprising: 3.2.1) if the accessed node is an initial node, making no treatment and skipping the token in the direction of an exit edge to a next activity node; 3.2.2) if the accessed node is an action node, adopting the symbolic execution and the actual execution respectively for statements in the action node according to semantics represented by the action node, and updating the set of input variable values and the node coverage value; 3.2.3) if the accessed node is an activity node, entering into the UML activity diagram model associated with the activity node, and entering into step 1) to execute another UML activity diagram model simulation process; 3.2.4) if the accessed node is a decision node, selecting a token transition edge according to the decision condition on the exit edge of the decision node, and pushing the decision condition corresponding to the token transition edge into the constraint condition stack for subsequent use; 3.2.5) if the accessed node is a merge node, directly transiting the token into the next activity node; 3.2.6) if the accessed node is a fork node, replicating the token into a specific number of copies determined according to the number of exit edges of the fork node, and transiting backwards tokens obtained by replication along the token transition edge respectively; 3.2.7) if the accessed node is a join node, observing condition of tokens transited to nodes concurrent with the accessed node, and merging the tokens on all of the concurrent nodes into one token and moving backwards in the direction of the token transition edge if the tokens on all of the concurrent nodes are to be transited to the accessed node; 3.2.8) if the accessed node is a final node, reading all constraint conditions in the constraint condition stack, taking out the top constraint condition in the constraint condition stack and negating the top constraint condition, and then inputting the negated top constraint condition together with other constraints in the constraint condition stack into the constraint solver to solve constraints, updating the set of input variable values and storing the set of input variable values as the set of simulation test cases if a constraint solution is successful, otherwise saving path conditions that cannot be solved and corresponding traversing paths and having them confirmed manually by an operator, and at the same time, popping off the constraint condition stack top element in the constraint condition stack, taking out the next constraint condition in the constraint condition stack and negating the next constraint condition, and then inputting the negated next constraint condition together with other constraints in the constraint condition stack into the constraint solver to solve the constraints, and updating the set of input variable values; and 3.2.9) calculating and updating the node coverage value according to the node access condition, returning the token to the initial node, transiting the token in the direction of the transition edge with the set of input variable values updated in step 3.2.8), and entering into step 3.2.1) if the node coverage value goes beyond the node coverage threshold, otherwise entering into step 4); and 4) inputting the set of simulation test cases generated in step 3) to carry out a simulated execution of the UML activity diagram model.