简体   繁体   English

如何根据症状避免作为集成商的重复代码错误?

[英]How to avoid recurring code-bugs as an integrator based on the symptoms?

When integrating submodule-releases into parent projects I regularly encounter bugs which are only visible and triggered when integrated. 将子模块发行版集成到父项目中时,我经常遇到仅在集成时才可见和触发的错误。 This is normal. 这很正常。 Bugs are normal. 错误是正常的。 We debug them, fix them and submit them into the submodule. 我们调试它们,修复它们并将其提交到子模块中。

Now it happened several times that such fixes are overwritten by a submodule-developer later on and reoccur in the project which integrated this submodule. 现在已经发生了好几次,后来由子模块开发人员覆盖了这些修补程序,并再次出现在集成了该子模块的项目中。

Over time and due to virtually no intelligent tracking of their behavior and their symptoms it happens that it was forgotten and it is fixed again. 随着时间的流逝,由于几乎没有智能地跟踪他们的行为和症状,因此很可能遗忘了它,并对其进行了修复。 This is extremely time-consuming especially if it is tricky one. 这是非常耗时的,尤其是在棘手的情况下。

Hence my question: how can I technically store the 'behavior' of a bug to be "reminded" when I see its symptoms again? 因此,我的问题是:当我再次看到其症状时,如何从技术上存储要“提醒”的错误的“行为”?

Is there a tool which addresses my problem. 有没有解决我问题的工具。 Anything I can used to categorize fixed bugs by symptoms? 我可以用症状对固定错误进行分类吗?

One idea I had was to extend a static-analyser (such as coverity or clang-analyzer) with custom-patterns. 我的一个想法是使用自定义模式扩展静态分析器(例如Coverity或clang分析器)。 This would not address the behavior/symptoms-approach but I could analyze the code during compilation with patterns created during the first fixing: "if this code is written in a certain way it is not good". 这不会解决行为/症状方法,但是我可以使用在第一次修复过程中创建的模式来分析编译期间的代码:“如果以某种方式编写此代码,那就不好了”。 In my experience I could address quite an amount of bugs this way, but not all of them. 以我的经验,我可以用这种方式解决很多错误,但不是全部。

I added C and C++ tags as these are the languages I'm using. 我添加了C和C ++标记,因为这些是我正在使用的语言。

UPDATE : As there were questions in the comments: We are using git. 更新 :由于在评论中有问题:我们正在使用git。 and the bugs which are re-appearing are committed months or even years after their first correction. 并且重新出现的错误会在首次更正后的几个月甚至几年内提交。

UPDATE : we are using Mantis for bug-tracking. 更新 :我们正在使用螳螂进行错误跟踪。

This is not a tool, but rather a process. 这不是一个工具,而是一个过程。 I have used BFV (Bug Fix Verification) tests to do this. 我已经使用BFV(错误修复验证)测试来执行此操作。 Everytime you fix a bug, you add an automated BFV test for it. 每次修复错误时,都会为其添加自动BFV测试。 The name of the test would be BFV#bugno - this is the bug number in the bug database. 测试的名称为BFV#bugno-这是错误数据库中的错误编号。 As part of all builds which are given to testing, run all BFV tests as part of regression testing. 作为测试的所有构建的一部分,运行所有BFV测试作为回归测试的一部分。 If BFV2042 fails, you can look up Bug#2042 in your bug database to be reminded about it. 如果BFV2042失败,您可以在Bug数据库中查找Bug#2042来提醒它。 If you are running regression tests before accepting merges from submodule branches, then it's even better. 如果在接受子模块分支的合并之前运行回归测试,那就更好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM