[TIP] Long time Lurker propose TIP talks for Pycon APAC

Mark Mc Mahon mark.m.mcmahon at gmail.com
Fri Apr 8 17:57:10 PDT 2011


Hi,

I just submitted the following talk proposal for the APAC Pycon that
will be in Singapore in June.

I have used Tox and Coverage - but other than that I use Unittest for
most of my testing needs so hoping the talk improves my testing IQ.

Suggestions welcome :)

Thankful to Python, testing and you guys :)  (bit too much saccharine
there maybe?)
 Mark

Introduction:
   * What is testing
   * Why Test
   * How to get started & test
   * Helpful modules
   * Test Drivin Development

What & Why:
During this talk I will cover briefly what testing is and why it is a
good idea to do it.
There are many benefits to testing: your code is correct; does what
you want it to do.
A very important point for tests are that they and allow you to change
your code with confidence.
There are a number of common reasons people give for not testing. I
will try and explain why they are raised and some techniques to get
started or overcome the reluctance to test.

How:
The talk will mainly cover how to use the unittest module (from the
Python Standard Library) to test your code.
How you can use mock objects to replace slow things or things that you
don't want to mess up during testing.
The coverage module can show you how much of your code has been
covered and increase your motivation to add more tests.
There is a rich set of modules for testing in Python:
   * py.test, Nose - test runners and help in writing tests
   * Tox - run your tests on multiple python versions
   * Fudge, mock - support for writing Mock objects
   * and many more

Test Driven Development (TDD)
TDD has it's proponents, and it's detractors. It is done differently
by different people.
TDD is writing your test first and writing your code 2nd.
It makes sure you write tests for all the requierments and can help
define a program structure that is more cohesive and less coupled
(i.e. good design).

Summary:
   * Test!
   * Start small and work up
   * Use as many tools as you want to make it easy.
   * Try TDD



More information about the testing-in-python mailing list