Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit Testing LEVEL GAME.  Create pieces array  Call move or interact  Use getters or return type to verify correct behavior  Test ends (don’t go GameEngine.BOARD_SIZE-1)

Similar presentations


Presentation on theme: "Unit Testing LEVEL GAME.  Create pieces array  Call move or interact  Use getters or return type to verify correct behavior  Test ends (don’t go GameEngine.BOARD_SIZE-1)"— Presentation transcript:

1 Unit Testing LEVEL GAME

2  Create pieces array  Call move or interact  Use getters or return type to verify correct behavior  Test ends (don’t go GameEngine.BOARD_SIZE-1)  If interact with adjoining piece, put that piece & yours on board  If interact within range, be sure to test locations within range PLUS one beyond TEST INDIVIDUAL PIECES

3  Can’t test random behavior deterministically  Need to run method multiple times  Do all possible results actually occur?  Do the possible results account for ALL results? (i.e., no invalid moves)  What if LOTS of valid results? (e.g., any location)  Test ends  Identify “categories” of possibilities  If limited number of possibilities, test each one  E.g., move one to right or left TEST RANDOM MOVEMENT

4  What if the player is within “range” of more than one piece?  We’re not testing this, but the approach would be:  Create a GameEngine  Create a pieces array  Add a setter to GameEngine for the pieces array  Call interaction TEST INTERACTION

5 BLACK BOX VS WHITE BOX CriteriaBlack Box TestingWhite Box Testing Definition Black Box Testing is a software testing method in which the internal structure/ design/ implementation of the item being tested is NOT known to the tester White Box Testing is a software testing method in which the internal structure/ design/ implementation of the item being tested is known to the tester. Levels Applicable To Mainly applicable to higher levels of testing: Acceptance Testing System Testing Mainly applicable to lower levels of testing: Unit Testing Integration Testing ResponsibilityGenerally, independent Software TestersGenerally, Software Developers Programming Knowledge Not RequiredRequired Implementation Knowledge Not RequiredRequired Basis for Test Cases Requirement SpecificationsDetail Design From: http://softwaretestingfundamentals.com/differences-between-black-box-testing-and-white-box-testing/

6  Analyze control flow graph  Find linearly independent paths of execution  Guarantees complete branch coverage  Does not cover all possible paths  http://www.tutorialspoint.com/software_testing_dictionary/basis_path_testing.htm http://www.tutorialspoint.com/software_testing_dictionary/basis_path_testing.htm  http://users.csc.calpoly.edu/~jdalbey/206/Lectures/basispathEg.html BASIS PATH TESTING (WHITE BOX)

7  Method to test all the possible discrete combinations of the parameters involved.  http://www.tutorialspoint.com/software_testing_dictionary/all_pairs_testing.htm ALL PAIRS TESTING


Download ppt "Unit Testing LEVEL GAME.  Create pieces array  Call move or interact  Use getters or return type to verify correct behavior  Test ends (don’t go GameEngine.BOARD_SIZE-1)"

Similar presentations


Ads by Google