Test Blueprints - Exposing Side Effects in Execution Traces to Support Writing Unit Tests

Adrian Lienhard, Tudor Gîrba, O. Greevy, Oscar Nierstrasz
{"title":"Test Blueprints - Exposing Side Effects in Execution Traces to Support Writing Unit Tests","authors":"Adrian Lienhard, Tudor Gîrba, O. Greevy, Oscar Nierstrasz","doi":"10.1109/CSMR.2008.4493303","DOIUrl":null,"url":null,"abstract":"Writing unit tests for legacy systems is a key maintenance task. When writing tests for object-oriented programs, objects need to be set up and the expected effects of executing the unit under test need to be verified. If developers lack internal knowledge of a system, the task of writing tests is non-trivial. To address this problem, we propose an approach that exposes side effects detected in example runs of the system and uses these side effects to guide the developer when writing tests. We introduce a visualization called Test Blueprint, through which we identify what the required fixture is and what assertions are needed to verify the correct behavior of a unit under test. The dynamic analysis technique that underlies our approach is based on both tracing method executions and on tracking the flow of objects at runtime. To demonstrate the usefulness of our approach we present results from two case studies.","PeriodicalId":350838,"journal":{"name":"2008 12th European Conference on Software Maintenance and Reengineering","volume":"2004 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2008-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"13","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2008 12th European Conference on Software Maintenance and Reengineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/CSMR.2008.4493303","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 13

Abstract

Writing unit tests for legacy systems is a key maintenance task. When writing tests for object-oriented programs, objects need to be set up and the expected effects of executing the unit under test need to be verified. If developers lack internal knowledge of a system, the task of writing tests is non-trivial. To address this problem, we propose an approach that exposes side effects detected in example runs of the system and uses these side effects to guide the developer when writing tests. We introduce a visualization called Test Blueprint, through which we identify what the required fixture is and what assertions are needed to verify the correct behavior of a unit under test. The dynamic analysis technique that underlies our approach is based on both tracing method executions and on tracking the flow of objects at runtime. To demonstrate the usefulness of our approach we present results from two case studies.
测试蓝图——暴露执行跟踪中的副作用,以支持编写单元测试
为遗留系统编写单元测试是一项关键的维护任务。在为面向对象的程序编写测试时,需要建立对象,并且需要验证执行被测单元的预期效果。如果开发人员缺乏系统的内部知识,那么编写测试的任务就很重要。为了解决这个问题,我们提出了一种方法,该方法暴露在系统的示例运行中检测到的副作用,并在编写测试时使用这些副作用来指导开发人员。我们引入了一个名为Test Blueprint的可视化工具,通过它我们可以确定所需的fixture是什么,以及需要哪些断言来验证被测单元的正确行为。作为我们方法基础的动态分析技术是基于跟踪方法执行和跟踪运行时的对象流。为了证明我们的方法的有效性,我们给出了两个案例研究的结果。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信