I’m a part of a large software project which is supposed to use TDD. There are maybe 90 devs across the world. Upon review of for software components, I determined that a significant number of are meaningless. They do something along the lines of :

  • Set true value on mock object, and check if it is true
  • Set up mock object, expect some behavior to NOT happen, then call some unrelated method. Of course the default value of the variable remains false – the did not touch it
  • Test description conflicts with the actual actions of test logic ( description says “disabled”, but the test logic passes “enabled”)

On paper, it seems like there are integration tests and tests. In reality, quite a lot of them are blatantly . Due to the large team size, I expect people would keep writing such garbage tests.

How do I deal with low quality unit tests?
What can I do advocate for culture change?
How can I help enforce that junior devs don’t write garbage tests for critical system components?



Source link https://sqa.stackexchange.com/questions/35360/how-to--fake-unit-tests-that-don-t-really-test-anything

LEAVE A REPLY

Please enter your comment!
Please enter your name here