Font Size: a A A

Design And Implementation Of A Single Function Java Program To The CPN Model Transformation Tool

Posted on:2019-03-12Degree:MasterType:Thesis
Country:ChinaCandidate:M Q HuoFull Text:PDF
GTID:2428330563957205Subject:Computer technology
Abstract/Summary:PDF Full Text Request
At present,the application of software is very extensive.The cost of detecting errors in the early stage of software development is lower than that of later discovery and modification.There are two drawbacks in the traditional model based testing method.One is manual modeling,the correctness of the model is not easy to be guaranteed,and the two is that the workload of modeling and testing is very large and the efficiency is low.Therefore,this thesis designs and implements a transformation tool for single function Java program to Colored Petri Net(CPN)model.By reading the program to be tested,our tools automatically analysis and process the source code and export the model files that are fully in line with the CPN Tools format.On the one hand,the process of generating CPN model is automated to improve the efficiency of modeling;on the other hand,this tool is not for modeling software requirements,but directly to the modeling of code implementation,and automatically derives the model files that conform to the format of CPN Tools,and can further use CPN model checking techniques to discover the errors of the model.Thus,the algorithm error in the code can be found directly.This article has completed the following works:(1)Reading the program to be detected: read,analyze and store the single function Java program.The declarative statement is stored in a linked list,and other statements are stored in two binary trees.The nesting relation of subsequent sentences is distinguished by the left and right sub-trees of the nodes in the tree.(2)Transformation of the program to be tested: make an analysis of the definition of variables,process control and operation,and complete the transformation from program to CPN model.In which,the variables defined in the program are converted into token flow in the model,which are completed by the color set and the variable group;all the processing statements in the program are converted into CPN model,which are completed by the model elements,including the position,transition,arc,guard expression,arc expression and so on.(3)Generating model files: generate and export model files according to CPN Tools model file format.The exported model files can be opened directly by standard CPN Tools,which is used for error detection based on model checking algorithm.Finally,through the example application and the execution effect analysis,it shows that the single function Java program to the CPN model transformation tool realized in this thesis can automatically complete the modeling work for the program,and can improve the modeling efficiency.It is helpful for the next step to check the error of the algorithm through the model checking technology,and can improve the software quality to a certain extent.
Keywords/Search Tags:Colored Petri Net, single function java program, model file, CPN Tools
PDF Full Text Request
Related items