本文主要是介绍持续审查,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
持续审查
摘自《Continuous Integration:Improving Software Quality and Reducing Risk》
Peer-based code reviews are generally considered beneficial to the overall quality of a code base because they present opportunities for an objective analysis by a second pair of eyes.
同行代码审查通常被认为是对代码的总体质量有益的,因为提供了客观分析的第二双眼睛。
人工审查 vs. 自动审查
The difference between human-based inspection and that done with a static analysis tool is twofold.
• These tools are incredibly cheap to run often(工具可以经常运行,成本很低). They only require human intervention to configure and run once—after that, they are automated and provide a savings as compared to a person’s hourly rate.
• These tools harness the unflinching and unrelenting objectiveness of a computer(工具拥有计算机的无所畏惧和无情的客观性). A computer won’t offer compromises like“Your code looks fine if you say mine looks fine,” and it won’t ask for bio-breaks and personal time if you run an automated inspection tool every time the version control repository changes.
中庸之道:
Automating code inspections with analysis tools handles 80% of the big picture and allows humans to intervene in the 20% that matters.
利用工具进行自动化的代码审查能解决80%的问题,让人来处理另外20%的重要问题。
For instance, Java’s PMD will run 180+ rules against a file every time it changes. If a particularly important rule is violated, such as a high cyclomatic complexity2 value, someone can take a look. Can you imagine trying to accomplish this targeting process manually? Why would anyone want to? The key to remember with automated code reviews is that they are not a replacement for manual ones—they are merely an enhancement for applying human intelligence where it’s most needed.
这篇关于持续审查的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!