pumping python: how I solve problems with test driven development


Welcome to Pumping Python, My name is Jacob Itegboje and these are Test Driven Development exercises that helped me use the Python programming language for more than a decade.

I have tried different ways of learning - from books, courses, videos and exercises to working on personal projects. I find that the most effective way to learn is to build something.

Of all the things I tried, the thing that helped me build and learn most effectively was Test Driven Development, which is a way to write software with a focus on tests. I write tests for ideas to reach a goal or meet a requirement, and the results tell me if I am closer to the goal or not. I repeat the process until I get to the goal, which kind of feels like the scientific method.

I find that sometimes when I am working on a project and have an idea, I remember I have a test for that idea in another project and can go back to run it or write a new test.

I recommend Test Driven Development by Example by Kent Beck and Refactoring by Martin Fowler, they both influenced the way I write programs.

who is this for?

how can I use this?

Start with how to make a python test driven development environment because it is required by every other chapter, each chapter suggests the next chapter to do, or you can choose how you go through the chapters based on what you like. You can also go through the how tos section step by step, the other chapters cover errors, data structures, functions, and classes

Here are a few things I would do if I were in your shoes to make the process more fun

  • type out the code portions of a chapter without copying and pasting - this increases your typing speed and helps you see the difference between two things faster

    Tip

    You can take a typing test at https://www.keybr.com/typing-test before and after you go through the book to see how it affects your typing speed

  • at the end of a chapter, delete the tests and try to write them from memory or use the solution as a guide - this builds your memory skills

  • close the tests at the end of a chapter, delete the solution and try to write one with the terminal response as a guide - this helps you build a better relationship with the terminal (your best friend when programming)

  • try to write solutions using the tests from the catalog of tests as a guide - this builds your problem solving skills

  • try adding tests for any ideas I get as I go through a chapter, the sooner you start writing tests the better, since it requires a different way of thinking - this builds your testing skills

  • I would not quit until I get to the end of a chapter, especially when it gets hard, this is part of the experience when learning to solve problems, things get harder before they get easy because there is a lot of failure. I can always walk away to go do something different for a while, then come back and try again - this helps with being able to do hard things

If you take one small step at a time you eventually get where you want to go

Read what other people think about the book here


join a HATCH with other Python Pumpers

If you would like to work with me. I teach this course everyday from Monday to Friday in groups of 5. You can sign up for the 8-week course here


do you like videos?

There are videos for every chapter, check them out here

table of contents


Check out what people have said about the book on TrustPilot