Question: develop a program that lets a user play tic - tac - toe against the computer. The goal is to identify test cases before the
develop a program that lets a user play tictactoe against the computer. The goal is to identify test cases before the code is written using the VModel You want to maximize code coverage by testing as many paths through the logic as possible at the same time as controlling time and expense by designing a minimal set of test cases to give you confidence that the code works.
Rules of the game
The user can choose to play X or O
X always goes first.
Then X and O take turns placing a marker on the board.
The goal is to win by placing three markers XXX or OOO across one row, down one column, or along a diagonal.
The game often ends in a tie when the nine positions are filled but neither X nor O completed a line.
Scope of this exercise
You are engaged in an Agile development process. In this increment, you are focusing on the logic of deciding what move to make. In other words, test the artificial intelligence of a computer playing a game.
Previous increments prepared the board and prototype user interface. You can assume that tests for valid game moves were completed in an earlier increment. For example, assume user or computer dont try to play into an occupied square or play an X when its Os turn. Similarly, dont worry about how the board is represented internally or displayed to the user. Just trust that some x display is mapped onto an appropriate data structure in the code.
The code you are testing
The logic for computers move is to try the following in order:
a If you have two pieces in a line and can complete a line by placing the third, put your X or O in the winning cell.
b If the user has two markers in a line and can complete the line on hisher next move, put your marker in the cell that blocks the user from winning.
c If the middle of the board is free, put a marker there.
d If at least one corner is free, put a marker in a corner. Choose the corner randomly.
e Select randomly from any of the unoccupied cells.
Notes: The five rules above simplify the logic, and dont always pick the best move. Therefore, it is possible for the user to beat the computer. The user does not have to follow the same rules and make very silly, but legal, moves.
Note: To analyse these properly you should rely on tried and true methods of information processing. For example, you can come up with a shortcut way of referring to conditions ae above by naming them respectively:
aWIN move, bBLOCK move, cCENTER move, dCORNER move and e SIDE move or RANDOM move
The test objective
The test objective is to verify that the program is applying the rules above in all situations. The goal of this exercise is to design functional tests. Your task is to analyse, design and document enough test cases to be confident of the verification testing. Testing every possibly configuration of pieces is virtually impossible, even for a game as simple as tictactoe.
Your company will outsource your test cases to test specialists who will implement and execute the tests. Testers will compare actual results with expected results and report all deviations as possible defects.
Instructions
Work with one partner. Healthy discussion and an exchange of different views is good. Finding a consensus approach is part of the exercise. Remember, many different solutions may be good.
Create your solution as an MS Word document.
First, decide how many test cases you need and list them. Use a numbered list so that the numbering gives each test case a unique identifier and add a headlinestyle title see template below
Test Case Identifier ID Test Case Title
TC Computer, with X plays Bcenter
TC
TCN
Note: To complete the following second task below, whenever you need to Specify a precondition or a post condition, you can do it via using the template below. Make sure you identify via the subscripts the order of movements. For example, in the template below X of course has started st and his first move was in Bnotice the Excel notation is used in this depiction The PC has used C as its first movement; then the player has put his movement in C where you see X the second movement of player X indicated via X subscript or X Second movement of PC is placed in cell A and then the player places in B its third movement or X This can serve as a precondition in the specifications below.
A B C
X
X
O X O
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
