Research on AOP-Based Design by Contract and the Language and Tool to Support It

Author
XuZuoYing
Advisor
YangZongYuan
School
East China Normal University
Major
Computer Software and Theory
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2008
Downloads
61
Citations
0

Request the full text

Abstract

Program correctness is not only a core issue in software development, but also the foundation of software quality. In order to solve this problem, many solutions have been proposed. Formalization method is one of them. It relies on strict mathematical theory to guide programming, thus ensures the validity of software. However, formalization method is based on profound mathematical theory which seems to be a challenge for most developers. Hence, it is not widely accepted in the practical applications. Design by Contract, or DBC in short, is a methodology of development which holds the advantage of formalization method and is easy to be put into practice as well. It can be used to describe semantic of program modules precisely by introducing such concept as invariants、preconditions and postconditions. DBC provides convenient ways to define and check constraints, which does enable developers to take advantage of formalization method in their practical work. Actually, in the field of object-oriented development, DBC has become a popular method in improving software reliability. However, DBC also has its disadvantages. For example, it brings extra burden to coding; results in code tangling of different concerns etc. Due to these disadvantages, many popular object-oriented programming languages don’t support DBC mechanism.Aspect-oriented programming is a new programming technology and has gradually become a hotspot. It emphasizes on separation of concerns as well as encapsulation of crosscutting concerns and is considered to be the best solution to solve a variety of sophisticated problems in object-oriented systems. There exists natural mapping relationship between the language construction of AOP and DBC, which can exactly complement the disadvantages of DBC development. Making use of AOP technology to support DBC in object-oriented systems is believed to be a new way to enhance the reliability of software systems.Currently two methods exist in applying AOP to DBC development. One is using the detailed AOP implementation language (such as AspectJ) to support the DBC of OOP language. In such circumstances, the codes related to contracts can be totally separated from the business logic codes, so that a large amount of contract-checking code can be saved. But this kind of method relies heavily on the language implementation details, thus it requires programmers to have a good understanding of the complex syntax of AOP language, which appears to be a challenge and an extraburden to developers. What’s more, this kind of method can only be used in the implementation phase while it has no ability in accurately describing contracts at design time. The second method is making use of the relatively mature specification languages such as OCL to describe constraints, and then translate them into AOP implementation languages according to certain mapping rules. This kind of method can be used to describe various pre/post conditions and invariants precisely at design time. However, as most of the specification languages hold formal languages as their foundation, the expressions are usually too verbose to understand. Besides, the big difference of abstract degree between specification languages and implementation languages leads to difficulty in implementing the translation.In this paper, after the detailed research in AOP and DBC respectively, the relationship between them is found out, and a new solution to improve the AOP-based DBC development is proposed. This solution integrates the whole development process of the AOP-based DBC development. At the same time, it fills in the gap between high level design and low level implementation.This paper firstly gives the mapping relationship between AOP and DBC. After that, an AOP-based contract description language (ACDL) is presented. The language can be used to describe contracts at design phase without relying on any details of AO languages. On the other hand, as its expressing style is close to AO, it can be translated into such AOP implementation languages as AspectJ easily. At the same time, this paper also expounds the associations among ACDL、high level design and low level implementation, analyzing the translation feasibility between them, and discusses the usage and meaning of ACDL in the practical software development. Lastly, the tool call AJMaker support for ACDL is presented, with which users can simply only give the information about pre/post conditions and invariants, leaving the complicated code-generation work to AJMaker, and also the tool can help to parse the ACDL code to AspectJ code.

Table of contents

