[TIP] Talking to a test-is-from-outer-space crowd

Alfredo Deza alfredodeza at gmail.com
Mon Apr 11 14:18:53 PDT 2011


Hi list!

I while ago I asked here about why should someone bother with tests [0] and
you all replied with
awesome answers that allowed me to pack a good set of slides for my
presentation
later that week.

The talk was in Spanish and it was titled (translated): "Testing in Python:
if it doesn't work, who do we blame?" [1]

So I wanted to give you an overview of what happened and how did the crowd
reacted
to what testing is supposed to accomplish and why you should implement them.

I want to emphasize that this was a mixed crowd of non-testers and
non-test-believers,
so I knew the task at hand (giving them good reasons on why to test) was
going to be *very* difficult. I'm almost
certain that the actual percentage of test-believers was less than 1% (!).

It was extremely difficult to place myself in the crowd's shoes about
not-testing. I wanted to give them a great
impression about the usefulness of testing and get them somewhat interested
in the subject in a worse-case
scenario.

The presentation was as high-level and optimistic as I could make it. It
covered things like automating "manual"
tests (e.g. checking terminal output) and having better client relationships
because you can verify that most
of your code works as expected before shipping out products.

Most of the slides were visual with little content (I despise bullet points
with lots of text) so I have not uploaded
them anywhere (they were also in Spanish). But they all were there to make a
point, and double underline the idea
that you can't be a good programmer if you think tests are not the way to
write code.

There was some family and friends in the crowd and after the presentation
they told me they heard comments like:

* that makes sense
* yeah, can't be expecting the client to find errors
* debugging is easier?

Most importantly, I liked the "that makes sense" phrase. 80% of the
presentation were punch-lines about testing
so that was one of the primary goals.

A big part of the crowd were college students and it was my impression that
testing is not being taught at all as
part of the CS or CS-related courses.

I believe that testing is hard. Specially when you are just starting. There
are a lot of open ended questions and if you
are just starting out with Python or programming in general UnitTest is a
big hurdle (e.g. explaining class inheritance to
someone who has barely seen classes).

But programming is hard too. So it shouldn't matter that UnitTest *might* be
difficult to grasp. If you want to get better
you might as well get used to learning things that are not easy to
understand at first.

I finished my presentation asking the crowd to go back to their code and
write a single test. Just one. And this one test
should replace whatever thing they were doing manually before. If they can
write a single test and watch it pass they
can be motivated in writing another one.

Baby steps into testing!

Let me finish by saying (again) THANKS! for all the awesome answers. It
definitely helped a lot in trying to show what
testing can do for you and your code and why it is utterly important to
bother with it.



[0]
http://lists.idyll.org/pipermail/testing-in-python/2011-March/003959.html
[1] The title was a trick question: you can't blame anyone if you do not
know who broke the test(s) with the last commit :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20110411/e4f77fd4/attachment.html>


More information about the testing-in-python mailing list