topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 6:16 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Unit Testing - Do you do it? If so, how?  (Read 3394 times)

mnemonic

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 177
    • View Profile
    • My website
    • Donate to Member
Unit Testing - Do you do it? If so, how?
« on: April 11, 2009, 11:03 AM »
I'm a "gradually improving" newbie developer and currently have a fairly blasé and ad-hoc approach to testing.  Having done a bit of reading, it seems that the next thing to learn is unit testing.  However, although I get the principle (ensuring that code changes don't break the overall code), I don't really understand how unit testing is done - especially around unit testing frameworks.

If you're writing your own applications at home, do you use unit testing?  If so, how do you do it?  Is this just a list of tests and values to use in those tests, or do you employ a more automated method?  (Any references to how to do this in python will be given extra points).

Thanks.

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Unit Testing - Do you do it? If so, how?
« Reply #1 on: April 12, 2009, 03:27 PM »
I want to do TDD on every project, but I am not there yet. I am a Python coder so I can tell you that TDD is very easy in Python and it is almost universally practiced by the major coders and projects.

The best list of testing tools for Python is at:
http://pycheesecake....TestingToolsTaxonomy

I use nose and find it easy to use.

Hmm, what to suggest for getting started is tough to say. If you are willing to lay out some money, I would suggest the book Expert Python Programming. It is an excellent book and has some good introductory information on unit testing in Python.

Dive Into Python has a good chapter on Unit Testing.

I haven't read this, but it looks like a good introduction.

mnemonic

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 177
    • View Profile
    • My website
    • Donate to Member
Re: Unit Testing - Do you do it? If so, how?
« Reply #2 on: April 12, 2009, 04:05 PM »
Fantastic, thanks Tinjaw.  I'll start to work through the links.

I've also found the following general introduction to unit testing, which I'm currently working through:

Testing 101