Luận văn thạc sĩ về phương pháp mô hình hóa và kiểm chứng các hệ thống hướng sự kiện

Luận văn thạc sĩ nghiên cứu methods for modeling and verifying event driven systems phương pháp mô hình hóa và kiểm chứng các, khảo sát thực trạng, phân tích nguyên nhân, đề xuất

Trường đại học

Hanoi University of Mining and Geology

Chuyên ngành

Software Engineering

Người đăng

Ẩn danh

Thể loại

thesis

2023

155
2
0

Phí lưu trữ

45 Point

Mục lục chi tiết

Declaration of Authorship

Abstract

Acknowledgements

Contents

List of Abbreviations

List of Tables

List of Figures

1. Introduction

1.1. Classical set theory

1.2. Fuzzy sets and Fuzzy If-Then rules

1.3. Event-B mathematical language

1.4. Event-driven systems

1.4.1. Event-driven architecture

1.4.2. Database systems and database triggers

1.4.3. Context-aware systems

3. Modeling and verifying database trigger systems

3.1. Modeling database systems

3.3. Modeling and verifying database triggers system

3.4. Verifying system properties

3.5. A case study: Human resources management application

3.6. Support tool: Trigger2B

4. Modeling and verifying context-aware systems

4.1. Set representation of context awareness

4.2. Modeling context-aware system

4.3. Incremental modeling using refinement

4.4. A case study: Adaptive Cruise Control system

4.4.1. Modeling ACC system

4.4.2. Refinement: Adding weather and road sensors

4.4.3. Verifying the system’s properties

5. Modeling and verifying imprecise system requirements

5.1. Representation of fuzzy terms in classical sets

5.2. Modeling discrete states

5.3. Modeling fuzzy requirements

5.4. Modeling continuous behavior

5.5. Verifying safety and eventuality properties

5.5.1. Convergence in Event-B

5.5.2. Safety and eventuality analysis in Event-B

5.5.3. Verifying safety properties

5.5.4. Verifying eventuality properties

5.6. A case study: Container Crane Control

5.6.1. Modeling the Crane Container Control system

5.6.2. Modeling discrete behavior

5.6.3. First Refinement: Modeling continuous behavior

5.6.4. Second Refinement: Modeling eventuality property

List of Publications

Bibliography

A Event-B specification of Trigger example

A.1. Context specification of Trigger example

A.2. Machine specification of Trigger example

B Event-B specification of the ACC system

B.1. Context specification of ACC system

B.2. Machine specification of ACC system

C Event-B specifications and proof obligations of Crane Controller Example

C.1. Context specification of Crane Controller system

C.3. Machine specification of Crane Controller system

C.5. Proof obligations for checking the safety property

C.6. Proof obligations for checking convergence properties

Tóm tắt

I. Phương pháp mô hình hóa

Phương pháp mô hình hóa là một phần quan trọng trong kỹ thuật phần mềm, giúp cải thiện độ tin cậy của hệ thống. Trong bối cảnh hệ thống hướng sự kiện, việc mô hình hóa trở nên cần thiết để hiểu rõ hơn về cách mà các sự kiện tương tác và ảnh hưởng đến hành vi của hệ thống. Các phương pháp mô hình hóa hiện có thường dựa trên các quy tắc như Event-Condition-Action (ECA) và Fuzzy If-Then. Những quy tắc này cho phép xác định các hành động cần thực hiện khi một sự kiện xảy ra và điều kiện nhất định được thỏa mãn. Việc áp dụng các quy tắc này trong hệ thống hướng sự kiện giúp tăng cường khả năng tương tác và giảm thiểu sự phụ thuộc giữa các thành phần trong hệ thống. Theo nghiên cứu, việc mô hình hóa không chỉ giúp hình dung nội dung mà còn cung cấp thông tin văn bản, từ đó hỗ trợ trong việc thiết kế và đánh giá yêu cầu của hệ thống.

1.1. Mô hình hóa hệ thống hướng sự kiện

