对源代码管理中的历史版本进行侦探单元测试
是否有工具可以对源代码控制中的以前版本的软件运行单元测试? 这个想法将是一个错误出现,我想知道它是什么时候引入的,所以我编写了一个新的测试,软件从源代码控制中检查每个旧版本,在每个版本上运行测试,直到测试不再失败或我们到达了起点。
我们使用颠覆,但我很好奇是否普遍存在这样的东西。
Is there a tool to run unit tests on previous versions of software that's in source control?
The idea would be a bug surfaced and I want to know when it was introduced so I write a new test and the software checks out each back version from source control, running the test on each one, until the test doesn't fail anymore or we reach the beginning.
We use subversion but I'm curious of if anything like this exists in general.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Mercurial 有一个名为 bisect 的内置命令,它基本上可以完成您正在寻找的任务。
它被设计为与用户编写的脚本一起使用,但简而言之,它执行二分搜索,其中您的脚本(运行单元测试)告诉二分法检出的修订版“通过”还是“失败”,并基于此遍历历史记录,直到找到引入错误的修订版。
我不确定 SVN 是否存在这样的工具,但我发现 bisect 与 Mercurial 对于此类事情非常有用。
Mercurial has a built in command called bisect that essentially does what you are looking for.
It is designed to work with a user-written script but in a nutshell, it does a binary search where your script (which runs the unit tests) tells bisect if the checked out revision "passes" or "fails" and based on that it moves through the history until it finds the revision where the bug was introduced.
I'm not sure if such a tool exists for SVN, but I've found bisect with Mercurial to be very useful for this sort of thing.
Mercurial(和 Git)中的 Bisect 完全执行此工作,除了检查每个旧版本之外 - 它更快地找到问题根源
Bisect in Mercurial (and Git) perform exactly this job, except of ckecking each back version - it finds source of problem faster
几乎任何版本控制系统都可以让您检查整个构建的特定版本。并允许您跟踪构建的任何特定文件的历史记录/更改。
通常,我只是采取简单的“分而治之”的方法:
是的,其中部分或全部当然可以编写脚本。
使用 bash(如果您使用的是 Linux)或您选择的脚本语言。
Just about any version control system lets you check out a specific version of an entire build. And lets you track the history/the changes of any specific file(s) of the build.
Normally, I just take a simple "divide and conquer" approach:
And yes, some or all of this can certainly be scripted.
In bash (if you're on Linux), or in the scripting language of your choice.