Earlier quoted context omitted.
There actually were unit tests for it, there was just an edge case I didn’t think to test that caused things to crash, which caused a cascading error.
Sure. Seems like a classic "seven whys" kind of situation... coming down hard on the person who wrote the bug is counterproductive in a way that the whole tech industry understands, except for your former bosses at Apple.
No code reviews by default
221–230 of 315 posts
Re: No code reviews by default
#222He mentions "trust" a lot. Is that why we do code reviews, because we don't trust each other? I find this attitude problematic. We do code reviews because humans make mistakes. Requirements can be misinterpreted. Different work in progress can be in conflict with each other. Reviews are a good way to learn from each other and keep abreast of what work is occurring outside your own bubble. Not doing code reviews becau…
Yeah, IMO this is like a publisher saying "we don't have editors: we trust our authors". The intended ethos of editors and code review is that mistakes and imperfections are the norm, and you need a second pair of eyes to iron them out. That said, I do sometimes encounter individuals or cultures that seem to view code review more as a mechanism for catching abnormal/unexpected mistakes than as a normal part of the pr…
The equivalent in book writing would be that you are not allowed to write more than one page at a time, and someone must approve it before you start working on the next page.
Re: No code reviews by default
#223He mentions "trust" a lot. Is that why we do code reviews, because we don't trust each other? I find this attitude problematic. We do code reviews because humans make mistakes. Requirements can be misinterpreted. Different work in progress can be in conflict with each other. Reviews are a good way to learn from each other and keep abreast of what work is occurring outside your own bubble. Not doing code reviews becau…
If something hit production and caused a major fuck-up because there was no peer review process, then in all the places I've worked at the first action item in the post-mortem would be "we should introduce peer review." Otherwise someone would ask how we could ensure it wouldn't happen again, and no one would be able to say "because we trust them," and leave it at that. It would sound more like "I trust you will neve…
To spot quality problems before going to production .. what you need is testing.
Not "unit testing" - which is just another pointless process that does not actually provide the purported benefits.
You need a separate QA team that handles testing - manual and automated.
Re: No code reviews by default
#224Earlier quoted context omitted.
Yeah exactly, code review isn't a good place to catch actual bugs. Humans are terrible at catching bugs consistently... Humans probably introduced those bugs in the first place. It's also an exceedingly poor use of human time, which costs a heck of a lot more than machine time. We really should be relying on automated systems to catch bugs for the most part, and leave code review for what it's good for: making sure a…
How do you systematically (and proactively) ensure your testing is thorough? With testing you often run into unknown unknown cases. I’ve always code reviewed/gotten code reviewed on both the implementation and the tests, with completeness as the main quality you’re reviewing test code for. If that’s how we do it, we’re right back at code reviews.
I'm not saying code review can't find any bugs (in practice bugs are found in code review all the time), I'm just saying that if we do find a bug through code review, it means we got lucky, and we shouldn't count on getting lucky again, so better add a test/linter rule for the next time when we might not get so lucky. That's just one more way to grow your automated systems organically.
Re: No code reviews by default
#225Earlier quoted context omitted.
If something hit production and caused a major fuck-up because there was no peer review process, then in all the places I've worked at the first action item in the post-mortem would be "we should introduce peer review." Otherwise someone would ask how we could ensure it wouldn't happen again, and no one would be able to say "because we trust them," and leave it at that. It would sound more like "I trust you will neve…
This strikes me as weird excuse for code reviews. To spot quality problems before going to production .. what you need is testing. Not "unit testing" - which is just another pointless process that does not actually provide the purported benefits. You need a separate QA team that handles testing - manual and automated.
Re: No code reviews by default
#226At our company, code reviews help:
1) onboard new devs and teach them about the codebase, catch silly rookie mistakes early on
2) code reviews encourage to write readable code, what I write is readable to me, but can be incomperehensible to others, and code reviews help figure it out
3) seniors make mistakes, too, and it's nice to have another line of defense (some mistakes can be ticking bombs and not catchable in testing immediately)
In my opinion, as a developer, you shouldn't even trust yourself, let alone others, to deliver good product (especially if it's mission-critical software with a large userbase), because errare humanum est.
Re: No code reviews by default
#227Earlier quoted context omitted.
This strikes me as weird excuse for code reviews. To spot quality problems before going to production .. what you need is testing. Not "unit testing" - which is just another pointless process that does not actually provide the purported benefits. You need a separate QA team that handles testing - manual and automated.
If you don't catch major errors until the QA team has time to do a full comprehensive test of the product then those errors are probably sitting in the codebase for days or weeks, and additional changes are being piled on top of them which will make it harder to identify which commit was the problem. Do a code review and you'll catch a bunch of stuff before it even hits QA.
One thing I've seen that I like a lot is individual changes creating individual front ends. You test the one thing in that change, and it's done. This tends to cause a lot of problems with CORS, but then what doesn't?
Agreed with you though that good code reviews (whatever that means) obviates most of this.
Re: No code reviews by default
#228Earlier quoted context omitted.
This strikes me as weird excuse for code reviews. To spot quality problems before going to production .. what you need is testing. Not "unit testing" - which is just another pointless process that does not actually provide the purported benefits. You need a separate QA team that handles testing - manual and automated.
If you don't catch major errors until the QA team has time to do a full comprehensive test of the product then those errors are probably sitting in the codebase for days or weeks, and additional changes are being piled on top of them which will make it harder to identify which commit was the problem. Do a code review and you'll catch a bunch of stuff before it even hits QA.
You should absolutely have a small QA team, but their job shouldn't be doing the QA -- it should be helping others do their own QA.
Re: No code reviews by default
#229Earlier quoted context omitted.
If you don't catch major errors until the QA team has time to do a full comprehensive test of the product then those errors are probably sitting in the codebase for days or weeks, and additional changes are being piled on top of them which will make it harder to identify which commit was the problem. Do a code review and you'll catch a bunch of stuff before it even hits QA.
Major errors are easy to spot and will likely take QA minutes to find. They're also probably not going to do a full test of the entire system with every change unless you've got a very small product. One thing I've seen that I like a lot is individual changes creating individual front ends. You test the one thing in that change, and it's done. This tends to cause a lot of problems with CORS, but then what doesn't? Ag…
Re: No code reviews by default
#230Earlier quoted context omitted.
Ok, but many companies don't use such ridiculous process.
It's not as ridiculous as it sounds as long as the testing and verification happens as part of the PR.