Fizz Buzz Kata


In this video we will cover the FizzBuzz Kata / Fizz Buzz Challenge - whatever you want to call it.

The gist of this Kata is to loop through a given range of numbers, usually one to one hundred, and output Fizz if the number is a multiple of three, output Buzz if the number is a multiple of five, and FizzBuzz if the number is a multiple of both three and five.

Ok, so why on Earth would we want to do this?

Well, firstly, this challenge comes up quite frequently in interview situations - depending on the level of job role you are applying for.

Secondly, it is a very easy and gentle introduction to Test Driven Development - which is kinda what this whole Codeception series has been about.

And thirdly, I think it's fun.

This is the method I usually use when doing training sessions on Codeception in person, and it seems to work quite well. It introduces a lot of the required concepts in an easy to understand, and quick to implement manner.

The one way we are going to differ from the norm here is that we are going to put our FizzBuzz code into a Symfony Service. After all, this is really all about how to use Codeception with Symfony 2.

From there, the rest of the video is a walk through of how to successfully complete this Kata, including re-factoring our code and tests as we go.

To make this even more Symfony specific, we will finish off with how to turn this Service into a usable Symfony Console Command.

Code For This Course

Get the code for this course.

Code For This Video

Get the code for this video.

Episodes