Tag Archives: TDD

Python Code Kata: Fizzbuzz

A code kata is a fun way for computer programmers to practice coding. They are also used a lot for learning how to implement Test Driven Development (TDD) when writing code. One of the popular programming katas is called FizzBuzz. This is also a popular interview question for computer programmers.

The concept behind FizzBuzz is as follows:

  • Write a program that prints the numbers 1-100, each on a new line
  • For each number that is a multiple of 3, print “Fizz” instead of the number
  • For each number that is a multiple of 5, print “Buzz” instead of the number
  • For each number that is a multiple of both 3 and 5, print “FizzBuzz” instead of the number

Now that you know what you need to write, you can get started! Continue reading Python Code Kata: Fizzbuzz

Python 102: An Intro to TDD and unittest

Python code testing is something new to me. It’s not required where I work, so I haven’t spent much time looking into it, besides reading a book on the subject and reading a few blogs. However, I decided it was high time I check this out and see what all the excitement is about. In this article, you will learn about Test Driven Development (TDD) with Python using Python’s builtin unittest module. This is actually based on my one experience of TDD and pair programming (thanks Matt and Aaron!). In this article, we will be learning how to score bowling with Python! Continue reading Python 102: An Intro to TDD and unittest