I need to come up with a test plan for this program scenario. So far I have the
ID: 3840811 • Letter: I
Question
I need to come up with a test plan for this program scenario. So far I have the following: What other tests am i possibly missing?
Test Tested Expected Result
Rock strength 2x fighting scissors R vs. S Rock wins
Rock strength 1/2x fighting paper R vs. P Paper wins
Paper strength 2x fighting rock P vs. R Paper wins
Paper strength 1/2x fighting scissors P vs S Scissors wins
Scissor strength 2x fighting paper S vs. P Scissor wins
Scissor strength 1/2 fighting rock S vs. R Rock wins
Check stats for Wins/Losses
Check stats for ties
Check correct output/user prompts
Input verification/check prompts
Check menu input/output
--------------------------------------------------------------------------------------------------------
You will implement a class called Tool. It should have an int field called strength and a char field called type. You may make them either private or protected. The Tool class should also contain the function void SetStrength(int), which sets the strength for the Tool.
Create 3 more classes called Rock, Paper, and Scissors, which inherit from Tool. Each of these classes will need a default constructor that sets the strength to 1 and a non-default constructor which will take in an int used to initialize the strength field. The constructor should also initialize the type field using 'r' for Rock, 'p' for Paper, and 's' for Scissors. These classes will also need a public function fight(Tool) that compares their strengths in the following way:
Rock's strength is doubled (temporarily) when fighting scissors, but halved (temporarily) when fighting paper.
In the same way, paper has the advantage against rock, and scissors against paper.
The strength field shouldn't change in the function.
You may also include any extra auxiliary functions and/or fields in any of these classes.
In addition, you will create a class called RPSGame, which allows a human to play the rock, paper, scissors game against the computer. Your RPSGame must have two Tool* for the human and computer tool because you don’t know the new tool they’ll select with each round. The RPSGame should also have three int fields to keep track of the number of human_wins, computer_wins, and ties.
You can choose the strategy for the computer guesses, but it cannot be based on what the human selected for a tool in the current game!!! Example of a novice and veteran computer AI: http://www.nytimes.com/interactive/science/rock-paper-scissors.html?_r=0
After the human selects the tool for the current game, display the computer’s tool, a message describing who won, the current stats for the wins and ties, and then ask the user if he/she wants to play again.
Example Play of Game:
Welcome to Rock, Paper, Scissors! Do you want to choose different strengths for the tools? (y-yes, n-no) n
Choose your tool (r-rock, p-paper, s-scissor, e-exit): r
Computer chose scissor.
You win!!!
Human wins: 1
Computer wins: 0
Ties: 0
---------------------------------------------------------------------------------------------------------
Explanation / Answer
The exhaustive testing of all scenario is already mentioned by you.
You can also test whether procedure used by computer for rock,scissors,etc is really random or not ? ( using srand(time(NULL)) in c++ )
Test whether computer random guesses ( in form of integer ) are correctly converted to their corresponding types ( in form of moves : is it rock or scissor, etc )
You can check stats of the games, when it is played only once, when it is played multiple times
One important case can be when multiple games make wins and loses equal, and final result is tie
Testing whether we can access the fields like strength and type from outside functions ( as they must be private )
Whether strength change is really temperory or we forget to reverse it before next move, etc
Hope it helps
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.