Git Bisect 的理论分析

IF 0.9 4区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Julien Courtiel, Paul Dorbec, Romain Lecoq
{"title":"Git Bisect 的理论分析","authors":"Julien Courtiel,&nbsp;Paul Dorbec,&nbsp;Romain Lecoq","doi":"10.1007/s00453-023-01194-0","DOIUrl":null,"url":null,"abstract":"<div><p>In this paper, we consider the problem of finding a regression in a version control system (VCS), such as <span>git</span>. The set of versions is modelled by a directed acyclic graph (DAG) where vertices represent versions of the software, and arcs are the changes between different versions. We assume that somewhere in the DAG, a bug was introduced, which persists in all of its subsequent versions. It is possible to query a vertex to check whether the corresponding version carries the bug. Given a DAG and a bugged vertex, the Regression Search Problem consists in finding the first vertex containing the bug in a minimum number of queries in the worst-case scenario. This problem is known to be NP-complete. We study the algorithm used in <span>git</span> to address this problem, known as <span>git bisect</span>. We prove that in a general setting, <span>git bisect</span> can use an exponentially larger number of queries than an optimal algorithm. We also consider the restriction where all vertices have indegree at most 2 (i.e. where merges are made between at most two branches at a time in the VCS), and prove that in this case, <span>git bisect</span> is a <span>\\(\\frac{1}{\\log _2(3/2)}\\)</span>-approximation algorithm, and that this bound is tight. We also provide a better approximation algorithm for this case. Finally, we give an alternative proof of the NP-completeness of the Regression Search Problem, via a variation with bounded indegree.</p></div>","PeriodicalId":50824,"journal":{"name":"Algorithmica","volume":"86 5","pages":"1365 - 1399"},"PeriodicalIF":0.9000,"publicationDate":"2023-12-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Theoretical Analysis of Git Bisect\",\"authors\":\"Julien Courtiel,&nbsp;Paul Dorbec,&nbsp;Romain Lecoq\",\"doi\":\"10.1007/s00453-023-01194-0\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>In this paper, we consider the problem of finding a regression in a version control system (VCS), such as <span>git</span>. The set of versions is modelled by a directed acyclic graph (DAG) where vertices represent versions of the software, and arcs are the changes between different versions. We assume that somewhere in the DAG, a bug was introduced, which persists in all of its subsequent versions. It is possible to query a vertex to check whether the corresponding version carries the bug. Given a DAG and a bugged vertex, the Regression Search Problem consists in finding the first vertex containing the bug in a minimum number of queries in the worst-case scenario. This problem is known to be NP-complete. We study the algorithm used in <span>git</span> to address this problem, known as <span>git bisect</span>. We prove that in a general setting, <span>git bisect</span> can use an exponentially larger number of queries than an optimal algorithm. We also consider the restriction where all vertices have indegree at most 2 (i.e. where merges are made between at most two branches at a time in the VCS), and prove that in this case, <span>git bisect</span> is a <span>\\\\(\\\\frac{1}{\\\\log _2(3/2)}\\\\)</span>-approximation algorithm, and that this bound is tight. We also provide a better approximation algorithm for this case. Finally, we give an alternative proof of the NP-completeness of the Regression Search Problem, via a variation with bounded indegree.</p></div>\",\"PeriodicalId\":50824,\"journal\":{\"name\":\"Algorithmica\",\"volume\":\"86 5\",\"pages\":\"1365 - 1399\"},\"PeriodicalIF\":0.9000,\"publicationDate\":\"2023-12-21\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Algorithmica\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://link.springer.com/article/10.1007/s00453-023-01194-0\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Algorithmica","FirstCategoryId":"94","ListUrlMain":"https://link.springer.com/article/10.1007/s00453-023-01194-0","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

摘要

在本文中,我们考虑的是在版本控制系统(VCS)(如 git)中寻找回归的问题。版本集以有向无环图(DAG)建模,其中顶点代表软件的版本,弧代表不同版本之间的变化。我们假设在 DAG 的某处引入了一个错误,该错误会在随后的所有版本中持续存在。可以通过查询顶点来检查相应的版本是否带有该缺陷。给定一个 DAG 和一个有漏洞的顶点,回归搜索问题就是在最坏的情况下,用最少的查询次数找到第一个包含漏洞的顶点。众所周知,这个问题是 NP-完全的。我们研究了 git 中用于解决这一问题的算法,即 git bisect。我们证明,在一般情况下,与最优算法相比,git bisect 的查询次数会呈指数级增长。我们还考虑了所有顶点的indegree最多为2的限制(即在VCS中一次最多在两个分支之间进行合并),并证明在这种情况下,git bisect是一个(\frac{1}{\log _2(3/2)})近似算法,而且这个约束很紧。我们还为这种情况提供了更好的近似算法。最后,我们给出了回归搜索问题 NP 完备性的另一种证明,即通过一个有界枚举度的变体来证明回归搜索问题的 NP 完备性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。

Theoretical Analysis of Git Bisect

Theoretical Analysis of Git Bisect

Theoretical Analysis of Git Bisect

In this paper, we consider the problem of finding a regression in a version control system (VCS), such as git. The set of versions is modelled by a directed acyclic graph (DAG) where vertices represent versions of the software, and arcs are the changes between different versions. We assume that somewhere in the DAG, a bug was introduced, which persists in all of its subsequent versions. It is possible to query a vertex to check whether the corresponding version carries the bug. Given a DAG and a bugged vertex, the Regression Search Problem consists in finding the first vertex containing the bug in a minimum number of queries in the worst-case scenario. This problem is known to be NP-complete. We study the algorithm used in git to address this problem, known as git bisect. We prove that in a general setting, git bisect can use an exponentially larger number of queries than an optimal algorithm. We also consider the restriction where all vertices have indegree at most 2 (i.e. where merges are made between at most two branches at a time in the VCS), and prove that in this case, git bisect is a \(\frac{1}{\log _2(3/2)}\)-approximation algorithm, and that this bound is tight. We also provide a better approximation algorithm for this case. Finally, we give an alternative proof of the NP-completeness of the Regression Search Problem, via a variation with bounded indegree.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Algorithmica
Algorithmica 工程技术-计算机:软件工程
CiteScore
2.80
自引率
9.10%
发文量
158
审稿时长
12 months
期刊介绍: Algorithmica is an international journal which publishes theoretical papers on algorithms that address problems arising in practical areas, and experimental papers of general appeal for practical importance or techniques. The development of algorithms is an integral part of computer science. The increasing complexity and scope of computer applications makes the design of efficient algorithms essential. Algorithmica covers algorithms in applied areas such as: VLSI, distributed computing, parallel processing, automated design, robotics, graphics, data base design, software tools, as well as algorithms in fundamental areas such as sorting, searching, data structures, computational geometry, and linear programming. In addition, the journal features two special sections: Application Experience, presenting findings obtained from applications of theoretical results to practical situations, and Problems, offering short papers presenting problems on selected topics of computer science.
×
引用
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学术官方微信