Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

36
  • 153
    You do realize that unit tests are, in part, meant to catch those one-in-a-million defects when someone checks in a change to your code that breaks it in some obscure way, right? Unit tests are not just about ensuring that your code is correct now, but also in three years when someone else is maintaining the code you wrote. Commented Feb 5, 2017 at 0:58
  • 192
    @Klik "Real input will never be like this" That is where you are wrong. I have encountered too many cases of "input will never be like this" and being surprised when it was "like this." In a production environment, all sorts of weird things can happen. Do not think only about how your software will work but also how will it fail? Commented Feb 5, 2017 at 1:54
  • 39
    @Snowman More to the point code reviews are, in part, meant to catch those one-in-a-million defects that unit tests and even randomized testing/fuzzing don't find. Commented Feb 5, 2017 at 6:47
  • 12
    It is also worth remembering that code reviews aren't just there to catch problems they are also there for you to learn how you might be able to do better so treat them as a learning opportunity. Commented Feb 5, 2017 at 7:26
  • 74
    hey @Klik, it sounds like the fundamental problem here is you are "scared to speak your mind". NEVER be angry, ALWAYS speak your mind - with a smile. You should have instantly told the guy, "Hmm, that will take me at least two days, is this worth it, let's ask our boss?" and secondly you should have said "Don't forget man we're working on robotics, it's actually not possible for the left sensor to be to the right of the right sensor - let's ask the boss how much anti-physical corner cases we want to cover". Your problem is yours, your problem is you need to swap anger for talk. Commented Feb 5, 2017 at 13:13