Code review is dead in agile team?

Code review is dead in agile team?

Do we still need code review in agile team?

In the past, code review was popular in traditional software development, why do we apply code review? One of reasons is getting improvement of code quality. Now agile is hot, code review is not recommended in agile team because feedback is slow. There are many good practices which can be used to improve code quality, like pair programming, TDD, these practice have the same characterizes – fast feedback. As we known, we can significantly reduce waste if we can get fast feedback. But feedback is slow in traditional code review, I think that’s why it’s not recommended in agile team, but we should remember code review is one of tools to improve code quality.

Agile actions, like Pair programming, TDD are very good to improve code quality. I like them and apply them every day. But in practice, I find they are not always the best solution to get better code quality when knowledge cannot be shared and broadcasted with pair programming.

Nobody knows everything, someone is good at something, another one is good at something else, when coding with pair programing, Code quality can be improved once one of pairs knows particular knowledge. But when two people know nothing about that, code quality would probably be low or bug would be introduced. Sometimes, we think we know, but actually, we don’t. This often happened in the team which many new people just join. Maybe, you will think this problem can be fixed by switching pair. Switching pair is also a good practice, but who can guaranty that the next people has that particular knowledge?

When do pair programming, two people are very focus on the current work. When you do pairing, you could find all what pairs do is explaining, challenging, negotiating and typing, by this way, we can think more, think differently, think widely and think deeply, that’s the major reason why pair programing can get better code quality. But we should know there will always some noise during pairing, if noise prevent us thinking more, thinking differently, thinking widely and thinking deeply, it’s hard to get better code quality. Noise here I talk about is not only the common human behavior, like get phone, reply mail and so on, it also includes others, like our focus. For example, if we are trying to make the first test pass, but there are a lot of code which must be changed to let the target class be testable, both people have worked hard on this thing for a long time and just want to make class be testable, then they will probably make mistake when modifying code.

In this scenarios on the above, Code review can be used to assist pair programing to improve code quality, but we need change to let code review be agile, here I mean it’s able to get fast feedback by code review.

How to make code review be agile?   

Code review every day or on-demand

Traditionally, code review will be introduced after a feature implementation is finished. That’s the major drawback, because feedback is slow, a lot of code has been added or modified, if we are been suggest to use a new solution, that’s too later, if we need change, that means what we did is waste. So we can do code review by every day or on-demand.

Small code changing

Normally, small is good, like class, method. Here, small is also good for code changing during code review. Smaller code changing is, easier people understand. But when a feature is done, a lot of code is changed, it will be more differently for us to understand all changing in 5 minutes.  If we cannot understand code changing, how can we review our code efficient and effectively?

Fast feedback

Obviously, we can get fast feedback for our code. Thought the fast feedback, we can quickly change our solution, techniques, and implementation.

More communication

Pair programing is the best practice in all agile actions, it also improve the communication, but most of time, only two people. When do code review, other people will join, there will more and bigger communication. That means there will more shared understanding and knowledge in the whole team.

Conclusion

We can still use code review in agile team. Code review can be agile by do it every day or on-demand. It can be used assist pair programing to improve code quality.

 
 
 
标签: Agile

当前标签: Agile

 
Code review is dead in agile team? 没Ready 2013-03-30 16:42 阅读:53 评论:0  
 
How to test non-public method? 没Ready 2013-03-23 14:02 阅读:501 评论:2  
 
 
CI is Integrate Constantly 没Ready 2012-08-04 10:52 阅读:11 评论:0  
 
How can we refactor code without unit tests? 没Ready 2012-08-04 10:51 阅读:14 评论:0
原文地址:https://www.cnblogs.com/Leo_wl/p/2990759.html