From the course: Programming Foundations: Beyond the Fundamentals

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Creating a test case

Creating a test case

- I have an important meeting in the morning, so I need to set my alarm clock. Before I go to sleep, I want to make sure the alarm clock is going to wake me up, so I'll temporarily change the alarm to right now. Now, I heard a click, but nothing else happens and that is not going to wake me up. So I check a few things. Well, the alarm is turned on, the hands are lined up. Oh, there's no battery, so let me rectify that. (alarm beeping) And now the alarm works. So now, I know my alarm clock will do what I need and I can set the alarm and go to sleep. When I've written a program that performs as I expect and my interpreter doesn't report any bugs, it can still be helpful to do a little more testing. Especially for more complex code, it can take multiple tests planned out in a thoughtful way to ensure that I'm actually testing all of the possible use cases and every line of my code in all of the possible combinations. To…

Contents