[TIP] structure of a testing talk

Jonathan Hartley tartley at tartley.com
Tue Oct 2 06:29:31 PDT 2012

On 02/10/2012 14:16, Jonathan Hartley wrote:
> On 02/10/2012 13:24, andrea crotti wrote:
>> 2012/10/2 andrea crotti <andrea.crotti.0 at gmail.com>:
>>> 2012/10/2 Ned Batchelder <ned at nedbatchelder.com>:
>>>> Andrea, this is helpful to me.  I've proposed a Getting Started 
>>>> Testing
>>>> tutorial for PyCon, and it's great to see how other people tell the 
>>>> story.
>>>> My tutorial is an expansion of a talk I did last year at Boston 
>>>> Python.  You
>>>> can see my slides from that talk at
>>>> http://nedbatchelder.com/text/starttest.html .  I'll accept tweaks 
>>>> to my
>>>> story line too!
>>>> --Ned.
>> Another couple of things which I think are useful and I didn't see are:
>> - pure functions and side effects
>> - why in Python it's even more important than other languages to test
>>    (I'm speaking to C programmers mainly here, so might depend on the
>>    audience). And maybe some examples of how things can go horribly
>>    wrong only at run-time even if there was a clear big mistake in the
>>    code.
>> Apart from that I might steal many ideas, but I only have until 
>> Friday to
>> prepare the talk, so I won't be able to explain everything..
>> Another thing which I will do is to use IPython+Emacs a lot, to show
>> actual live code.
>> And about this a nice little project from PyconUK might also be
>> useful.  This allows you to replay code that you already wrote in an
>> interpreter, in a presentation style, avoid typing but keeps the talk
>> interactive at the same time:
>> https://github.com/inglesp/prescons
>> _______________________________________________
>> testing-in-python mailing list
>> testing-in-python at lists.idyll.org
>> http://lists.idyll.org/listinfo/testing-in-python
> I think I disagree with the idea that testing is more important in 
> Python than it is in other (presumably statically typed) languages. I 
> think it's equally crucial in both. Am I deceiving myself?
> I understand that Python experiences runtime errors which some other 
> languages would have caught at compile time.
> But I don't think this means there are any 'extra' tests that one has 
> to write in Python which one wouldn't write for other languages. The 
> tests don't have to be more strict, nor are they any harder to write 
> (the opposite!) If all tests pass, the program can be deployed, 
> otherwise, it cannot.
> The fact that some test failures cause a runtime error in Python 
> versus a compile time error in C doesn't seem to have any practical 
> impact on this situation.
> Am I'm overlooking something? If so, I'd love to be educated.
> I confess: I'm thinking in terms of old-fashioned 'static typing' such 
> as C, C++, C#, Java. I'm not familiar enough with a modern 
> Haskell-style type system to comment on how that affects things.
> Best regards.
>     Jonathan

I think I answered my own question: I was mentally comparing the 
situation *with* tests for Python versus for other languages. I should 
have been comparing the situations *without* tests. An alien mindset. 
Thanks for being my sounding-board.


Jonathan Hartley    tartley at tartley.com    http://tartley.com
Made of meat.       +44 7737 062 225       twitter/skype: tartley

More information about the testing-in-python mailing list