Summary 6-8 Abstract 8-13 Chapter Introduction 13-19 1.1 Background 13-16 < br /> 1.1.1 contractual development the 13-14 1.1.2 aspect-oriented programming 14-15 1.1.3 in the development of contractual application of AOP technology 15-16 1.1.4 issues summarize nbsp are; 16 1.2 solution 16-17 1.2.1 the AOP-DBC correspondence between 16-17 1.2.2 ACDL language 1.2.3 AJMaker tool 17 17 1.3 The main contributions 17-18 <br / 1.4 of this article organizational structure 18-19 second aspect-oriented programming 19-34 2.1 AOP background 19-21 2.2 Overview of aspect-oriented programming the the 21-24 2.2.1 AOP core ideological 21-22 2.2.2 What are Aspect 22 2.2 .3 AOP features 22-23 2.2.4 AOP software development process 23-24 2.2.5 the AOP traditional applications 24 <br / > 2.3 aspect-oriented programming implementation techniques 24-30 2.3.1 AOP language specification 24-25 2.3.2 AOP language implementation nbsp in; 25 - 26 2.3.3 AOP weaving process 26-27 2.3.4 AspectJ-Java AOP implementations 27-30 2.4 aspect-oriented programming research 30-33 2.4.1 aspect-oriented software engineering 30-32 2.4.2 aspect-oriented program analysis, to measure and test 32-33 2.5 Summary 33-34 Chapter AOP in the development of contractual 34-47 3.1 contractual development 34-40 3.1.1 Observer mode support contract 36-39 3.1.2 contractual development and unit testing 39 3.1.3 the DBC and OCL 39-40 3.2 AOP enhance the development of contractual 40-43 3.2.1 Modular contract 40-41 3.2.2 corresponding relationship 41 3.2.3 use AspectJ support contract 41-43 3.3 related research at home and abroad 43-45 3.3.1 DOT 43-44 3.3.2 OCLE 44-45 3.3.3 Other 45 3.4 Summary 45-47 <br / > Chapter ACDL language 47-70 4.1 design purpose 47-48 4.1.1 describe independent constraints 47 4.1.2 No side effects 47 4.1.3 detailed contextual information 47 4.1.4 can convert 47-48 4.1.5 flexibility 48 4.1.6 target user 48 4.2 ACDL language features 48-49 4.3 language description are found; 49-63 4.3.1 contract 49-50 4.3.2 checkpoint 50 4.3.3 condition 50-53 4.3.3.1 before 50-51 4.3.3.2 after 51-52 4.3.3.3 beforeAndAfter 52-53 4.3.4 some discussion on the invariant check the abstraction mechanism nbsp in 4.3.5 ACDL, 53-54; 54-55 4.3.6 language framework 55-56 4.3.7 collection operation 56-63 4.3.7.1 collection of public 57 4.3.7.2 Set collection operator 57-58 4.3.7.3 Bag collection operator 58-59 4.3.7.4 Sequence collection operator the collection 59-60 4.3.7.5 Operation instance 60-63 4.4 ACDL grammar rules 63-65 4.5 target language the 65-66 4.6 using the the ACDL integrated DBC software development process 66-69 4.6 .1 ACDL and upper design 66-68 4.6.1.1 VDM 67 4.6.1.2 VDM-the ACDL conversion of the feasibility analysis 67-68 4.6.1.3 Summary 68 4.6.2 ACDL and lower implementation 68-69 4.7 Summary 69-70 Chapter AJMaker tool for the realization of the framework the 70-86 5.1 AJMaker framework, 70-71 5.2 code generation modules 71-77 5.2.1 contract 71-72 5.2.2 code generation mechanism described the 72-73 5.2.3 user interface 73-77 5.2.3.1 Class Add the invariant constraint the 73-74 5.2.3.2 for methods to add pre / postcondition constraints 74-76 5.2.3.3 code generation 76-77 5.3 conversion parsing module the 77-84 5.3.1 simple mapping the 77-79 5.3.2 set operations mapped 79-84 5.3.3 @ pre processing 84 5.4 contract exception handling 84-85 5.5 Summary 85-86 Chapter Summary and Outlook the 86-88 6.1 some discussion about ACDL language and summarize the 86-87 6.2 Looking to the future work 87 -88 Chapter VII References 88-92 Acknowledgements 92-93 Appendix pursue a degree during the academic catalog 93

Related dissertations

  1. Research of Aspect-Oriented Refactoring Technique
    HouXiaoYu ·Harbin Engineering University ·2012 ·Master's thesis
  2. Design and Implementation of Testing Aspects Interaction Tool for Aspect-Oriented Programs
    ZhuangXuJie ·Shanghai Jiaotong University ·2007 ·Master's thesis
  3. Dynamic Coupling Measurement for Aspect-Oriented Software
    YangZuo ·Shanghai Jiaotong University ·2008 ·Master's thesis
  4. Study and Implementation of Pipa and Its Runtime Assertion Checking Compiler
    WangDai ·Shanghai Jiaotong University ·2008 ·Master's thesis
  5. Research and Application of Design Pattern Based on AOP
    DengHao ·Wuhan University of Technology ·2007 ·Master's thesis
  6. A Web Application Security Enhancement Method Design and Implemention
  7. Concern Space Model Based Separation of Concern: A Theory and Applications
    ZengYu ·East China Normal University ·2007 ·Master's thesis
  8. Static Construction of Control Flow Graph for Aspect-Oriented Programs
    FengBin ·Shanghai Jiaotong University ·2007 ·Master's thesis
  9. Aspect-oriented software development method and its application in distributed systems Application Development
    JiaYangLi ·Wuhan University of Technology ·2006 ·Master's thesis
  10. JAAS security aspect-oriented design and implementation
  11. The Design and Realization of Java Program Slicing System Using AspectJ
  12. Research on Software Refactoring in AspectJ Programs
    LiRui ·Jilin University ·2005 ·Master's thesis
  13. Aspect-oriented software technology based security framework for research
    XiongJunFeng ·Chongqing University ·2004 ·Master's thesis
  14. Research on Aspect Conflict of Aspect-Oriented Software Development
  15. Research and Implementation of Web Security Architecture Based on Acegi
  16. Design and Implementation of AspectJ Source Weaver for Incremental AOSD
    LiuZuoXia ·Jinan University ·2010 ·Master's thesis
  17. The Description and Tool Implementation of Time Features Based on AOP
  18. Research on Monitoring Software Properties Based on AOP
  19. Research on Unit Testing Technique of Aspect-Oriented Programs
  20. The Design and Implementation of Avionic Software System Based on AOP
    ChenShaoYu ·Shanghai Jiaotong University ·2008 ·Master's thesis