Yes. I didn't used to, but that was a very big mistake. Just wait until something you signed off on doesn't run and folks ask, "But didn't you review this code and say that everything 'looked good'? It doesn't even run!" It's embarrassing to say the least. If you're doing a code review, run the darn code. What would you think of a mechanic who didn't make sure the car was able to turn on after claiming it was fixed?
Making the code correct is a shared responsibility between reviewer and author; if the code has a bug or doesn't even run that means both people missed the problem. Unless the author is very new/junior (still at a stage where they need close guidance on individual changes) then I would be more annoyed or concerned by an author who hasn't run their change at all than a reviewer who hasn't run it and misses some proble…
Ask HN: Do you pull and run code as part of code review?
61–70 of 146 posts
Re: Ask HN: Do you pull and run code as part of code review?
#62Re: Ask HN: Do you pull and run code as part of code review?
#63- what’s in the change; if I’m reasonably sure I understand it, and that it won’t have side effects, and that it’s the right thing to do, I may skip running it
- how familiar I am with the area of the codebase; even if the above is satisfied, I’ll pull it and explore around the change to look for potential side effects I’ve missed, or other approaches that might be better for maintenance… and generally to improve my familiarity
- how confident I am in the other contributor’s (and reviewers’) thoroughness; I generally scrutinize even trivial changes if I don’t think others have, because surprising things sometimes reveal themselves
Re: Ask HN: Do you pull and run code as part of code review?
#64So people doing code review can poke at the resulting running program if they like. But generally code review is used for the "how" instead of the "does it work?"
Re: Ask HN: Do you pull and run code as part of code review?
#65Re: Ask HN: Do you pull and run code as part of code review?
#66Sometimes, if it adds a new feature or something 'interesting', I've checked it out locally to see what the user-facing behaviour is, but this is very rare.
Re: Ask HN: Do you pull and run code as part of code review?
#67Most of the time I pull the code to easily navigate it in context. The diff viewer will only get you so far.
Re: Ask HN: Do you pull and run code as part of code review?
#68Better I find out about edge cases that weren’t considered or unit tested than our customers.
Re: Ask HN: Do you pull and run code as part of code review?
#69No. That's the job of unit tests, integration tests and your CI/CD pipeline or alternatively the test environment (dev, staging, quality control, you name it...). Moreover, the person having written the code is supposed to have checked that it runs and meets business requirements - although the latter should be ultimately checked by your Product Owner or client.
Additional benefit is that this shows to devs and management what a time saver TDD and testing in general is. It shows immediately that lacking tests cost valuable, senior, time, rather than save time by not writing tests.
It also is simply needed: when there are no tests, we'll need to manually verify and check for regressions.
Re: Ask HN: Do you pull and run code as part of code review?
#70If you're working on some legacy codebase and don't have these luxuries, I totally get running it locally first. I am lucky to work with people who I do trust deeply to not waste others' precious time by testing first so there is probably also a human element for me.