Notification bell This series has been archived.
A series is marked as archived when the content is no longer up-to-date or relevant to most viewers.
Back Button Testing
Code Katas with PHPSpec

Code Katas with PHPSpec

If martial artists use kata as a method for exercise and practice, what might be the equivalent for coders, like us? Well, code katas are short, repeatable programming challenges, which are meant to exercise everything from your focus, to your workflow.

Intermediate
7 episodes
2:36:09 hrs
7
Latest Episode in This Series

Added 4 years ago

Small Refactors and the Gilded Rose

In this lesson, we'll tackle the intimidating Gilded Rose kata in PHP. Our job is to...

Watch
Code Katas with PHPSpec

Code Katas with PHPSpec

If martial artists use kata as a method for exercise and practice, what might be the equivalent for coders, like us? Well, code katas are short, repeatable programming challenges, which are meant to exercise everything from your focus, to your workflow.

Begin
7
Latest Episode in This Series

Added 4 years ago

Small Refactors and the Gilded Rose

In this lesson, we'll tackle the intimidating Gilded Rose kata in PHP. Our job is to translate...
Watch

Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.
    1. EPISODE 1

      Run Time 19:08

      Free

      In the first episode in our "Code Kata" series, we'll tackle the prime factors challenge. We must use TDD to build a class that will compute the prime factors for any given number.

      View the source for this episode on GitHub, and, if you want to autotest your code, refer to this lesson.

    2. EPISODE 2

      Run Time 16:23

      In our next practice session, we need to build a class that will automatically translate a number into its roman numeral counterpart. As with the previous episode, we'll use TDD and PHPSpec to drive this process.

      Homework: what would happen if the user passed 0 to our converter? Shouldn't we take exception to that? On your own, implement this functionality using TDD.

      View the source for this lesson (and the homework solution) on GitHub.

    3. EPISODE 3

      Run Time 24:31

      In this code kata, we need to recreate the scoring system for a game of bowling. Does that sound tough? How do we deal with scoring spares, or strikes, or multiple strikes!? Well, if we use TDD to work toward our goal, it shouldn't be too tough. Let's dig in.

      View the source for this kata on GitHub.

    4. EPISODE 4

      Run Time 16:04

      In this Kata, we need to build a string calculator class; however, there are a number of rules and gotchas related to how we perform the addition. Using PHPSpec once again, let's tackle this challenge.

      View the source for this lesson on GitHub.

    5. EPISODE 5

      Run Time 30:27

      Let's tackle the tennis scoring kata. If you're familiar with the game, you'll know that the rules can be a bit tricky. As such, this will make for a great exercise!

      View the source for this code kata on GitHub.

    6. EPISODE 6

      Run Time 9:34

      Free

      Now that you've worked your way through a number of code kata challenges, let's review the obligatory FizzBuzz exercise, and learn just how easy it is to solve.

    7. EPISODE 7

      Run Time 40:02

      In this lesson, we'll tackle the intimidating Gilded Rose kata in PHP. Our job is to translate a monstrously confusing set of countless conditionals into a small series of readable methods. Work along with this lesson, and you'll benefit greatly.

      View the slightly altered setup and solution (see second branch) for this lesson on GitHub.