Research on Verification and Implementation Method for OCL Constraints

Author
LuoQingSheng
Advisor
LiShengHong
School
Jiangxi University of Finance
Major
Applied Computer Technology
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2006
Downloads
162
Citations
2

Request the full text

Abstract

The Unified Modeling Language (UML) is a common visual modeling language for specifying, visualizing, documenting the artifacts of the software systems. As a part of the UML standard, the Object Constraint Language (OCL) is applied to state the model’s constraints and their interrelation unambiguously. OCL is a declarative language, and also is a formal language.Three common OCL constraints added to model are precondition, postcondition, and invariant. Precondition describes the acceptable values of the input parameter and model’s state when the operation is invoked. Postcondition has to be true after operation’s execution, and it is used to check operation’s resultant values and model’s states when the operation has been fulfilled. Invariant is the rules which always hold true in the attribute’s life period. Constraint verification is demanded in order to assure the constraint’s validity in the running program. Detecting constraints violation during runtime can prove to be useful to software system’s development, especially to large software system and embedded real-time system’s development.The target is to declare necessary constraints for model, and to obtain the codes that can detect constraint violation during runtime, thus, precondition code pattern, postcondition code pattern, invariant code pattern need to be designed respectively. The code patterns describe the way in which the executable Java codes equivalent of OCL statements (namely, OCL-Java codes) have to be inserted into the Java program. The code patterns can throw corresponding exception when having detected constraint violated during program’s runtime.The research constructed the system’s model applying UML tool, and declared some necessary constraints for the model based on the OCL theory, consequently, had acquired rigorous system model. In the Java program equivalent of the model, which was brought by applying UML tool’s automated code generation, OCL constraints only appear in the comments, the research accomplished the extracting of the constrains in the program. Because OCL is not a programming language, and OCL constraints cannot be executed directly, due to Java as a target language, OCL constraints must to be transformed into executable Java codes (namely, OCL-Java codes). Therefore, the research expounded the implementation of OCL constraint transforming into OCL-Java code. In order to detect the constraints violated during runtime, OCL-Java code need to be inserted into the Java program, sequentially constraint verification can be

Table of contents

Summary 7-8 Abstract 8-10 1 Introduction 10-14 1.1 Background and Significance 10-11 1.2 Related Research 11-12 1.3 content the organization 12-13 1.4 thesis 13-14 2. UML / OCL Overview 14-27 2.1 UML 14-17 IN the 2.1.1 the OMG yuan model system 15-16 2.1.2 UML tools 16-17 2.2 OCL 17-27 2.2.1 concept the 18-21 2.2.2 OCL application examples 21 -23 2.2.3 OCL tools 23-26 2.2.4 OCL tools 26-27 code insertion 27 -36 3.1 simple program 27-28 3.2 encapsulation method 28-30 3.3 improvement program 30-36 3.3.1 Pre-conditions 32-33 3.3.2 postcondition 33-34 3.3.3 invariant 34-36 <br / > 4. OCL-Java code generated the 36-45 the 4.1 resolve OCL expression the 36-40 4.2 semantic analysis 40-41 the 4.2.1 type checking 40-41 4.2.2 Other semantic errors 41 4.3 standardized 4.3.1 grammatical, 41-43, streamline 42-43 4.3.2 Type streamlined 43 4.4 code generation 43-45 five. the OCL-Java code insertion 45-53 5.1 JavaCC the document 45-50 5.1.1 jj 46-47 5.1.2 Java parser modify 47 - 50 5.2 code inserted to achieve 50-53 6 instance OCL constraints verify 53-60 6.1 instance model 53-55 6.2 OCL constraint validation 55-60 6.2.1 OCL constraints example the 55-56 6.2.2 Constraints verification 56-60 7 Summary and future work 60-63 7.1 summarizes the 60-61 7.2 Next work 61-63 References 63-67 Appendix the I 67-69 Appendix II 69-71 studying for a master's degree during the published papers are found; 71-72 Acknowledgements 72

Related dissertations

  1. Design and Implementation of Computer Forensics Based on JFAV
    WangWenBo ·Jilin University ·2012 ·Master's thesis
  2. Multibody systems before discrete null space algorithm
    LiuYing ·Fudan University ·2011 ·Doctoral dissertation
  3. MOF- based model executable Method and Implementation
    GengTongCheng ·Jilin University ·2008 ·Master's thesis
  4. Research on Model Transformation Method Based on OCL and the Application of Rule Repository in MDA
    DuHao ·Dalian Maritime University ·2007 ·Master's thesis
  5. The Research of Instantiation of Design Pattern Based on XML Description
    ChenXianMou ·Hunan University ·2005 ·Master's thesis
  6. The Research and Implementation of Database Application Framework Based on ECO-MDA
  7. Research on Monitoring Software Properties Based on AOP
  8. Research of Test Method Based on Uml State Diagram with OCL
    ChaiYanXin ·Chongqing University ·2010 ·Master's thesis