Hệ thống hướng sự kiện thường bao gồm ba phần chính: thành phần giám sát, thành phần truyền tải và thành phần phản hồi. Các thành phần này hoạt động bằng cách phát sinh và phản hồi các sự kiện, từ đó tạo ra một cấu trúc lỏng lẻo giữa các thành phần phần mềm. Việc mô hình hóa các hệ thống này giúp xác định rõ ràng cách mà các sự kiện được xử lý và các hành động tương ứng được thực hiện. Các nghiên cứu đã chỉ ra rằng việc áp dụng các phương pháp mô hình hóa như Event-B có thể giúp phát hiện các lỗi trong thiết kế và đảm bảo rằng các yêu cầu của hệ thống được đáp ứng một cách chính xác.

II. Kiểm chứng hệ thống hướng sự kiện

Kiểm chứng là một bước quan trọng trong quy trình phát triển phần mềm, đặc biệt là đối với các hệ thống hướng sự kiện. Việc kiểm chứng hệ thống giúp xác định và khắc phục các lỗi trước khi hệ thống được triển khai. Các phương pháp kiểm chứng như kiểm tra mô hình và chứng minh định lý đã được áp dụng để đảm bảo rằng các yêu cầu của hệ thống được thực hiện đúng cách. Sử dụng Event-B, các nhà nghiên cứu có thể phát triển các phương pháp kiểm chứng hiệu quả cho các hệ thống phức tạp, giúp giảm thiểu chi phí phát triển và tăng cường độ tin cậy của hệ thống. Việc kiểm chứng không chỉ giúp phát hiện lỗi mà còn đảm bảo rằng các thuộc tính an toàn và tính khả thi của hệ thống được duy trì.

2.1. Phương pháp kiểm chứng

Phương pháp kiểm chứng trong bối cảnh hệ thống hướng sự kiện thường bao gồm việc sử dụng các công cụ hỗ trợ như Rodin để tự động hóa quá trình kiểm chứng. Các công cụ này cho phép kiểm tra các thuộc tính của hệ thống một cách tự động, từ đó giảm thiểu khối lượng công việc cho các nhà phát triển. Việc áp dụng các phương pháp kiểm chứng này không chỉ giúp phát hiện các lỗi mà còn đảm bảo rằng các yêu cầu của hệ thống được thực hiện một cách chính xác và hiệu quả.

III. Ứng dụng thực tiễn

Các phương pháp mô hình hóakiểm chứng hệ thống hướng sự kiện có nhiều ứng dụng thực tiễn trong các lĩnh vực như quản lý cơ sở dữ liệu và hệ thống nhận thức ngữ cảnh. Việc áp dụng các quy tắc ECA trong các hệ thống này giúp cải thiện khả năng phản hồi và tương tác của hệ thống với môi trường xung quanh. Các nghiên cứu đã chỉ ra rằng việc mô hình hóakiểm chứng có thể giúp phát hiện và khắc phục các lỗi trong thiết kế, từ đó nâng cao độ tin cậy của hệ thống. Hơn nữa, việc sử dụng các phương pháp này trong các ứng dụng thực tiễn không chỉ giúp giảm thiểu chi phí phát triển mà còn đảm bảo rằng các yêu cầu của hệ thống được đáp ứng một cách chính xác.

3.1. Ứng dụng trong quản lý cơ sở dữ liệu

Trong lĩnh vực quản lý cơ sở dữ liệu, việc áp dụng các phương pháp mô hình hóakiểm chứng giúp đảm bảo rằng các quy tắc và ràng buộc dữ liệu được thực hiện một cách chính xác. Các hệ thống cơ sở dữ liệu sử dụng các quy tắc ECA để tự động hóa các hành động khi có sự kiện xảy ra, từ đó cải thiện hiệu suất và độ tin cậy của hệ thống. Việc kiểm chứng các thuộc tính của hệ thống cơ sở dữ liệu cũng giúp phát hiện các lỗi tiềm ẩn và đảm bảo rằng các yêu cầu của người dùng được đáp ứng.

25/01/2025

Trích đoạn nội dung tài liệu

