Lecture 2 - The Purpose of Testing -> Quick Intro -> Exposing Misconceptions -> How To Make Use Of Stats For Post-Release Bugs
There are 2 misconceptions associated with the purpose of testing which you should be aware of, because they are widespread and harmful.
Misconception #1: “Testers must make sure that 100% of the software works fine.”
Here is Spec #1522:
1.0. Program froggy.py accepts user input.
1.1. Text of prompt for input: “What animal do you like more: frog or cat?”
1.2. If input is either “frog” or “cat”, the program must print on screen: “<user input> is a great animal”.
1.3. If user enters nothing and just presses “Enter” the program should print message: “You did not type anything”.
1.4. In all other cases the message should be “You did not enter the expected word”.
Here is a code of froggy.py written in Python (the text after # is a comment for the current line of code):
user_input = raw_input('What animal do you like more: frog or cat?') #Display a prompt for text input. animal_list = ['frog','cat'] #this is a list of 2 words one of which is expected to be entered if user_input in animal_list: #if user entered word that matches any element inside animal_list print user_input + ' is a great animal' elif user_input == '': #if user entered nothing and just pressed Enter print 'You did not type anything' else: #in all other cases print 'You did not enter the expected word'
Let’s list the four possible inputs:
Lecture 2 - The Purpose of Testing -> Quick Intro -> Exposing Misconceptions -> How To Make Use Of Stats For Post-Release Bugs