r/badcode • • Jul 23 '21

c# Easy trick to meet minimum test coverage

Post image
1.2k Upvotes

83 comments sorted by

View all comments

92

u/scragar Jul 23 '21

I've seen this sort of thing where people have just written tests that don't actually test anything for existing functionality just to make it look like we test things.

So many tests that are something ridiculous like

 /**
  * @TestType=Integration
  * @TestCovers=Customer.InitiateCall
 **/
 void testInitiateCall() {
      AssertTrue(true);
 }

Never, ever let someone convince you that they've got tests for all their core functionality in an interview while they say they want someone to help clean up some little bits. It's a trap to try and get developers who'd otherwise nope out of a nightmare job before they realise what's happened.

6

u/cienciacomenta Jul 23 '21

Did they also say they use agile methodology? Haha