<story><title>Why Most Unit Testing is Waste (2014) [pdf]</title><url>http://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf</url></story><parent_chain><item><author>gaius</author><text>In OCaml (or any similar language) 95% of what you &amp;quot;unit test&amp;quot; for in Javascript just goes away.&lt;p&gt;If people cared about software quality, they would use strongly typed languages before even thinking about &amp;quot;unit tests&amp;quot;. What people &lt;i&gt;actually&lt;/i&gt; want is a) to hack it out quickly and b) to have a lot of busywork to do as a form of job security. Hence 50,000 lines of &amp;quot;unit tests&amp;quot; per 10,000 lines of application...</text></item><item><author>avip</author><text>Ok let&amp;#x27;s stop writing UT and see what happens. Wait... we&amp;#x27;ve already tried that, and we know the result pretty well:&lt;p&gt;1. In dynamic languages, simple type mismatches, wrong variable names etc. are now caught in &amp;quot;top level system level test&amp;quot;. Yes these are bugs that should have been caught by a compiler had we had one.&lt;p&gt;2. There&amp;#x27;s no documentation as to how something should work, or what functionality a module is trying to express.&lt;p&gt;3. No one dares to refactor anything ==&amp;gt; Code rottens ==&amp;gt; maintenance hell.&lt;p&gt;4. Bugs are caught by costly human beings (often used to execute &amp;quot;system level tests&amp;quot;) instead of pieces of code.&lt;p&gt;5. When something does break in those &amp;quot;top level system tests&amp;quot;, no one has a clue where to look, as all the building blocks of our system are now considered equally broken.&lt;p&gt;6. It&amp;#x27;s scary to reuse existing modules, as no one knows if they work or not, outside the scope of the specific system with which they were previously tested. Hence re-invention, code duplication, and yet another maintenance hell.&lt;p&gt;Did I fail to mention something?&lt;p&gt;UT cannot assert the correctness of your code. But it will constructively assert its incorrectness.</text></item></parent_chain><comment><author>pmoriarty</author><text>Sorry to be pedantic, but I just have to point this out, since the mistake is made over and over again in this thread:&lt;p&gt;It&amp;#x27;s not about strongly vs weakly typed languages, but statically vs dynamically typed languages.&lt;p&gt;OCaml is &lt;i&gt;statically&lt;/i&gt; typed.  Javascript and Python are &lt;i&gt;dynamically&lt;/i&gt; typed.&lt;p&gt;What you are talking about are benefits of &lt;i&gt;statically&lt;/i&gt; typed languages.&lt;p&gt;For more information, please see:&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;blogs.perl.org&amp;#x2F;users&amp;#x2F;ovid&amp;#x2F;2010&amp;#x2F;08&amp;#x2F;what-to-know-before-debating-type-systems.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;blogs.perl.org&amp;#x2F;users&amp;#x2F;ovid&amp;#x2F;2010&amp;#x2F;08&amp;#x2F;what-to-know-before...&lt;/a&gt;</text></comment>
<story><title>Why Most Unit Testing is Waste (2014) [pdf]</title><url>http://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf</url></story><parent_chain><item><author>gaius</author><text>In OCaml (or any similar language) 95% of what you &amp;quot;unit test&amp;quot; for in Javascript just goes away.&lt;p&gt;If people cared about software quality, they would use strongly typed languages before even thinking about &amp;quot;unit tests&amp;quot;. What people &lt;i&gt;actually&lt;/i&gt; want is a) to hack it out quickly and b) to have a lot of busywork to do as a form of job security. Hence 50,000 lines of &amp;quot;unit tests&amp;quot; per 10,000 lines of application...</text></item><item><author>avip</author><text>Ok let&amp;#x27;s stop writing UT and see what happens. Wait... we&amp;#x27;ve already tried that, and we know the result pretty well:&lt;p&gt;1. In dynamic languages, simple type mismatches, wrong variable names etc. are now caught in &amp;quot;top level system level test&amp;quot;. Yes these are bugs that should have been caught by a compiler had we had one.&lt;p&gt;2. There&amp;#x27;s no documentation as to how something should work, or what functionality a module is trying to express.&lt;p&gt;3. No one dares to refactor anything ==&amp;gt; Code rottens ==&amp;gt; maintenance hell.&lt;p&gt;4. Bugs are caught by costly human beings (often used to execute &amp;quot;system level tests&amp;quot;) instead of pieces of code.&lt;p&gt;5. When something does break in those &amp;quot;top level system tests&amp;quot;, no one has a clue where to look, as all the building blocks of our system are now considered equally broken.&lt;p&gt;6. It&amp;#x27;s scary to reuse existing modules, as no one knows if they work or not, outside the scope of the specific system with which they were previously tested. Hence re-invention, code duplication, and yet another maintenance hell.&lt;p&gt;Did I fail to mention something?&lt;p&gt;UT cannot assert the correctness of your code. But it will constructively assert its incorrectness.</text></item></parent_chain><comment><author>piva00</author><text>This is very patronizing, you&amp;#x27;re not better than some other developer because you fell in love with OCaml or similar strongly-typed languages.&lt;p&gt;I don&amp;#x27;t think this kind of criticism is healthy, you&amp;#x27;re trying to live on top of your ivory tower calling out everyone else who isn&amp;#x27;t like you as lazy and looking for job security, you really do think there&amp;#x27;s no other reason for people using languages that you aren&amp;#x27;t so fond of?&lt;p&gt;Honest question, because this kind of message is just unnecessary aggression.</text></comment>