<story><title>Questions to ask yourself when writing tests</title><url>https://charemza.name/blog/posts/methodologies/testing/questions-to-ask-yourself-when-writing-tests/</url></story><parent_chain><item><author>discreteevent</author><text>&amp;quot;consider instead writing higher level tests that each each test more of the code.&amp;quot;&lt;p&gt;I really like the way they keep repeating this as the answer to so many questions. To me it reads as a softly softly approach to weaning people off what appears to be a mania for micro level unit testing, driven by people like Uncle Bob.</text></item></parent_chain><comment><author>Ace17</author><text>&amp;gt; ... micro level unit testing, driven by people like Uncle Bob.&lt;p&gt;&amp;quot;The structure of your tests should not be a mirror of the structure of your code. The fact that you have a class named X should not automatically imply that you have a test class named XTest.&amp;quot;&lt;p&gt;&amp;quot;The structure of the tests must not reflect the structure of the production code, because that much coupling makes the system fragile and obstructs refactoring. Rather, the structure of the tests must be independently designed so as to minimize the coupling to the production code.&amp;quot;&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;blog.cleancoder.com&amp;#x2F;uncle-bob&amp;#x2F;2017&amp;#x2F;10&amp;#x2F;03&amp;#x2F;TestContravariance.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;blog.cleancoder.com&amp;#x2F;uncle-bob&amp;#x2F;2017&amp;#x2F;10&amp;#x2F;03&amp;#x2F;TestContrava...&lt;/a&gt;</text></comment>
<story><title>Questions to ask yourself when writing tests</title><url>https://charemza.name/blog/posts/methodologies/testing/questions-to-ask-yourself-when-writing-tests/</url></story><parent_chain><item><author>discreteevent</author><text>&amp;quot;consider instead writing higher level tests that each each test more of the code.&amp;quot;&lt;p&gt;I really like the way they keep repeating this as the answer to so many questions. To me it reads as a softly softly approach to weaning people off what appears to be a mania for micro level unit testing, driven by people like Uncle Bob.</text></item></parent_chain><comment><author>seanwilson</author><text>The argument I get against this is that when a higher level test fails, it&amp;#x27;s harder to locate the lines of code that broke the test unlike when you have lots of unit tests. I don&amp;#x27;t find this convincing though. Most of the time it&amp;#x27;s going to be pretty obvious looking at what lines of code have changed since the last working commit. Lots of projects get by without any tests at all as well. I&amp;#x27;m not saying to skip testing completely but it comes as a cost and you need to be practical at weighing up how much time to put into it vs how much time you&amp;#x27;re going to save. Writing unit tests for everything takes time.</text></comment>