Key to MidTerm Exam

Cpsc 873

 

1.

  1. Scales will vary but use case #1 has the lowest risk, use case 4 the highest, use case 2 & 3 equal amount of risk since both are errors, use cases 5,6,7 equal amounts of risk. So a relative rating would be:
  2. #1 low

    #2 high

    #3 high

    #4 very high

    #5 medium

    #6 medium

    #7 medium

  3. Test items AS STATED IN THE FIRST SENTENCE OF THE EXAM:
  4. Player

    HumanPlayer

  5. State-based Test Strategy
  6. 5.1 Syntax – UML Statechart notation

    5.2 Description of Functionality – the methods of Player and Human Player handle moves sent from the GameBoard and Game, notifications of having won/lost or tied the game, and interacting with the ORB

    5.3 Arguments – We need to be able to create Move objects.

    5.4 Expected Output – Each transition is expected to set the state of the object to the values representative of the target state.

    5.5 Exclusions – All of the functionality of Player and HumanPlayer will be tested to an all transitions level of coverage

    5.6 Dependencies – We must be able to register at least a dummy Game object with the ORB in order to complete these tests/The HumanPlayer class is a subclass of Player therefore, there is a dependency between the state machines.

    5.7 Test Case Success criteria – A test case will be judged successful if the state of the OUT after the test is the expected state

  7. Testing tasks for Player and Human Player
  1. Inspect state machines against other design models
  2. Select test cases by following transitions in the state diagrams
  3. Code the tests into PACT classes including the automatic validation
  4. Execute the tests
  5. Evaluate the logged results

2.

  1. A Construct one test case using each technique.
  2. <notYourTurn, setYourTurn(true), yourTurn>

  3. Define each technique including:
  1. Give a justification for choosing this technique.- If Player objects can not successfully transition to certain states they will not forward on messages
  2. Explain why the test case you constructed is a result of this technique.The test was selected by choosing a transition from the state diagram. The initial values for the case were determined by looking at the state at the start of the transition arc. The expected result was determined by following the transition arc to its end point.
  3. Explain where in the PACT hierarchy each test case should be implemented. This test case should be in the Player PACT class.
  1. Construct one test case using each technique. – Invoke setMove with a Move object in which position 3 is selected by Player0; the expected result is that the position in the GameBoard state now contains the id of Player0
  2. Define each technique including:
  1. Give a justification for choosing this technique.- it provides a link between the design specification and the code
  2. Explain why the test case you constructed is a result of this technique.I selected data because it should result in the post-condition being true
  3. Explain where in the PACT hierarchy each test case should be implemented. – This test should be in the HumanPlayerTest class because HumanPlayer overrides setMove
  1. Construct one test case using each technique. Invoke setGameStatus followed by setCurrentStatus; check that result is correct
  2. Define each technique including:
  1. Give a justification for choosing this technique. – When a new method is added to a class, this type of test detects interactions between it and the inherited methods.
  2. Explain why the test case you constructed is a result of this technique. The test was identified by use of the results of the interaction analysis
  3. Explain where in the PACT hierarchy each test case should be implemented. In the HumanPlayerTest class since the setCurrentStatus method is not in Player