top | item 46974088

(no title)

port11 | 18 days ago

I’ve never been asked for coverage as a metric or target, at least not by managers. Most of the… drudge that you describe seems to come from fellow developers. These are self-inflicted wounds by the “journeyman idealists”, making us all perpetual beginners.

(That said, I do like unit tests and I think code reviews can be useful for sparing if you have a good vibe and trust in the team.)

discuss

order

JKCalhoun|18 days ago

I have seen coworkers, who are otherwise very nice people, become rather nasty when given some authority over other's code in the form of code reviews. The code review turns into "this is how I would have written it, rewrite it."

What we did before code reviews: we would get together with our fellow engineers in front of a whiteboard and knock out the structure of the code one was tasked with. We'd argue whether caching is necessary or if the framework provides it for us. We'd talk about concurrency issues and whether to use semaphores or locks…

Once the plan looked good, an engineer was trusted enough to go off and implement it.

Unit tests are fine. Before unit tests we had coworkers (QA) that did full test suites for integration, functional testing. At the more "unit level", robust param checking (with assertions, logging) happened early within the functions that could fail. (Obvious example: checking for zero in a function that might use that value to divide. Its a kind of unit test in situ.)

Of course when management uses unit tests as some kind of replacement for actual integration and functional testing they become an end unto themselves (bonus: the company is also able to lay off QA).

port11|18 days ago

I understand. It’s a great reply.

To my dismay, I’ve never worked in a place like the first one you’ve described. Managers have certainly been confident enough in me to just let me ship stuff I built alone, or obviously that a team built without the usual red tape. Your model is very intriguing, I’ll try to implement something similar if I’m ever again able.

It’s true that code reviewers can become feral and the smallest detail a source of contention. I’ve had otherwise good team leads completely rewrite my code after accepting a review. It’s okay, maybe it wasn’t that good. Egos hurt and get hurt.

About QA: well, companies — I hope — eventually pay the price. Apple’s image of software quality now contrasted with a company that lost the trust of power users. QA and unit tests are complementary. If anything, it’s acceptance and integration tests that hurt QA, but I’ve never seen these 2 done properly anywhere.