Wow, thanks for the articles, the test contra-variance blew my mind and is probably along the lines of what this article was trying to say (but the article you linked did a better job). Moreover, it really does pair well with article 2 (I can see why you also mentioned it) because article 1 left me with the same question, should we not write tests for the ("extracted") sub-elements at all?
I think most people do some version of both of these without knowing they're doing them (myself included). But what that leads to is incomplete or "messy" test contra-variance, and redundancy.
Reading those both articles gave me a solid understanding how to coding behaviors test:
- Test Contra-variance by Uncle Bob (https://blog.cleancoder.com/uncle-bob/2017/10/03/TestContravariance.html)
- Additional Testing After Refactoring by Kent Beck (https://tidyfirst.substack.com/p/additional-testing-after-refactoring?utm_source=share&utm_medium=android&r=1wkrh0&triedRedirect=true)
Wow, thanks for the articles, the test contra-variance blew my mind and is probably along the lines of what this article was trying to say (but the article you linked did a better job). Moreover, it really does pair well with article 2 (I can see why you also mentioned it) because article 1 left me with the same question, should we not write tests for the ("extracted") sub-elements at all?
I think most people do some version of both of these without knowing they're doing them (myself included). But what that leads to is incomplete or "messy" test contra-variance, and redundancy.
Thanks for the articles, worth the read!