博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
软件测试中什么是正交实验法_软件工程中的正交性
阅读量:2520 次
发布时间:2019-05-11

本文共 3482 字,大约阅读时间需要 11 分钟。

软件测试中什么是正交实验法

正交性 (Orthogonality)

In software engineering, a system is considered orthogonal if changing one of its components changes the state of that component only.

在软件工程中,如果更改系统的组件之一仅更改该组件的状态,则认为该系统是正交的。

For instance, consider a program with three variables: a, b, and c. Changing the value of a should not change the value of b or c, provided they are independent.

例如,考虑一个具有三个变量的程序:a,b和c。 更改a的值不应更改b或c的值,只要它们是独立的。

This property is particularly critical in debugging a program since one relies on narrowing down the number of moving parts of a program to identify the root cause of the problem.

此属性在调试程序时特别重要,因为人们依赖于缩小程序的移动部分的数量来确定问题的根本原因。

See the following quote from Eric S. Raymond’s “Art of UNIX programming”:

请参见Eric S. Raymond的“ UNIX编程艺术”中的以下引用:

Orthogonality is one of the most important properties that can help make even complex designs compact. In a purely orthogonal design, operations do not have side effects; each action (whether it’s an API call, a macro invocation, or a language operation) changes just one thing without affecting others. There is one and only one way to change each property of whatever system you are controlling.
正交性是最重要的属性之一,可以帮助使复杂的设计变得紧凑。 在纯正交设计中,操作没有副作用。 每个操作(无论是API调用,宏调用还是语言操作)都只会改变一件事而不会影响其他事情。 只有一种方法可以更改您所控制的任何系统的每个属性。

Orthogonality is a software design principle for writing components in a way that changing one component doesn’t affect other components. It is the combination of two other principles, namely strong cohesion and loose coupling.

正交性是一种软件设计原理,用于编写组件,而更改一个组件不会影响其他组件。 它是另外两个原理的结合,即强内聚和松散耦合。

It's actually is a term borrowed from mathematics. For example, two lines are orthogonal if they are perpendicular. In software design, two components are orthogonal if a change in one does not affect the other.

它实际上是一个从数学借来的术语。 例如,如果两条线是垂直的,则它们是正交的。 在软件设计中,如果一个组件的更改不影响另一个组件,则两个组件是正交的。

Applying this concept to classes or other sections of code results in less coupling. To be orthogonal two classes cannot depend on each others implementation. They also cannot share global data. Changing the internals of one class does not affect the other class. Components should be independent and have only a single responsibility.

将此概念应用于类或代码的其他部分可减少耦合。 要正交,两个类不能互相依赖。 他们也不能共享全局数据。 更改一个类的内部结构不会影响另一类。 组件应该是独立的,并且只有一个责任。

Consider a method that reads a list of numbers from a file and returns them in sorted order. Now the requirements change and the numbers are in a database. Modifying this method to access the database would cause client code to change. If this were two different methods, then a new source would not affect the sorting method. Only the client code would have to know the source of the numbers.

考虑一种从文件中读取数字列表并按排序顺序返回数字的方法。 现在,需求已更改,并且编号已存储在数据库中。 修改此方法以访问数据库将导致客户端代码更改。 如果这是两种不同的方法,那么新的来源将不会影响排序方法。 只有客户代码才需要知道数字的来源。

强大的凝聚力 (Strong Cohesion)

Inside a software component, code should be strongly connected. This is an indication that the code is correctly divided.

在软件组件内部,应牢固地连接代码。 这表明代码已正确划分。

If a component had two or more relatively disconnected parts, that may indicate that those parts should be in a different component, or on its own.

如果一个组件具有两个或多个相对断开的部分,则可能表明这些部分应位于不同的组件中,或单独存在。

松耦合 (Loose Coupling)

Between software components, there should be few connections. If two components are strongly coupled, it may indicate that they need to be one component, or that they need to be differently divided into more components.

在软件组件之间,应该很少有连接。 如果两个组件紧密耦合,则可能表明它们需要是一个组件,或者需要以不同的方式将它们分为更多的组件。

翻译自:

软件测试中什么是正交实验法

转载地址:http://qlrwd.baihongyu.com/

你可能感兴趣的文章
使用Android OpenGL ES 2.0绘图之六:响应触摸事件
查看>>
我们过去几年做对了哪些事
查看>>
ubuntu 16.04LTS
查看>>
javascript深入理解js闭包
查看>>
Oracle的安装
查看>>
Android Socket连接PC出错问题及解决
查看>>
Android Studio-—使用OpenCV的配置方法和demo以及开发过程中遇到的问题解决
查看>>
第2天线性表链式存储
查看>>
python自动化测试-D11-学习笔记之一(yaml文件,ddt)
查看>>
mysql存储过程使用游标循环插入数据
查看>>
Ubuntu 12.04 添加新用户并启用root登录
查看>>
20145309信息安全系统设计基础第9周学习总结上
查看>>
c# 字段、属性get set
查看>>
td内容超出隐藏
查看>>
Spring CommonsMultipartResolver 上传文件
查看>>
Settings app简单学习记录
查看>>
SQLAlchemy
查看>>
多线程
查看>>
使用缓存的9大误区(下)转载
查看>>
appium键值对的应用
查看>>