10

During one of our 'pop-up' meetings last week.

Ralph: "The test code the developers are checking in is a mess. They don't know what they are doing."

ex.
var foo = SomeLibrary.GetFoo();
Assert.IsNotNull(foo);

Fred: "Ha ha..someone should talk to HR about our hiring practices. These people are literally driving the company backwards."
Me: "I think unit testing is complete waste of time."
- You could almost see the truck hit the wall and splatter watermelon everwhere..took Ralph and Fred a couple of seconds to respond
Fred: "Uh..unit testing is industry best practice. There is scientific evidence that prove testing reduces bugs and increases code quality"
Ralph: "Over 90% of our deployments are rolled back because of bugs. Unit testing will eliminate that."
Me: "Sorry, I disagree."
- Stepping on kittens wouldn't have gotten a worse look from Fred and Ralph
Fred: 'Pretty sure if you ask any professional developer, they'll tell you unit testing and code coverage reduces bugs.'
Me: "I'm not asking anyone else, I'm asking you. Find one failed deployment, just one, over the past 6 months that unit testing or code coverage would have prevented."
- good 3 seconds of awkward silence.
Ralph: "Well, those rollbacks are all mostly due to server mis-configurations. That's not a fair comparison."
Me: "I'm using your words. Unit tests reduces bugs and lack of good tests is the direct reason why we have so many failed deployments"
Boss: "Yea, Ralph...you and Fred kinda said that."
Fred: "No...we need to write good tests. Not this mess."
Me: "Like I said, show me one test you've written that would have prevented a rollback. Just one."
Ralph: "So, what? We do nothing?"
Me: "No, we have to stop worshiping this made up 80% code coverage idol. If not, developers are going to keep writing useless test code just to meet some percent. If we wrote device drivers or frameworks for other developers maybe, but we write CRUD apps. We execute a stored procedure or call a service. This 80% rule doesn't fit for code we write."
Fred: "If the developers took their head out of their ass.."
Me: "Hey!..uh..no, they are doing exactly what they are being told. Meet the 80% requirement, even if doesn't make sense."
Ralph: "Nobody told them to write *that* code."
Boss: "My gosh, what have you and Fred been complaining about for the past hour?"
- Ralph looks at his monitor and brilliantly changes the subject
Ralph: "Oh my f-king god...Trump said something stupid again ..."

At that point I put my headphones on went back to what I was doing. I'm pretty sure Fred and Ralph spent the rest of the day messaging back-n-forth, making fun of me or some random code I wrote 3 years ago (lots of typing and giggling). How can highly educated grown men (one has a masters in CS) get so petty and insecure?

Comments
  • 7
    While I agree that meeting some percentage is not the right goal, unit tests are most definitely not a waste of time. Although I can't tell if you were trolling them or you actually believe it...
  • 1
    @linux-colonel true, but as he said, they're only making simple apps--may i be as bold to call it glorified website wrappers (referring to CRUD)
  • 2
    @AllenII I don't think simplicity is a factor. I write tests for everything I do. If I make a small change, I write a test. Not only do they ensure my code does what it's meant to do, they also document the intended functionality of what they're testing
  • 1
    @linux-colonel TDD or BDD is sexy and there is no other way to put it.
  • 2
    @linux-colonel I was trolling. I get extremely frustrated when the monday-morning-quarterbacks constantly spout unit testing equals quality code. It does not. Tests can be (and usually are) just as crappy as the code being tested.

    I get an un-healthy amount of joy when I confront our quarterbacks by challenging them to back up their rhetoric with code. Aahh..the sweet sight of someone squirming in their seat, stumbling over 'um..uh...um...if you google unit testing...'
  • 1
    @linux-colonel i won't deny that you're right. I've been trying to get into TDD myself, but haven't found a good definitive guide that explains how to do it properly (this fact didn't affect my pevious comment). I'm just saying it was much overhead for something small.
Add Comment