• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

什么是蜕变测试(Metamorphic Testing)

发布: 2010-10-19 12:14 | 作者: 网络转载 | 来源: 本站原创 | 查看: 94次 | 进入软件测试论坛讨论

领测软件测试网

  下面是一个比较正式的关于蜕变测试(Metamorphic Testing)的定义:

  Metamorphic testing is used in conjunction with other test case selection strategies Given a test case selection strategy S, such as path coverage, a set of test cases T ={t1,t2,t3...tn} , where is n>=1 generated. The program is then tested on T . If no failure is revealed after running all in T for i = 2, .. . , n,then T will be a set of successful test cases.

  At this stage, metamorphic testing can be carried out to generate follow-up test cases according to metamorphic relations. A metamorphic relation (MR) is an expected relation among the inputs and outputs of multiple executions of the target program. For a successful test case and a chosen MR, we can construct follow-up test say ti' and run the program again. Let p denote the program under test. We check ti, p(ti),ti' and p(ti')against the MR. If MR cannot be satisfied, the program must have failed.

  简而言之,蜕变测试是利用一些成功的测试用例来产生后续测试用例的一种技术,我们将后续的测试用例和前者之间的关系称作metamorphic relation(MR)。举一个很简单的例子来说,假设我们有一个计算sin函数的程序(输入值为弧度),一般情况下我们可以利用一些特殊值去进行测试,比如sin(0)=0,sin(Pi/2)=1 等。但是假设我们有这么一个测试用例sin(2)其程序结果为0.909,那我们如何能判定这个结果的正确性呢?这种情况下,我们可以根据一些已知的MR去产生后续测试用例进行测试,比如sin(x)=-sin(-x),sin(x)=sin(pi-x)(这就是MR)等。如果有任何违反以上关系的情况发生,那么我们就可以认定程序中存在错误。

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/

TAG: Testing testing Metamorphic


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网