r/shittyprogramming • • Feb 07 '20

Technical Debt Forgiveness Thread

There has been a lot of news lately about non-profits forgiving different types of debt (for instance medical debt) on behalf of people. So me and the /r/shittyprogramming mods would like to forgive your technical debt!

Whether you borrowed a function from a friend or have a technical jumbo mortgage you are under water on - we can help!

Simply list your debt in this thread, and you will be granted immunity from any repercussions.

190 Upvotes

45 comments sorted by

View all comments

Show parent comment

29

u/calsosta Feb 07 '20

I DECLARE FORGIVENESS.

Also, you should clone the tests and make them "negative" and say you have doubled coverage.

12

u/shatteredarm1 Feb 07 '20

Maybe I can automated the creation of unit tests

function aPlus3(a){
   return a+3;
}

Unit test:

describe("aPlus3", function() {
   //1000 unit tests
   for(let i = 0; i < 1000; i++){
      it(`calculates ${i}+3`, () => {
         expect(aPlus3(i)).toBe(i+3);
      }
   }
}

1

u/veni_vedi_veni Mar 03 '20

That's not "a + 3", that's "i + 3"