How to Improve Code Quality?

Ref: https://www.perforce.com/blog/sca/what-code-quality-and-how-improve-it

Measuring quality helps you understand where you’re at. After you’ve measured, you can take steps to improve overall quality.

Here are four ways you can improve code quality.

1. Use a Coding Standard
Using a coding standard is one of the best ways to ensure high quality code.

A coding standard makes sure everyone uses the right style. It improves consistency and readability of the codebase. This is key for lower complexity and higher quality.

How to Do It
The best way to use a coding standard is to:

  • Train your developers
  • Help them to comply with it
  • You can do this by using a static code analyzer.

2. Analyze Code — Before Code Reviews

Quality should be a priority from the very start of development. There isn’t always the luxury of time as development progresses. That’s why it’s important to analyze code before code reviews begin. And it’s best to analyze code as soon as it’s written.

In DevOps, code analysis takes place during the create phase. Static analyzers can be run over code as soon as it’s written. This creates an automated feedback loop, so developers can improve code before it goes to the code review phase.

After all, the earlier you find errors, the faster, easier, and cheaper they are to resolve.

How to Do It
The best way to improve quality is by analyzing code automatically. By running a static analyzer over code early and often, you’ll make sure the code that gets to the code review phase is the highest quality possible. Plus, you can use static analyzers (such as Helix QAC) to monitor key quality metrics.

3. Follow Code Review Best Practices
Manual code reviews are still important for verifying the intent of the code. When code reviews are done well, they improve overall software quality.

How to Do It
The best way to do code reviews is to follow best practices and take advantage of automated tools.

4. Refactor Legacy Code (When Necessary)
One way to improve the quality of an existing codebase is through refactoring. Refactoring legacy code can help you clean up your codebase and lower its complexity.

最新文章

  1. [LeetCode] Integer to Roman 整数转化成罗马数字
  2. Java配置环境变量
  3. HTML5新特性之移动设备API
  4. 配置windows失败,还原更新,请勿关机
  5. C 二叉树 1
  6. crontab与环境变量
  7. 菜单之二:使用xml文件定义菜单
  8. java怎么处理json数据
  9. PHP全局变量,超全局变量
  10. 《2018面向对象程序设计(Java)课程学习进度条》
  11. 去除编辑器的HTML标签
  12. NodeJS的优缺点
  13. Java 8 中的 Lambda 表达式
  14. T4模版自动生成MSSQL实体类
  15. Java 异常处理的重要认识
  16. sqlalchemy orm介绍
  17. go标准库的学习-io/ioutil
  18. tomcat启动项目 端口占用
  19. Android Studio - Unable to create Debug Bridge: Unable to start adb server: adb server version (32) doesn't match this client (40)
  20. 基于easyui开发Web版Activiti流程定制器详解(四)——页面结构(下)

热门文章

  1. VS2017/VS 2019查看源代码
  2. 【插件】【idea】的Mybatis Plugin插件方便mapper接口方法和mapper XML文件之间来回切换
  3. eclipse项目有红色感叹号
  4. 使用Mysql中的concat函数或正则匹配来快速批量生成用于执行的sql语句
  5. 使用 Redis 的 sorted set 实现用户排行榜
  6. 英语insuraunce保险
  7. 记一次奇怪的python多个变量拼接后的字符串丢失事件
  8. 怎样遍历NodeList对象
  9. WPF 的命令的自动刷新时机——当你 CanExecute 会返回 true 但命令依旧不可用时可能是这些原因
  10. .net Dapper 实践系列(2) ---事务添加(Layui+Ajax+Dapper+MySQL)