软件工程 实践者的研究方法 第28章答案

Problem:

If you had to pick one aspect of cleanroom software engineering that makes it radically different from conventional or object-oriented software engineering approaches, what would it be?

Answer:

592-29-1P SA Code: 4478

SR Code: 4578

The Clean room process is a theory-based, team-oriented process for the development and certification of high-reliability software systems under statistical quality control. Its principal objective is to develop software that exhibits zero failures in use. For this purpose the life cycle is different from conventional software development techniques.

The approach combines mathematical-based methods of software specification, design and correctness verification with statistical, usage-based testing to certify software fitness for use.

The clean room software engineering differs from the conventional software engineering because

1. It makes explicit use of statistical quality control,

2. It verifies design specifications using a mathematically based proof of correctness, and

3. it implements testing techniques that have a high likelihood of uncovering high impact errors.

Cleanroom engineering diverges from conventional software practices by deemphasizing the role of unit testing and debugging and dramatically reducing the amount of testing performed by the developer of the software.

In conventional software development, errors are accepted as a fact of life. Because errors are deemed top be inevitable, each program component should be unit tested and then debugged. When the software is finally released, field use uncovers still more defects and another test and debug cycle begins. The rework associated with these activities is costly and time consuming. It can be degenerative error correction can lead to the introduction of still more errors.

In clean room software engineering, unit testing and debugging are replaced by correctness verification and statistically based testing. These activities, coupled with the record keeping necessary for continuous improvement, make the cleanroom approach unique.

.

Problem:

How do an incremental process model and certification work together to produce high-quality software?

Answer:

592-29-2P SA Code: 4478

SR Code: 4578

The Cleanroom process embeds software development and testing within a statistical quality control framework. Mathematically-based software development processes are employed to create software that is correct by design and statistical usage testing processes are employed to provide inferences about software reliability. This systematic process of assessing and controlling software quality during development permits certification of software fitness for use at delivery.

The value of a process under statistical quality control is well illustrated by modern manufacturing processes where the sampling of output is directly feedback into the processes to control quality. Once the discipline of statistical quality control is in place, management has objective visibility into the software development process and can control process changes to control product quality.

The characteristics of the Cleanroom process are an incremental development life cycle and independent quality assessment through statistical testing. The development life cycle starts with a specification that not only defines function and performance requirements, but also identifies operational usage of the software and a nested sequence of user-function subsets that can be developed and tested as increments which accumulate into the final system. Disciplined software engineering methods provide design and verification techniques required to create correct software. Correctness verification by development teams is used to identify and eliminate defects prior to any execution of the

Software.

Software execution is controlled by an independent certification team that uses statistical testing methods to evaluate software quality. Statistical testing results in objective quality certification of software at delivery and provides a scientific basis for generalizing reliability estimates to operational environments.

Problem:

Using box structure specification, develop “first-pass” analysis and design models for the SafeHome system.

Answer: Problem:

A bubble-sort algorithm is defined in the following manner:

202767-28-4IP1.png

Partition the design into subfunctions, and define a set of conditions that would enable you to prove that this algorithm is correct.

Answer:

Partition of Bubble sort algorithm

Supposed algorithm design is divided into two subparts. They are

1. Procedure bubble sort

2. Procedure swap

procedure bubblesort :

var i, t, integer;

begin

repeat until t = a[1]

t := a[1];

for j = 2 to n do

if (a[j-1]>a[j]) then

begin

swap (&a[j-1], &a[j])

end

end rep

end

procedure swap(*a, *b ) :

var t;

begin

t = *a;

*a = *b;

*b = t

end

Set of conditions for bubble sort process:

In first step, the list is separated into two subparts:

1. Sorted

2. Unsorted.

The smallest element in the list is bubbled from the unsorted list and moved to the sorted subsist. And moves one element ahead; increasing the number of sorted elements and decreasing the number of unsorted ones.

At each time, an element moves from unsorted part to the sorted part, until one sort pass is completed. In a list of n elements, bubble sort requires up to (n-1) passes to sort the data.

