Nnoemis / Test1

0 stars 0 forks source link

6. Check visitor’s age and print appropriate message #6

Open Nnoemis opened 1 year ago

Nnoemis commented 1 year ago

As a QA engineer you often will be assigned to check if certain business logic is correct. Your company develops a special machine (hardware + software), designed to be put at the entrance of a bar, where people come for a drink. The machine should check the age of people when they try to enter and tell them, if they are allowed to walk in.

You are assigned to test the machine, which reads the personal ID card, extracts the age of the person from it (integer number), and displays appropriate message to each visitor, based on the age. The machine opens the door when the person is allowed to enter the bar.

By design the machine should implement the following logic:

Check visitor’s age and print appropriate message -- If age > 0, and age < 18, then print “You are too young to visit our bar“. The door stays closed.  If age > 18, then print “Welcome to our bar. Enjoy!” and the door opens.  Otherwise, print “Invalid age. Please try again“.

Do you find any issues in the above logic?

What is the mistake (error) in the above logic?

How do we call the situation when we have a wrong logic in the code? Name it.

What will be the result, if we run the code, which implements the wrong logic?

 

 

 

What is the mistake (error) in the above logic? – There isn`t a equal = 18.

How do we call the situation when we have a wrong logic in the code? Name it. – Bug

What will be the result, if we run the code, which implements the wrong logic? – The machine will not allow people who are at 18. We will lost clients.

Test if the machine can recognize false ot fake ID.