Nonconformance between programs and contracts: a study on C#/code contracts open source systems

Alysson Milanez, Bianca Lima, José Ferreira, T. Massoni
{"title":"Nonconformance between programs and contracts: a study on C#/code contracts open source systems","authors":"Alysson Milanez, Bianca Lima, José Ferreira, T. Massoni","doi":"10.1145/3019612.3019779","DOIUrl":null,"url":null,"abstract":"Detecting nonconformances between contracts and code is critical in contract-based programs, although detection is only the first step in correction; one needs to pinpoint their causes. For example, a nonconformance may be due to a method precondition that is weaker than it should be, or maybe the program behavior breaks the corresponding contracts. Previous research on contract-based programs lacks evidence about the most frequent causes for nonconformances. Either, no previous work elaborate on the effort required for establishing a likely cause. In this work, from 63 automatically-detected nonconformances found in 12 open source C#/Code Contracts systems, we manually analyze their likely causes, among contract or code defects. We observe nonconformances are frequently due to the weakness of preconditions, or to programs failing to fulfill contracts that seem appropriate to the problem at hand, although most nonconformances cause failures at the exit of operations (postcondition and invariant nonconformances sum up to 35). We also report on the obstacles in determining a likely cause, in which context information about the affected program fragment is often relevant.","PeriodicalId":20728,"journal":{"name":"Proceedings of the Symposium on Applied Computing","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2017-04-03","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the Symposium on Applied Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3019612.3019779","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Detecting nonconformances between contracts and code is critical in contract-based programs, although detection is only the first step in correction; one needs to pinpoint their causes. For example, a nonconformance may be due to a method precondition that is weaker than it should be, or maybe the program behavior breaks the corresponding contracts. Previous research on contract-based programs lacks evidence about the most frequent causes for nonconformances. Either, no previous work elaborate on the effort required for establishing a likely cause. In this work, from 63 automatically-detected nonconformances found in 12 open source C#/Code Contracts systems, we manually analyze their likely causes, among contract or code defects. We observe nonconformances are frequently due to the weakness of preconditions, or to programs failing to fulfill contracts that seem appropriate to the problem at hand, although most nonconformances cause failures at the exit of operations (postcondition and invariant nonconformances sum up to 35). We also report on the obstacles in determining a likely cause, in which context information about the affected program fragment is often relevant.
程序和契约之间的不一致性:c# /代码契约开源系统的研究
在基于合同的程序中,检测合同和代码之间的不一致是至关重要的,尽管检测只是纠正的第一步;人们需要查明其原因。例如,不一致可能是由于方法的先决条件比它应该的弱,或者可能是程序行为打破了相应的契约。先前对基于合同的项目的研究缺乏关于不符合的最常见原因的证据。或者,以前的工作没有详细说明建立一个可能的原因所需要的努力。在这项工作中,我们从12个开源c# /Code Contracts系统中发现的63个自动检测到的不符合项中,手动分析了它们在合同或代码缺陷中的可能原因。我们观察到,不一致经常是由于前提条件的弱点,或者程序未能履行似乎适合手头问题的契约,尽管大多数不一致导致了操作退出时的失败(后条件和不变不一致的总和为35)。我们还报告了确定可能原因的障碍,其中有关受影响的程序片段的上下文信息通常是相关的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信