Problem:

Document a correctness verification proof for the bubble sort discussed in Problem 28.4.

Answer:

592-29-6P SA Code: 4478

SR Code: 4578

Correctness proof for the bubble sort by program verification:

592-29-6p-i1.png

1) Initially the entry conditions are correct and the loop repeats until 592-29-6p-i2.png and then the variable initialized to L and loop repeats until 10.

2) If checks the condition 592-29-6p-i3.pngis greater then a 592-29-6p-i4.png then the situations followed by it exchange both values.

3) If the condition fails, then increments the loop variable by 1.

4) The exit condition determines whether 592-29-6p-i5.png if it fails then it exists the block.

Problem:

Select a program that you use regularly (e.g., an e-mail handler, a word processor, a spreadsheet program). Create a set of usage scenarios for the program. Define the probability of use for each scenario, and then develop a program stimuli and probability distribution table similar to the one shown in Section 28.4.1.

Answer:

592-29-8P SA Code: 4478

SR Code: 4578

Consider an e-mail handler, the e-mail contain the inbox, sent items, unread mails, delete items etc. These all are regularly usage scenarios for this program.cleanroom testing teams must determine a usage probability distribution for the e-mail handler. The specification for each increment of the e-mail handler is analyzed to define set of stimuli (inputs or events) that cause the handler to change its behavior.

Probability distribution table for E-mail handler are

Program stimulus probability interval

Inbox 60% 1-60

Sent items 30% 61-90

Delete mails 5% 91-95

Unread mails 3% 96-98

Junk E-mails 2% 99-100

Problem:

For the program stimuli and probability distribution table developed in Problem 28.6, use a random-number generator to develop a set of test cases for use in statistical use testing.

Answer:

Test cases are generated for each set of stimuli according to the usage probability.

To generate a sequence of usage test cases that conform to the usage probability distribution, random numbers between 1 and 99 are generated. Each random number corresponds to an interval on the preceding probability distribution

Random number sequences are generated

592-29-9p-i1.png

592-29-9p-i2.png

592-29-9p-i3.png

We cases are derived as

592-29-9p-i4.png

592-29-9p-i5.png

592-29-9p-i6.png

The testing team executes there use cases and verifies software behavior against the specification for the system.

Problem:

In your own words, describe the intent of certification in the cleanroom software engineering context.

Answer:

591-29-10P SA Code: 4478

SR Code: 4578

________________________________________________________________________

Certification (the Cleanroom term for testing) is performed to certify the software reliability, not test the software in the classical sense. The methods used are statistical quality control (SQC) and statistical usage testing.

Clean room certification and, specifically, statistical usage based testing, does not measure quality in defects per line of code. Instead, quality is measured in sigma units.

Cleanroom certification can reduce time to market because you are not spending time testing and fixing when you need not be. When you reach the quality level desired, you can ship, even if complete path coverage is not achieved. Cleanroom certification can tell you when testing is complete and the product can be released.

Problem:

You have been assigned to a team that is developing software for a fax modem. Your job is to develop the “phone book” portion of the application. The phone book function enables up to MaxNames people to be stored along with associated company names, fax numbers, and other related information. Using natural language, define

a. The data invariant.

b. The state.

c. The operations that are likely.

 

Answer:

4633-21-9P SA: 4475

SR: 6376

If we consider the application “phone book”, the phone book function enables up to maxnames of people to be stored along with associated company names, fax names, and other related information without any duplication.

In a phone book, the entries can be as shown.

4633-21-9p-i1.png

(a) The data invariant:

The data invariant is a condition that is true through out the execution of the system (phone book) that contains a collection of data.

The data invariant that holds for the phone book has the following components.

• There cannot be entries more than maxnames in the phone.

• There cannot be any duplicate entries in the phone book.

(b) The state:

A state is the stored data, which a system accesses and alters. It is a symbol table. In this phone book there are many states. A system can be in one of several states.

In a phone book there can be various states. They are

• Create contact

• Delete contact

• Create group,

• Speed dial

