At the end of this set you will have the necessary knowledge to write your own unit-tests, allowing you to be confident that your code runs (and fails) in the right way - this is a key software development practice.
  Ending Frustration through How-To Videos!
594 how-to Videos    |    405 how-to Categories     |   17 how-to Comments 

ShowMeHow    |  Categories  |    Search   |  Subscribe  {RSS/XMLForum  |  TagsAsk / Add Video    

Email How to Write Unit Tests for Dependable Code to a friend

How to Write Unit Tests for Dependable Code

codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="450" height="350"> value="https://www.showmehowtodothis.com/player.swf"> value="high"> value="path=https://https://208.109.0.142/ShowMeDos/NotAuth.flv"> height="350" quality="high"
pluginspage="https://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" flashvars="path=https://https://208.109.0.142/ShowMeDos/NotAuth.flv">

Recent How to's Related to the Activities and Applications category

How to Download and Install wxPython

How to use the Textpad Editor in IPython

How to Use GeoSense to Learn Geography

How to Add JPEG, GIF, or Other Pictures to a Power Point Show

How to Share Word Documents Via the Internet


See all How-To's in the Activities and Applications category
 
You can also subscribe and get How to's from the Activities and Applications category right in your inbox.

We keep your info private.

Add comments for "How to Write Unit Tests for Dependable Code"
Email How to Write Unit Tests for Dependable Code to a friendEmail How to Write Unit Tests for Dependable Code to a friend

Testing programs is tedious - but very necessary! Testing lets us trust our code - and unit-tests (via 'nosetests') make the task of writing tests super-easy. We should all be writing unit-tests with our code.

This is a paid-for series, buy access to all 1 hour 47 minutes of the series via lulu.com. Cost: £5 GBP (approximately $10 US, 8 Euro). 10% of the purchase price will be reserved as a donation to the Python Software Foundation (link). We offer a 100% refund within 30 days of purchase if you are unhappy with the series (no questions asked).

Here we use the excellent 'nosetests' to adopt a test-driven approach to coding, allowing us to build our confidence that our code is working exactly as we want it to. If you don't have nosetests yet, see Installing Nosetests in the wiki.

We build 'checkNumbers.py' and a corresponding unit-test module 'testCheckNumbers.py' (source code in the wiki) that confirms that our program - written to parse a file of numbers and check that the numbers match our specified criteria - passes all the tests and only accepts the kind of numbers that we are after.

We use boolean conditions and exception handling to robustly parse the file of numbers, along with commenting our code and using sensible variable names. One of the nice features of TDD is writing tests before we have the corresponding features in our program, watching the tests fail, then filling in the necessary code in the program to pass the tests (hence test *driven* development). This is a very satisfying approach to coding.

I end the video giving a perspective on just how many unit-tests you should be writing to sensibly test your code. Additionally you should watch Jeff Winkler's ShowMeDo on the nosey automatic test runner after you've watched this video (don't forget to leave him a Thank-you comment!).

At the end of this set you will have the necessary knowledge to write your own unit-tests, allowing you to be confident that your code runs (and fails) in the right way - this is a key software development practice.

If you want more details see this worked-example at DiveIntoPython and this nose write-up. For some more background, see wikipedia for entries on Unit Testing and Test Driven Development (TDD).

Having reached the end of this series, come join me in the forum for questions, tasks and to let me know what you'd like me to cover in a future set.

See more from these categories:
 Activities and Applications [xml]
 Computers [xml]
 Technology [xml]
 Windows [xml]
See more how-to's related to:





BookMark How to Write Unit Tests for Dependable Code to your favorite site(s) below
del.icio.us | Digg it | Yahoo MyWeb | Onlywire | Email to a friend

See other How-To's about:
 Get email updates from the Activities and Applications category. Activities and Applications [xml]
 Get email updates from the Computers category. Computers [xml]
 Get email updates from the Technology category. Technology [xml]
 Get email updates from the Windows category. Windows [xml]

To subscribe by email to a category above, click the next to it.
Bookmark (How to Write Unit Tests for Dependable Code) to your favorite site(s) below
Email How to Write Unit Tests for Dependable Code to a friend add to Digg add to Del.icio.us add to Wist add to Spurl add to Simpy add to Reddit add to Newsvine add to Furl add to Fark add to Blinklist add to Yahoo add to Comments add to Smarking add to Shadows add to Scuttle add to Rawsugar add to Netvous add to Magnolia add to linkagogo add to feedmelinks add to delirious add to connotea add to blogmarks add to blinkbits add to tailrank
 
Our most recent HowTo Video additions:

How to Blend Face Make-Up into the Neck


How To Use Toning for Oily Skin


How to use Toning for Combination Skin


How to use SPF Protection for Oily Skin


How to Moisturize the Neck for Oily Skin


How to Moisturize the Lips for Oily Skin


How to Moisturize the Face for Oily Skin


How to Moisturize the Eye Area for Oily Skin


How to Choose and Use Facial Masks for Combination Skin


How to Perform Skin Care On the Go for Oily Skin


If How to Write Unit Tests for Dependable Code is your video, and you believe it's here without your consent, please refer to our DMCA policy.

Add your thoughts for How to Write Unit Tests for Dependable Code

(If you haven't left a comment here before, you may need to be approved by TellMeHowToDoThis.com before your comment will appear. Thanks for being patient!)

 

 

 

About  |  Blog  |  Win Money  |  FAQ | Contact / JV or Affiliate / Ads | SiteMap | TOS / Privacy / DMCA / GNU