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 tests for software components, I determined that a significant number of tests 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 test variable remains false - the test 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 unit tests. In reality, quite a lot of them are blatantly fake. 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?