Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Khorne
May 1, 2002

Bruegels Fuckbooks posted:

b) For unit tests, YMMV, but getting 100% code coverage is an extremely optimistic goal and a waste of time imo. I would say a good rule of thumb is to get your codebase into a condition where you could potentially write unit tests that represent any problem, unit test public interfaces of components only, and use the unit tests as examples of a) how to use the component, b) a way of automating the regression testing (as if all bugs can be represented as unit tests, then if you can write unit tests to represent the bugs, you can stop regressions.) It might be better to see if you can mandate having unit tests for every bug fix instead of an arbitrary code coverage requirement.
I'd suggest also explicitly writing unit tests for things that are subject to edge cases that only "you" are going to know about. It's like a comment in the code that forces you to read and understand it.

Lots of bugs get introduced when someone who doesn't have insight into the original purpose of code changes that code to fix another bug and doesn't consider its effects in an edge case. Occasionally, that "someone" is you: the person who wrote the code a while ago.

Khorne fucked around with this message at 20:11 on Jul 11, 2018

Adbot
ADBOT LOVES YOU

  • Locked thread