Declaration of Authorship I declare that this thesis titled, ‘Methods for modeling and verifying event-driven systems’ and the work presented in it are my own. I confirm that:  I have acknowledged all main sources of help. Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work.

 Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself.  This work was done wholly while in studying for a PhD degree Signed: Date: i z Abstract Modeling and verification plays an important role in software engineering because it improves the reliability of software systems. Software development technologies introduce a variety of methods or architectural styles. Each system based on a different architecture is often pro- posed with different suitable approaches to verify its correctness.

Among these architectures, the field of event-driven architecture is broad in both academia and industry resulting the amount of work on modeling and verification of event-driven systems. The goals of this thesis are to propose effective methods for modeling and verification of event-driven systems that react to emitted events using Event-Condition-Action (ECA) rules and Fuzzy If-Then rules. This thesis considers the particular characteristics and the special issues attaching with specific types such as database and context-aware systems, then uses Event-B and its supporting tools to analyze these systems. First, we introduce a new method to formalize a database system including triggers by propos- ing a set of rules for translating database elements to Event-B constructs.

After the modeling, we can formally check the data constraint preservation property and detect the infinite loops of the system. Second, the thesis proposes a method which employs Event-B refinement for incrementally modeling and verifying context-aware systems which also use ECA rules to adapt the context situation changes. Context constraints preservation are proved automatically with the Rodin tool. Third, the thesis works further on modeling event-driven systems whose behavior is specified by Fuzzy If-Then rules.

We present a refinement-based approach to modeling both discrete and timed systems described with imprecise requirements. Finally, we make use of Event-B refinement and existing reasoning methods to verify both safety and eventuality properties of imprecise systems requirements. z Acknowledgements First of all, I would like to express my sincere gratitude to my first supervisor Assoc. Truong Ninh Thuan and my second supervisor Assoc.

Pham Bao Son for their support and guidance. They not only teach me how to conduct research work but also show me how to find passion on science. Besides my supervisors, I also would like to thank Assoc. Nguyen Viet Ha and lecturers at Software Engineering department for their valuable comments about my research work in each seminar.

I would like to thank Professor Shin Nakajima for his support and guidance during my intern- ship research at National Institute of Informatics, Japan. My sincere thanks also goes to Hanoi University of Mining and Geology and my colleges there for their support during my PhD study. Last but not least, I would like to thank my family: my parents, my wife, my children for their unconditional support in every aspect. I would not complete the thesis without their encouragement.

iii z Contents Declaration of Authorship i Abstract ii Acknowledgements iii Table of Contents iv List of Abbreviations viii List of Tables ix List of Figures x 1 Introduction 1 1.2 Classical set theory .3 Fuzzy sets and Fuzzy If-Then rules .2 Fuzzy If-Then rules .4 Event-B mathematical language .7 Event-driven systems .1 Event-driven architecture .2 Database systems and database triggers .3 Context-aware systems. 42 3 Modeling and verifying database trigger systems 44 3.3 Modeling and verifying database triggers system .1 Modeling database systems .3 Verifying system properties .4 A case study: Human resources management application .5 Support tool: Trigger2B. 62 4 Modeling and verifying context-aware systems 64 4.3 Formalizing context awareness .1 Set representation of context awareness .2 Modeling context-aware system .3 Incremental modeling using refinement .4 A case study: Adaptive Cruise Control system .2 Modeling ACC system .3 Refinement: Adding weather and road sensors .4 Verifying the system’s properties. 78 5 Modeling and verifying imprecise system requirements 81 5.3 Modeling fuzzy requirements .1 Representation of fuzzy terms in classical sets .2 Modeling discrete states .3 Modeling continuous behavior .4 Verifying safety and eventuality properties .1 Convergence in Event-B .2 Safety and eventuality analysis in Event-B .3 Verifying safety properties .4 Verifying eventuality properties .5 A case study: Container Crane Control .2 Modeling the Crane Container Control system .1 Modeling discrete behavior .2 First Refinement: Modeling continuous behavior .3 Second Refinement: Modeling eventuality property.

