单元测试构建文件
单元测试构建文件的最佳策略是什么?
我问的原因是我的公司生产高度可靠的嵌入式设备。 软件补丁不是一种选择,因为分发它们需要我们的客户花费数千美元。 因此,我们有非常严格的代码质量程序(单元测试、代码审查、可追溯性等)。 这些程序正在应用于我们的构建文件(如果您必须知道的话,我希望遗憾的是自动工具),但感觉就像是黑客。
呃...项目编译...将构建文件标记为已审查和单元测试。
必须有更好的方法。 有想法吗?
What are the best policies for unit testing build files?
The reason I ask is my company produces highly reliable embedded devices. Software patches are just not an option, as they cost our customers thousands to distribute. Because of this we have very strict code quality procedures(unit tests, code reviews, tracability, etc). Those procedures are being applied to our build files (autotools if you must know, I expect pity), but if feels like a hack.
Uh... the project compiles... mark the build files as reviewed and unit tested.
There has got to be a better way. Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是我们在跨十几个平台构建大型代码库(数百万行代码)时所采取的方法。
Here's the approach we've taken when building a large code base (many millions of lines of code) across more than a dozen platforms.
让您的构建文件编译软件的已知版本(或者从构建角度来看类似的更简单的代码),并将使用新构建工具获得的结果与预期结果(使用经过验证的构建工具版本构建)进行比较)。
Have your build file to compile a known version of your software (or simpler piece of code that is similar from a build perspective) and compare the result obtained with your new build tools to a expected result (built with a validated version of the build tools).
在我的项目中,构建文件不会经常更改。 更重要的是,我可以重用早期项目中的构建文件,只更改一些变量(我将其移至易于识别的部分)。 这就是为什么对我来说不需要对构建文件进行单元测试。 这在其他项目中可能有所不同。
In my projects build-files don't change very often. Even more, I can reuse build-files from earlier projects, only changing some variables (that I moved to an easy to recognize section). That's why for me it is unneeded to unit-test the build-files. That can be different in other projects.