<story><title>Unit testing anti-patterns: Structural Inspection</title><url>https://enterprisecraftsmanship.com/2016/07/21/unit-testing-anti-patterns-structural-inspection/</url></story><parent_chain></parent_chain><comment><author>sudhirj</author><text>The reduction to absurdity is tests that essentially parse the code they&amp;#x27;re testing and assert the AST.&lt;p&gt;Any unit test should really be from the point of view of checking what the code &lt;i&gt;does&lt;/i&gt;, as opposed to checking what code was &lt;i&gt;written&lt;/i&gt;.&lt;p&gt;Structural tests by definition don&amp;#x27;t check what the code does - they&amp;#x27;re way to parse the code and check the AST is structured a certain way.</text></comment>
<story><title>Unit testing anti-patterns: Structural Inspection</title><url>https://enterprisecraftsmanship.com/2016/07/21/unit-testing-anti-patterns-structural-inspection/</url></story><parent_chain></parent_chain><comment><author>slaymaker1907</author><text>Kind of specific, but I find that in the React world, Enzyme is worse than useless for the same reasons as mentioned in this article. The tests you end up writing just verify your XML (which generally has little to no value). Even if there is some tricky logic which needs testing, you can pretty much always just refactor your code a little bit and just use standard unit tests.</text></comment>