114 List of Publications 116 Bibliography 117 A Event-B specification of Trigger example 128 A.1 Context specification of Trigger example .2 Machine specification of Trigger example. 129 B Event-B specification of the ACC system 132 B.1 Context specification of ACC system .2 Machine specification of ACC system. 134 C Event-B specifications and proof obligations of Crane Controller Ex- ample 136 C.1 Context specification of Crane Controller system .3 Machine specification of Crane Controller system .5 Proof obligations for checking the safety property .6 Proof obligations for checking convergence properties. 144 z List of Abbreviations DDL Data Dafinition Language DML Data Manipulation Language PO Proof Obligation LTL Linear Temporal Logic SCR Software Cost Reduction ECA Event Condition Action VDM Vienna Development Method VDM-SL Vienna Development Method - Specification Language FM Formal Method PTL Propositional Temporal Logic CTL Computational Temporal Logic SCR Software Cost Reduction AMN Abstract Machine Notation viii z List of Tables 2.1 Truth tables for propositional operators .2 Meaning of temporal operators .3 Truth table of implication operator .4 Comparison of B, Z and VDM [1] .5 Relations and functions in Event-B .6 INV proof obligation .7 VAR PO with numeric variant .8 VAR PO with finite set variant .1 Translation rules between database and Event-B .3 Encoding trigger actions .4 Table EMPLOYEES and BONUS .5 INV PO of event trigger 1.6 Infinite loop proof obligation of event trigger 1 .1 Modeling a context rule by an Event-B Event .2 Transformation between context-aware systems and Event-B .3 Proof of context constraint preservation .1 INV PO of event evt4 .2 Deadlock free PO of machine Crane M 1 .3 VAR PO of event evt4 .1 INV PO of event evt1 .2 INV PO of event evt2 .3 INV PO of event evt3 .4 INV PO of event evt5 .5 VAR PO of event evt1 .6 NAT PO of event evt1 .7 VAR PO of event evt2 .8 NAT PO of event evt2 .9 VAR PO of event evt3 .10 NAT PO of event evt3 .11 VAR PO of event evt5 .12 NAT PO of event evt5.

145 ix z List of Figures 1.1 Types of event-driven systems .1 Basic structure of an Event B model .2 An Event-B context example .3 Forms of Event-B Events .5 Event refinement in Event-B .7 The Rodin tool .8 A layered conceptual framework for context-aware systems [2] .1 Partial Event-B specification for a database system .2 A part of Event-B Context .3 A part of Event-B machine .5 Architecture of Trigger2B tool .6 A partial parsed tree syntax of a general trigger .7 The modeling result of the scenario generated by Trigger2B .1 A simple context-aware system .2 Incremental modeling using refinement .3 Abstract Event-B model for ACC system .4 Events with strengthened guards .5 Refined Event-B model for ACC system .6 Checking properties in Rodin .1 A part of Event-B specification for discrete transitions modeling .2 A part of Event-B specification for continuous transitions modeling .3 A part of Event-B specification for eventuality property modeling .4 Container Crane Control system .5 Safety properties are ensured in the Rodin tool automatically .1 Motivation Nowadays, software systems become more complex and can be used to integrate with other systems. Software engineers need to understand as much as possible what they are developing. Modeling is one of effective ways to handle the complexity of software development that allows to design and assess the system requirements. Modeling not only represents the content visually but also provides textual content.

There are sev- eral types of modeling language including graphical, textual, algebraic languages. In software systems, errors may cause many damages for not only eco- nomics but also human beings, especially those applications in embed- ded systems, transportation control and health service equipment, etc. The error usually occurs when the system execution cannot satisfy the characteristics and constraints of the software system specification. The specification is the description of the required functionality and behavior of the software.

Therefore, ensuring the correctness of software systems 1 z Chapter 1. Introduction 2 has always been a challenge of software development process and relia- bility plays an important role deciding the success of a software project. Testing techniques are used in normal development in order to check whether the software execution satisfies users requirements. However, testing is an incomplete validation because it can only identifies errors but can not ensure that the software execution is correct in all cases.

