<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Aug 1, 2008 at 1:28 PM, C. Titus Brown <span dir="ltr">&lt;<a href="mailto:ctb@msu.edu">ctb@msu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
So, I just posted a reply to someone new (or returning) to Python,<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://ivory.idyll.org/blog/aug-08/reply-to-elanthis.html" target="_blank">http://ivory.idyll.org/blog/aug-08/reply-to-elanthis.html</a><br>
<br>
and one of his complaints was this:<br>
<br>
&quot;&quot;&quot;<br>
The Python gurus recommend unit testing to make sure code is solid.<br>
That&#39;s great. If I wanted to write dozens of lines of boilerplate<br>
code in order to make sure stuff worked, I&#39;d have stuck with C++. I want<br>
to write less code and be confident in the belief that that code is<br>
correct and error free.<br>
&quot;&quot;&quot;</blockquote><div><br></div><div>One interpretation of this comment could be literal. &nbsp;I hate passionately the syntax of the standard library unit test framework. &nbsp;For me, it is indeed, a bunch of boilerplate code, with a Shakespearean English API. &nbsp;All of this, &quot;Where for art though equality...&quot; stuff, is a bit annoying to me. &nbsp;What is wrong with a plain assert?</div>
<div><br></div><div>What makes unit test worst is that people often make custom unit test frameworks that involve non-trivial level of abstraction. &nbsp;I guess I feel like this defeats part of the purpose of testing, which is to show someone how your code work, not design yet another OO masterpiece. &nbsp;Personally I really like doctest because, while it isn&#39;t perfect, it is simple, and easy to understand.</div>
<div><br></div><div>Maybe I am completely misunderstanding what he is complaining about though.&nbsp;</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>

<br>
My response was this:<br>
<br>
&quot;&quot;&quot;<br>
Your take on unit testing seems just plain wrong. I know of no useful<br>
language that can prevent the majority of programming errors without<br>
some form of actually running the code, a.k.a. &quot;testing&quot;. You might<br>
think YMMV, but you&#39;re almost certainly wrong.<br>
&quot;&quot;&quot;<br>
<br>
For some reason, this was the first time I&#39;d really thought of things<br>
this way: &quot;testing&quot; is really just &quot;running the code&quot;, under actual or<br>
likely-to-be actual circumstances. &nbsp;The quality of your test effort can<br>
be measured by how reflective it is of the actual circumstances under<br>
which the code will be used, and the cost of the mismatches.<br>
<br>
Thoughts?<br>
<br>
--titus<br>
<font color="#888888">--<br>
C. Titus Brown, <a href="mailto:ctb@msu.edu">ctb@msu.edu</a><br>
<br>
_______________________________________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Noah Gift<br><a href="http://noahgift.com">http://noahgift.com</a><br>
</div>