Some of my favorite experiences with learning about testing is is do exercises where there are known bugs. Somehow, knowing that the bugs exist, and my challenge is to find them, is energizing. That is probably a good mindset to have when approaching testing in the first place. There are always bugs…
I created a couple of modules, called bugPractice, with intentional bugs for you to practice your skills. There are likely more bugs than what I purposely put in, maybe you will find those as well.
The first module is a classic testing interview question, test a palindrome checker. The function is called is_palindrome and it takes a single string. It returns True if that string is a palindrome. Otherwise, it returns False. I put in 5 bugs. If you find all 5, congratulations. If you find more, well, shame on me. Here is the happy path execution for is_palindrome:
The second module is an implementation of a very simple stack data structure. A stack simulates a stack in the real world, you can add items on top of the stack (push action), or pull items off the top of the stack (a pop). Here is the transcript for the stack happy path:
These use Python, my favorite language. If you need to brush up on your Python, I recommend a couple of resources. First, a software testing class from Udacity uses Python to teach testing fundamentals. Second, Codecedemy’s class on Python teaches the fundementals of the language.
The most simple way to get started, download the archive, unzip it, then invoke Python interactive from that folder and follow the transcripts above to get started.