Software verification is one of powerful methods to find or mathemati- cally prove the absent of software errors. Several techniques and methods have been proposed for software verification such as model-checking [3], theorem-proving [4] and program analysis [5]. Among these techniques, theorem proving has distinct advantages such as superior size of the sys- tem and its ability to reason inductively. Though, theorem proving often generates a lot of proofs which are complex to understand.

Verification techniques mainly can be classified into two kinds: model-level and im- plementation level. Early verification of model specifications helps to reduce the cost of software construction. For this reason, modeling and verification of software systems are an emerging research topic in around the world. Many approaches and techniques of modeling and verification have been proposed so far.

Each of them usually focuses on a typical kind of software architecture or design styles. In a traditional system, one component provides a collection of proce- dures and functions via its interfaces. Components then interact with each other by explicitly invoking those routines. Event-driven architec- ture is one of the most popular architectures in software project develop- ment providing implicit invocation instead of invoking routines directly.

Each component of an event-driven system can produce events, the sys- tem then invoke all procedures which are registered with these events. Introduction 3 event-driven system consists of three essential parts: monitoring compo- nent, transmission component and responsive one. Since such systems work by raising and responding to events, it looses coupling between software components and improves the interactive capabilities with its environment. The event-driven architectural style is becoming an essen- tial part of large-scale distributed systems design and many applications.

It is a promising architecture to develop and model loosely coupled sys- tems and its advantages have been recognized in both academia and industry. There are many types of event-driven systems including many editors where user interface events signify editing commands, rule-based pro- duction systems where a condition becoming true causes an action to be triggered and active objects where changing a value of an object’s attribute triggers some actions (e. database trigger systems) [6].1 shows the hierarchy of listed event-driven systems. In this thesis, we consider two applications of active objects and rule-based production systems: database systems with triggers and context-aware systems.

Event−driven systems Graphic user interfaces Rule−based production systems Active objects. Context−aware systems Database trigger systems Figure 1.1: Types of event-driven systems In event-driven systems, Event-Condition-Action (ECA) rules are pro- posed as a declarative approach to specify relations when certain events occur at predefined conditions. An ECA rule has the form: On Event z Chapter 1. Introduction 4 IF conditions DO actions that means when Events occurs, if conditions holds, then actions is performed.

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ

Bài viết "Luận văn thạc sĩ về phương pháp mô hình hóa và kiểm chứng các hệ thống hướng sự kiện" trình bày các phương pháp hiện đại trong việc mô hình hóa và kiểm chứng các hệ thống hướng sự kiện, một lĩnh vực quan trọng trong kỹ thuật phần mềm. Luận văn này không chỉ cung cấp cái nhìn sâu sắc về các kỹ thuật mô hình hóa mà còn nhấn mạnh tầm quan trọng của việc kiểm chứng để đảm bảo tính chính xác và hiệu quả của các hệ thống. Độc giả sẽ tìm thấy nhiều thông tin hữu ích về cách áp dụng các phương pháp này trong thực tiễn, từ đó nâng cao khả năng phát triển và quản lý hệ thống phần mềm.

Nếu bạn quan tâm đến các chủ đề liên quan, hãy khám phá thêm về Ứng Dụng Active Learning trong Lựa Chọn Dữ Liệu Gán Nhãn cho Bài Toán Nhận Diện Giọng Nói, nơi bạn có thể tìm hiểu về việc áp dụng các phương pháp học máy trong lĩnh vực nhận diện giọng nói. Bên cạnh đó, bài viết Các Kỹ Thuật Kiểm Thử Dòng Dữ Liệu Tĩnh Trong Luận Văn Thạc Sĩ Kỹ Thuật Phần Mềm sẽ giúp bạn hiểu rõ hơn về các kỹ thuật kiểm thử, một phần không thể thiếu trong quy trình phát triển phần mềm. Cuối cùng, bạn cũng có thể tham khảo Nghiên cứu ứng dụng mô hình ngôn ngữ lớn trong gỡ lỗi phần mềm để thấy được sự kết hợp giữa mô hình ngôn ngữ và phát triển phần mềm, mở rộng thêm kiến thức của bạn trong lĩnh vực này.