Introduce formal methods in software engineering

文章介绍了正式方法在软件开发中的关键作用,包括使用数学来规范和验证系统。正式方法分为形式化规范和形式化验证两部分,例如B方法、Z符号和事件-B。这些技术有助于提高系统可靠性,减少测试成本,但需要专业的数学和软件工程知识,并可能增加项目成本。
摘要由CSDN通过智能技术生成

Introduce formal methods in software engineering

1. Introduction

在这里插入图片描述

Formal methods are mathematically-based techniques for specifying, developing, and verifying systems, both hardware and software. They involve using mathematical expressions to model the abstract representation of a system, allowing for the specification and verification of system properties. The use of formal methods has become increasingly important in software engineering due to the need for reliable and efficient software products.

Formal methods consist of two main parts: formal specification and formal verification. Formal specification is the process of using mathematics to specify the desired properties of a computer system. Formal verification is the process of using mathematics to prove that a computer system satisfies its specification. Automated theorem proving can be used to evaluate the validity of a formal specification, which helps identify potential flaws in the design process.


2. Examples

在这里插入图片描述

One example of a formal method technique is the B method, which covers the entire software development life cycle. The B method divides software into separated components that are further represented as Abstract Machines. The method represents system models in the form of mathematical expressions as an Abstract Notation Machine (AMN). These are further subject to stepwise refinement and proof obligation evaluation, consisting of verification of invariant preservation and refinement correctness. This method is widely used in scientific publications concerning formal method implementation, and it is used in the specification for transport automation systems in Paris and Sao Paulo by Siemens Transportation Systems.

在这里插入图片描述

Another example of a formal method technique is Z notation, which is a model-based, abstract formal specification technique. Z defines system models in the form of states where each state consists of variables, values, and operations that change from one state to another. Z formalizes a specification of the system at the design level and is most compatible with object-oriented programming.

在这里插入图片描述

Event-B is an advanced implementation of the B method. Using this approach, formal software specification is the process of creating a discrete model that represents a specific state of the system. The state is an abstract representation of constants, variables, and transitions (events). Part of an event is the guard that determines the condition for the transition to another state to take place. Constructed models (blueprints) are a further subject of refinement, proof obligation, and decomposition for the correctness of verification.


3. Summary

Before deciding on the use of formal methods, each architect must list the pros and cons against resources available, as well as the system’s needs. Formal methods offer several benefits, including improving system reliability at the design level and decreasing the cost of testing. They also improve system cohesion, reliability, and safety-critical components by detecting faults early in the development cycle. However, formal methods require qualified professionals competent in either mathematics or software engineering, and design proof-validation may introduce additional effort and cost to the overall project estimation.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值