使用持续集成构建设置时,代码冻结是否仍然相关?
我过去使用过持续集成服务器并取得了巨大成功,并且不需要在源代码控制系统上执行代码冻结。
然而,最近我发现,大多数商店在准备发布甚至产品的新测试版本时都在使用代码冻结的概念。 这个想法甚至在我当前的项目中也存在。
当您尽早且频繁地签入并使用单元测试、集成测试、验收测试等时,是否还需要冻结代码?
I've used a Continuous Integration server in the past with great success, and hadn't had the need to ever perform a code freeze on the source control system.
However, lately it seems that everywhere I look, most shops are using the concept of code freezes when preparing for a release, or even a new test version of their product. This idea runs even in my current project.
When you check-in early and often, and use unit tests, integration tests, acceptance tests, etc., are code freezes still needed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
持续集成是一个“构建”,但它是开发周期的编程部分的一部分。 就像 TDD 中的“测试”是开发周期的编程部分的一部分一样。
作为整个开发周期的一部分,仍然会有构建和测试。
持续集成和测试的目的是缩短反馈循环并为程序员提供更多可见性。 最终,这确实意味着测试和构建中的问题更少,但这并不意味着您不再执行开发周期的原始部分 - 它们只是更有效并且可以提升到更高的水平,因为更多的小问题正在被解决。在开发周期的早期发现。
因此,您仍然需要冻结代码(或至少冻结一个分支),以确保您所交付的基线符合预期。 仅仅因为有人可以高度自信地实现某些东西,并不意味着它会在不经过相同的最终周期的情况下进入您的版本,而代码冻结是其中的重要组成部分。
使用 CI,您的代码冻结时间可以非常短,因为您的最终构建、测试和发布可能非常可靠,并且代码冻结甚至可能不存在于小型项目中,因为不需要分支 - 您发布并立即返回很快就可以开发下一组功能。
我还想补充一点,CI 和 TDD 允许最终的构建和测试阶段恢复到更接近传统的瀑布式(进行所有开发,进行所有测试,然后发布),而不是进行更持续的 QA对于每周或每月构建的项目。 你的测试人员可以使用 CI 构建来提供早期反馈,但这实际上是与最终测试中不同类型的反馈,在最终测试中,你正在寻找稳定性和可靠性,而不是功能(这显然在单元“测试”中被忽略了)开发商已经建造)。
Continuous integration is a "build" but it's part of the programming part of the development cycle. Just like the "tests" in TDD are part of the programming part of the development cycle.
There will still be builds and testing as part of the overall development cycle.
The point of continuous integration and tests is to shorten the feedback loops and give programmers more visibility. Ultimately, this does mean less problems in testing and builds, but it doesn't mean you no longer do the original parts of your development cycle - they are just more effective and can be raised to a higher level, since more tivial problems are being caught earlier in the development cycle.
So you will still have to have a code freeze (or at least a branch) in order to ensure the baseline for what you are shipping is as expected. Just because someone can implement something with a high degree of confidence does not mean it goes into your release without passing through the same final cycles, and the code freeze is an important part of that.
With CI, your code freezes can be very short, since your final build, testing and release may be very reliable, and code freeze may not even exist on small projects, since there is no need for a branch - you release and go right back into development on the next set of features very quickly.
I'd also like to add that CI and TDD allow the final build and testing phase to revert back closer to the traditional waterfall (do all dev, do all testing, then release), as opposed to the more continual QA which has been done on projects with weekly or monthly builds. Your testers can use the CI builds to give early feedback, but it's effectively a different sort of feedback than in the final testing, where you are looking for stability and reliability as opposed to functionality (which obviously was missed in the unit "tests" which the developers had built).
代码冻结很重要,因为持续集成不会取代运行时回归测试。
构建应用程序并通过单元测试只是挑战的一小部分,理想情况下,当您冻结某个版本的代码时,您签署了两件事:
如果您使用现代 SCM,只需在此时分叉代码并开始分支中的下一个版本的工作,并在部署项目时进行合并。 (当然,放置一个标签,以便在需要应用中断补丁时可以回滚该点)。
一旦代码处于“发布模式”,就不应再碰它。
我们的典型流程:
当然,我们在开发过程中通常会有许多并行分支,这些分支在 UAT 之前合并回发布流。
Code freezes are important, because continues integration does not replace runtime regression testing.
Having an application build and pass unit testing is only a small part of the challenge, ideally, when you freeze code for a release, you are signing off on two things:
If your using a modern SCM, just fork the code at that point and start work on the next release in a branch, and do a merge when the project is deployed. (Of course, place a label so you can rollback that point if you need to apply a breaking patch).
Once code is in "release mode", it should not be touched.
Our typical process:
Of course, we usually have many parallel branches during development, that merge back up into the release stream before UAT.
代码冻结更多地与质量检查有关,而不是与开发有关。 代码冻结是 QA 说的:“够了。我们只有足够的带宽来全面测试迄今为止添加的新功能。” 这并不意味着开发人员没有足够的带宽来添加更多功能,只是 QA 需要时间处理静态代码库以确保一切都能协同工作。
如果您都处于持续集成模式(包括 QA),这可能只是很短的一段时间的冻结,而 QA 会在整个包发布之前对其进行最终批准。
这完全取决于您的 QA 和回归测试与开发周期的集成程度。
我赞同已经提到的关于 SCM 分支的投票,并允许开发人员继续使用与 QA 正在测试的代码分支不同的代码分支。 这一切都回到同一件事。 质量保证和回归测试需要在发布前一段时间内有一个静态代码库。
The code freeze has more to do with QA than it has to do with Dev. The code freeze is the point where QA has said: "Enough. We only have bandwidth to fully test the new features added in so far." That doesn't mean dev doesn't have the bandwidth to add more features, it's just that QA needs time with a quiescent code base to ensure that everything works together.
If you're all in continuous integration mode (QA included) this could be just a freeze of a very short time while QA puts the final seal of approval on the whole package just before it goes out the door.
It all depends on how tightly your QA and regression testing are integrated into the dev cycle.
I'd second the votes already mentioned about SCM branching and allowing dev to continue on a different code branch than what QA is testing. It all goes back to the same thing. QA and regression testing need a quiescent code base for a period of time prior to release.
我认为代码冻结很重要,因为每个新功能都是潜在的新错误来源。 当然,回归测试很棒,有助于解决这个问题。 但代码冻结允许开发人员专注于修复当前未解决的错误,并使当前功能集进入值得发布的状态。
最好的情况是,如果我真的想在代码冻结期间开发新代码,我会分叉冻结的树,在那里完成我的工作,然后在冻结后,将分叉的树合并回去。
I think that code freezes are important because each new feature is a potential new source of bugs. Sure regression tests are great and help address this issue. But code freezes allow the developers to focus on fixing currently outstanding bugs and get the current feature set into a release worthy state.
At best, if I really wanted to develop new code during a code freeze, I would fork the frozen tree, do my work there, then after the freeze, merge the forked tree back in.
我听起来像是一个受环境驱动的人,但答案是“这取决于情况”。
代码冻结是一种解决问题的策略。 如果你没有遇到它擅长解决的问题,那么不,不需要它。 如果您有另一种技术来解决该问题,那么不,不需要它。
代码冻结是一种降低风险的技术。 if带来的优点是稳定和简单。 它带来的缺点是
另一种技术是使用分支,例如“特征分支”。 分支的缺点是处理分支和合并更改的成本。
您描述的用于降低风险的技术是自动测试以提供快速反馈。 这里的权衡是速度的提高带来了一些风险的增加(你会错过一些错误)。
在我同意的这些方法中,我更喜欢自动化测试。 但在某些情况下,例如失败成本非常高,代码冻结确实提供了很多价值。
I'm going to sound like one of the context-driven people but the answer is "it depends".
Code Freeze is a strategy to cope with a problem. If you don't have the problem it is good at addressing, then no, it isn't needed. If you have another technique for addressing the problem, then no, it isn't needed.
Code Freeze is one technique for reducing risk. The advantages if brings are stability and simplicity. The disadvantage it brings are
Another technique is to use Branching, such as with "Feature Branches". The disadvantage of Branching is cost of dealing with the branches, of merging changes.
The technique you're describing for reducing risk is Automated Testing to give fast feedback. The trade-off here is increased velocity for some increased risk (you will miss some bugs).
Of these approaches I'm with you, I prefer the Automated Testing. But there are some situations, such as very high cost of failure, where a Code Freeze does provide a lot of value.