• Edit contact

(c) The operations those are likely:

An operation is an action that takes place within a system and reads or writes data.

If the phone book function is concerned with various actions like creating, editing, and deleting contacts, groups etc. So the operations that are likely are

• Create()

• Delete()

• Edit()

• Creategroup()

• Deletegroup()

Three types of operations that can be associated with operations are:

• Invariants

• Pre-condition.

• Post-condition.

An invariant defines what is guaranteed not to change. The phone book function has an invariant that states that the number of elements in the phone book is always less than or equal to the maxnames.

 

• A precondition defines the circumstances in which a particular operation is valid. The precondition for an operation that adds a name in the phone book is that, adding a new name/ number to the phone book is valid only if there do not exists a contact with the same name and also the number of contacts is less than maxnames.

• A post-condition operation states that what is guaranteed to be true upon completion of an operation. In the context of a phone book, if we consider a create() operation, the post condition would specify that the phone book is now added with a new contact.

Problem:

You have been assigned to a software team that is developing software called MemoryDoubler that provides greater apparent memory for a PC than physical memory. This is accomplished by identifying, collecting, and reassigning blocks of memory that have been assigned to an existing application but are not being used. The unused blocks are reassigned to applications that require additional memory. Making appropriate assumptions and using natural language, define

a. The data invariant.

b. The state.

c. The operations that are likely.

 

Answer:

4633-21-10P SA: 4475

SR: 6376

The software “MemoryDoubler” provides greater apparent memory for a PC than physical memory. It is accomplished by identifying, collecting, and reassigning blocks of memory.

(a)

The data invariant:

Data invariant is a condition that is true through out the execution of the system. In a memorydoubler system, the data invariants are

1. No memory block will be marked as both used and unused.

2. Set of memory blocks are in the queue and that will be subsets of the collection of currently used blocks.

3. Collection of used blocks and unused blocks should be maintained with no duplicates.

(b)

The state:

The state in a memorydoubler system is a collection of free memory blocks and collection of used memory block and returned blocks.

(c)

The operations those are likely:

An operation is an action within a system. And the operations associated with the memorydoubler system are

1. An operation that adds a collection of memory blocks to the older one.

2. An operation that removes a collection of used memory blocks from the front of the old memory and place them in the collection of unused block memory.

3. An operation that checks whether the additional memory block is empty.

In these operations, the first operation is a pre-condition. Blocks to be added must be in the collection of used memory block.

The post condition is the collection of blocks and must be added to end of another one.

The final operation checks whether another block of memory is empty or not. If another memory block is empty, then it delivers the post condition value as true.

 


Solution :Chapter28: FORMAL MODELING AND VERIFICATION

28.1. Proof of correctness applied as software is specified is probably the most significant departure from other approaches.

28.2. Each increment in the cleanroom process may be planned to produce one or more certified components. As the increments are completed, the software is integrated and because the components are certified, integration can occur with relatively little concern for error.

28.3. To some extent the black box specification is similar to a level 0 data flow diagram in that inputs and outputs are specified for the box. Therefore, the SafeHome black box would be similar to the level 0 DFD presented in Chapter 12. The state box is analogous to the state transition diagram. The clear box representation is analogous to procedural design and can be represented using a PDL.

28.4 and 28.5. A detailed solution to this problem and many other common algorithms can be found in [LIN79].

 

28.6. Answers will vary

 

28.7. Answers will vary

 

28.8. The intent of the certification process is to specify the reliability for each component, allowing them to be stored along with their usage scenarios, program stimuli, and probability distributions in a repository of potentially reusable software components. The software components are precisely specified and have been verified against their specifications.

28.9. Data invariant: the phone book will contain no more than maxnames names; there will be no duplicate names in the phone book. The state is the data that the software access, therefore, in this case, the state is the phone book itself. Operations are similar to the operations defined for objects in that they are capable of changing the state. Operations for this problem include: add, delete, edit, obtain.

28.10. The data invariant is the memory block list that contains the start and end address of the unused memory, along with appropriate assignment information; any given block can only be assigned to one program at a time. The state is the memory block table. Operations for this problem include: add, delete, assign, lookup.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于大中台来讲,现在并没有十分严格的定义,每个企业对其的理解都是不同的,有的在技术上使用大中台模式,有的在业务上使用大中台模式,有的将两者相结合。“大中台,小前台”的机制最初阿里提出的时候,主要应用于O2O线上线下协同、电商等场景,对于电商来说,市场环境是瞬息万变的,而前台是主要的一线业务,这时就需要一个强大的技术中台提供快速设计方法和系统性后端服务,去应对市场变化,灵活快速的做出应对策略。 技术中台从技术角度出发,数据中台从业务数据角度出发,业务中台站在企业全局角度出发,从整体战略、业务支撑、连接用户、业务创新等方面进行统筹规划,由基础中台、技术中台、数据中台L合支撑来建设业务中台。 本套中台案例基于真实工业界业务讲解,将多种经过工业界验证的成熟技术解决方案呈现给大家,本套课程拒绝枯燥的理论,全程代码实操,通过项目驱动的方式,让大家能够真实体验中台工业界开发过程,帮助大家建立中台思维,学习本套课程全部内容可以帮助提高自主开发一套高性能高可用高扩展的中台系统的能力。本套案例集后端+前台+测试+运维一体,多方位的带你熟悉全过程。本课程将带大家实现一个真实的工业界中台项目,该项目是基于真实的知名互联网企业项目讲解,本课程将分为4个阶段: 第一阶段:会实现中台系统的大部分核心服务,包括:会员中心,商品中心,交易中心,商家中心,支付中心,友凡商城等等。 第二阶段:进一步完善中台系统的核心服务以及优化,包括:营销中心,搜索中心,店铺中心,缓存优化,数据库优化等等。 第三阶段:进一步优化以及完善产品服务,包括:前台系统,中台系统,友凡商城 友凡生鲜,友凡超市等等。 第四阶段:项目收尾阶段以及运维阶段,包括:压力测试,系统维护,系统部署,虚拟化方案,测试方案等等。 本课程包含的技术: IDEA集成开发工具 SpringBoot 2.0.8.RELEASE SpringCloud Finchley.SR2 Thymeleaf(模板引擎技术) 支付宝支付MyCat、MySQL、Druid  持续集成解决方案(Jenkins) 认证解决方案(JWT) 网关解决方案(Zuul) 负载均衡解决方案(Ribbon) 分布式事务+多线程+事件驱动 MyBatis+Redis+Quartz Ehcache+Hystrix Nginx(Web服务器) Restful AOP技术 性能压力测试Jemter VUE+jQuery+Ajax+NodeJS VUE+Element-UI 容器部署Docker Kubertenes Lucene、ElasticSearch(搜索) 设计模式、RabbitMQ Swagger2 文档生成工具 人工智能(RNN、LSTM)多语言开发(Python、Django)课程亮点: 1.与企业无缝对接、工业界真实业务场景 2.集后端+前台+测试+运维一体,多面学习技术链 3.多语言协调开发,熟悉语言应用场景4.支持项目快速迭代和开发 5.引入人工智能智能客服系统6.使用微服务技术栈+前后端分离构建项目 7.引入全新的设计理念 8.全链路性能压力测试 9.分布式事务解决方案 10.事件驱动设计解决方案 11.多线程技术+设计模式的实战应用 12.分布式架构下实现分布式定时调度 13.集成MyBatis实现多数据源路由实战 14.集成SpringCloud实现统一整合方案 15 Kubernetes+Docker容器化部署和管理 16.大型系统分布式部署方案 17.高性能系统(支撑海量数据) 18.高并发下的服务降级、限流实战 19.实现高并发请求和实现高可用架构解决方案 20.全程代码实操,提供全部代码和资料 21.提供答疑和提供企业技术方案咨询企业一线架构师讲授,代码在老师的指导下企业可以复用,提供企业落地方案。  版权归作者所有,盗版将进行法律维权。 

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值