<div><span class="gmail_quote">On 4/25/07, <b class="gmail_sendername">Greg Ewing</b> <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Emin.shopper Martinian.shopper wrote:<br><br>> If you believe that there exist data structures or algorithms where a
<br>> meaningful unit test takes many minutes or hours,<br><br>I wouldn't be worried about spending minutes to save hours<br>later.</blockquote>
<div> </div>
<div>OK, but I would rather not have to spend 10 minutes waiting for a unit test each time I edit a file when I can easily have the test done in seconds at import time.</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">As for unit tests taking hours -- I'm skeptical. Do you<br>know of algorithms that it's provably impossible to test
<br>without it taking hours?</blockquote>
<div> </div>
<div>Imagine you have to query a database and do something with the resulting data. Or imagine some complicated network interaction among p2p clients. Or imagine numerical simulation over a very fine mesh. I've worked on all of these and the unit-tests can easily take long enough that you don't want to run them every time you make any changes.
</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thirdly -- your program can *still* fail after many hours<br>due to one of the many things your static checks don't and
<br>can't cover.</blockquote>
<div> </div>
<div>Of course. I'm not saying ABCs will solve all bugs. What I am saying is that ABCs provide an easy way to catch simple bugs that can sometimes save you a lot of time. Sure you could produce fake data for input to your unit-tests or otherwise contrive things so that you have very quick unit-tests that really only check if things have the right methods. But if you want a quick check that derived classes implement the right methods, I think ABCs are a good solution. At least, they're a solution I find useful. I'm not trying to advocate that you should use them only that they should be available.
</div>
<div> </div>
<div>-Emin</div></div>