7
Rabb
8y

When explaining unit testing:

"We tried but every time someone changes something in the database all the tests fail."

*facepalm*

Comments
  • 3
    Well, at least they tried...

    Besides, when I started unit testing, I was also setting up test databases and adding unnecessary overhead.

    Then I had another brilliant developer explaining me what unit testing really is and the concept of stubbing and mocking.

    Now, 1.5 year later, my unit tests only test single units, my integration tests are set up with the bare minimum, and my end-to-end tests get setup prior before every test with a bare test database with laboratory-like entries to test and validate all kind of situations.

    My point is, if you see someone doing something the wrong way, don't facepalm, but teach and let them grow.

    Unless they don't give a sh!t about you sharing your precious knowledge with them. Then, you know, fudge 'em.
  • 0
    @kanduvisla I agree when they really don't know. I should have prefaced this with this came from lead/senior developers who said they did unit testing and didn't want to do it because of "issues" like the one mentioned.
  • 0
    Just have the set of unit tests dependent on the database and another set that are not
  • 1
    @jw56578 yes, those are called integration tests
  • 0
    Damn that's not very lead nor senior...
Add Comment