I have a program that works as below for addition, and it's the same for all operations. It starts showing this menu:
Enter + for add
Enter - for subtract
Enter * for multiplicaiton
Enter ! for factorial
Enter the operation you want:
Here we can type an operation and click enter. For example if we type "+" we get:
Enter the number of elements to add:
And we can choose any number, for example 2, to sum two elements. And the program asks:
Please enter 2 numbers, one at a time:
We can type 5 and then click enter and then 5 again
5
5
And after click enter we get the result
10
I'm trying to make a test suite for this program and I have some questions. For example I'm trying to do just for now a test suite for the addition operation described above, but I have some questions on how to do it.
For example, a first way, including all the steps until we get the result of sum "10":
Input Output
+ "Enter the number of elements to add:"
2 "Enter 2 numbers one a at a time"
5 5
5 "Sum is = 10"
Or another way, considering just the addition part, not considering the menu part:
Input Output
5 5
5 10
Or, if it's not necessary to have in consideration the sequence of steps and we just consider the sum operation, like:
Input Output
5 + 5 10
What is a good way to create the test suite for this addition operation above? Taking in consideration that the inputs and outputs can then be used in an automated way to check if each test case has passed or not.