TDD

All, Suggestion

 

Test Driven Development is a trend concept nowaways and it’s getting attention even more with the utilization of Python, and its unit test frameworks. I personally use the Unit test framework [1] straight in the command line and sometimes use the watch command to periodically test the code without need to run the script by hand [2]

Steps

TDD is basically divided in the following steps:

  1. Add a test
  2. Add the new test and run seeing if it will fail
  3. Writes the test to pass, i.e. the function that will make it pass
  4. Run again the tests
  5. Refactor the code – i.e. adequate the code to the new needs

Structure

The tests are basied in the follow struture:

  1. setup
  2. execution
  3. validation
  4. clean up

 

[1] https://docs.python.org/2/library/unittest.html

[2] http://www.linfo.org/watch.html

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s