What should be done first: Code reviews or Unit tests?
- by goldenmean
Hello,
If a developer implements code for some module and wants to get it reviewed. What should be the order :
*First unit test the module after designing test cases for the module, debugging and fixing the bugs and then give the modified code for peer code review
(Pros- Code to be reviewed is 'clean' to a good extent. Reduces some avoidable review comments and rework.
Cons- Developer might spend large time debugging/fixing a bug which could have pointed/anticipated in peer code reviews)
Or
*First do the code review with peers and then go for unit testing.
What are your thoughts/experience on this?
I believe this approach for unit testing, code reviewing should be programming language agnostic, but it would be interesting to know otherwise(if applicable) with specific examples.
-AD