Download presentation
Presentation is loading. Please wait.
Published byPierce Sparks Modified over 9 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.