Home

Testing Document - EEP Team Website

image

Contents

1. Game MUST have random events which affect NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 4 certain routes cities or other gameplay features Player s can route trains between cities by selecting them and pressing PLAN ROUTE They can then select a Station representing European cities adjacent to their location and assuming they have enough fuel select confirm to send the Players MUST be able to send trains between train to that city over the next few of the Player s User GP 5 1 different European cities fictional or nonfictional Urns Player can continue to plan the route after selecting an adjacent city such that the route extends from the adjacent city to another one Players MUST be able to plan non direct routes They click and confirm in the same as in User GP 5 2 via other cities User GP 5 1 Player can abort a route at any time however they will not recover the fuel it took to get them to the Players SHOULD be able to abort routes There next station They click the abort button in route User GP 5 3 SHOULD be a penalty for this action panning mode Players SHOULD be able to halt and restart trains NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 5 4 whilst on their routes Game includes 20 different cities As can be seen User GP 6 1 Game MUST include at least 5 different cities when the game is launched There are two junctions where lines cross located between Warsaw and Moscow and between There
2. The exit button on the main menu Back button on the new game screen Turn timeout button on the new game screen Station domination button on the new game screen Go button on the new game screen 50 button on the new game screen 100 button on the new game screen 150 buton on the new game screen Back button on the load game screen Back button on the preferences screen Back button on the how to play screen Game settings button on the preferences screen Move screen down to the preferences menu Move Screen left to how to play menu Exits the game Moves screen down to the main menu Toggles the highlight of the turn timeout texture Toggles the highlight of the station domination button Starts core game changes screen to game screen Toggles the highlight of the turn 50 button Toggles the highlight of the turn 100 button Toggles the highlight of the turn 150 button Moves screen left to the main menu Moves screen up to the main menu Moves screen right to the main menu Nothing yet 15 Doesn t move to correct position Doesn t move to correct position Doesn t move to correct position Doesn t open game correctly Doesn t move to correct position Doesn t move to correct position Doesn t move to correct position Non functional Non functional Functional Non functional Non functional currentl
3. 1 Multiple problems with Player s resources not being set correctly at the beginning of the game Players were either missing large amounts of fuel and gold or had much more than expected This was solved when we changed how the constructors of Player worked and when we changed which classes were liable for which parts of the initialisation game process eg CoreGame generates start resources Player generates starting station and train However all is controlled by CoreGame 2 Problems with connections between the UI and CoreGame We realised that the UI was doing a lot of work the back end was supposed to handle when we discovered that the UI through Interface testing and CoreGame start values were very different 3 Saving the game was a very difficult method to create due to the amount of classes and features that have to be accessed and formatted correctly Testing was the only way to ensure that the JSON was valid and could be interpreted by the JSON simple library It also allowed us to check that the save game did represent the object saved Due to the central nature of the class many of the bugs found had their roots in classes other than CoreGame These bugs are explained in the sections below Core Check s that CoreGame initialises all White Box Callum Hewitt Pass tCoreGame values correctly Core Checks that FlipCoin only generates Black Box Callum Hewitt Pass tFlipCoin values between 0 and 1 Core Checks EndTurn correctly t
4. Players MUST be able to obtain resources shop Players deploy resources by routing trains This takes some of the player s resources as fuel for the train They can also use resources in a shop either by selling fuel or buying fuel with gold Player s can also use Cards from the card dock at the bottom of the screen by clicking SHOW CARDS and clicking one of the card icons that appear then pressing User GP 3 2 Players MUST be able to deploy resources Use Card The game s 7 resources are 1 Gold Coal Oil Electric Nuclear Game MUST have only 7 different types of Cards User GP 3 3 deployable resource 20 7 Trains All are deployable albeit in different ways Cards get used up for special bonuses fuel is used by trains gold is used to buy items in the shop and trains are deployed to the map and used to gain more resources How these are each deployed has been explained in other rows of this table We generated a couple of magic wild cards which teleport a train currently only to London when used and another which increases the base speed of a train We also have resource cards which give the player free resources when used These cards are generated randomly so you never know what you re going to get You can see this when you Game SHOULD have a series of wild cards which Purchase cards from the shop You cannot specify User GP 3 4 cause random effects what card type you receive
5. SHOULD be at least two junctions i e train Prague and Paris These act like stations but do User GP 6 2 routes that intersect not perform the same actions There MUST be at least two obstacles in the NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 6 3 game User MUST be able to score points such that the NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 7 1 player with the most points will win the game User s score MUST be based on their NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 7 2 achievement of goals The system MUST have a method in which the NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 8 game ends and a winner is declared or a draw is 21 a User GP 9 The game COULD have multiple game modes NOT IMPLEMENTED SEE ARCHITECTURE DOC There are two distinct Player entities upon starting the game with distinct sets of Trains Stations and Cime MUST euppoit eraci tke payes on oie Goals Players switch between them by pressing User GP 10 computer End Turn on ONE computer Partially implemented Players can purchase a l station at the beginning and during the game Game COULD support the purchasing and which will generate resource for them based on it s Upgrading of stations t0 provide benefits tothe type Rent features are available on the back end owner These benefits could be more train slots i User GP 11 1 charging a use fee when the other player passes but are not fully implemented See Architecture
6. These tests check that the GoldCard does what it should do and the attributes match up to what the should be ww Description Category _ Card Tests that the player s gold increases when White Box Callum Hewitt Pass tlmplementCard the card was implemented Card Tests that a valid GoldCard has been created White Box Callum Hewitt Pass tGoldCard including correct name image and has an owner 3 2 4 3 ResourceCardTest The Resource cards are the more boring and simple cards that we reward but it is important that the correct resource is given with the correct image and owner 1 We found a bug during the implementation of these Cards where the wrong fuel type was increasing during implementation of the card This was again due to a copy paste error where the variables had not been changed properly Card Tests that the player s coal increases when White Box Callum Hewitt Pass timplementResourc the card was implemented and the other eCard resources were not affected Card Tests that a valid ResourceCard has been White Box Callum Hewitt Pass tResourceCard created including correct name image and has an owner 3 2 4 4 TeleportTest Used to test the idea behind the TeleportCard in which a train is teleported from one position to another Only partially implemented due to a lack of UI selecting support for choosing the Train and Station to use The players first train and the teleport location LONDON were chosen as default t
7. many other classes to allow the players actions to be recorded SellStation is not currently implemented due to not being supported on the UI as a result the contents of sellStation and its test have been commented out but were both fully functional Errors found using these tests include 1 Route did not check if the route was empty causing an error where trains were not considered to be in the station preventing the player from buying stations on occasion Player tPlayer Tests that the Player White Box Elliot Bray Pass initialises all values correctly 13 Player tPurchaseSta Tests that stations White Box Elliot Bray Pass ton adds the station to the players list of stations correctly adds the line information and reduces the players gold correctly only when it is a valid purchase station is unowned player has a train in the station and has enough gold Player tSellStation Tests that the station White Box Elliot Bray Not is removed from the activated players list of stations and the correct amount of gold is given to the player only when it is a valid sale the player owns the station Player tLineBonuses Tests that line bonuses White Box Elliot Bray Pass for stations are calculated and applied correctly 4 Interface Testing Interface testing was carried by inspecting the various UI elements in the game itself to confirm if they are working appearing as intended This is static testing and generally cove
8. specify a start station and end station and will complete and reward players after they route a Goals MUST be based around sending trains from train through the start station and then the end U ser GP 2 2 city to city station after having assigned a goal to a train Game randomly generates goals We have 20 stations so we have 190 different combinations of Start and End stations 20 choose 2 This isn t even accounting for cargo being one of two User GP 2 3 Game MUST support at least 10 different goals OPtions either which varies across Goals Pees goal MUST have an associated number of NOT IMPLEMENTED SEE ARCHITECTURE DOC User eon 2 4 points a player can score for completing it If you assign a goal to a train and route it through the Goal s start station and end station start before end the Goal will complete and reward the User GP 2 5 Goals MUST be completable player when the train arrives at the end station The user has a choice of 9 goals in goal menu They can choose to accept three goals and refuse to User GP 2 6 Users MUST be able to accept or reject goals take any they do not wish to complete Stations will generate resources for the player Upon pressing End Turn a Player s resources will increase based on their owned stations resource type and resource output parameters Players can also obtain resources by purchasing them in the shop Players can gain gold by selling fuel in the User GP 3 1
9. tRemoveUpgrade correctly Train Tests that addition of SoeedUpgrade works White Box Callum Hewitt Pass tAddUpgrade correctly 3 2 3 2 RouteTest This section is responsible for testing the routing of trains through the map It is a key class for the backend of the Trains position and Goal completion testing but also at the front end for displaying valid routes in the GUI and allowing valid connections to be added and removed from the path accordingly Bugs found include unknown properties of Vector2 vector implementation a key feature for scaling and updating the trains position it was important that they were used correctly 1 It was discovered on creating a new Vector2 instance from an existing connection vector that any changes to made to the new vector such as scaling or normalising a vector would also change the original copy of the vector within the Connection class This meant that scaling a vector in the update method would permanently scale the original vector losing the original normalised vector used to calculate other important features such as the position of the train This was fixed using the cpy method when initialising a Vector2 which the values of another as such Vector2 vect path get routelndex getVector cpy 2 Ifthe route was empty when calling the inStation and getStation there was no check to see if the existing path was empty so when a connection hadn t been added to a route the code a
10. the expansion of the bottom left resources bar The window used The window for all the warning used in all messages warning messages 5 Requirements Validation We wanted to ensure that we were meeting the requirements we had set ourselves so for validation we inspected our game to ensure that we have features implemented to satisfy our used requirements User requirements are all backed by system requirements so we felt like we didn t need to test validation for those Any requirements which haven t been satisfied are featured at the end of our Architecture Document where we explain why that requirement is not satisfied This is testing by inspection The Evidence for Satisfaction column describes what feature can be inspected in game and how to inspect it to ensure that the requirement has been met We have an End Turn button which when pressed User GP 1 Game MUST be turn based switches control between two separate Player 19 entities Can be checked by playing a game and checking that before pressing End Turn you can control one set of Trains and Stations and have access to one list of goals and after you cannot access that set but you have access to a different set Pressing End Turn again restores access to the previous set of controls Goal Menu Mousing over a ticket icon in the GoalMenu and pressing add to Goals will assign a User GP 2 1 Players MUST be provided with goals goal to a player Goals
11. through etc Doc for more Partially implemented Stations belong to lines Stations COULD belong to a Line providing an me sans Bn Saou AE ae User GP 11 benefits if a Player owns multiple stations on a ut are NOTTY HP E IS TIRE SEE ATCMECTUTE 2 Line Doc for more User COULD have the ability to upgrade trains to NOT IMPLEMENTED SEE ARCHITECTURE DOC User GP 12 make them go faster more efficient or support 1 more carriages Game supports four different types of train Coal Oil Electric Nuclear User GP 12 Game SHOULD support more than one kind of Thee can aly DE STADE By tne Player gy 2 fain selecting a station of the same type at the start We use Gold in the Shop as a currency for purchasing fuel and cards You also recieve Gold User GP 13 There MUST be an in game currency for selling your items Players have access to a shop which sells the four User GP 14 Users SHOULD be able to purchase resources fuel types and Cards in exchange for Gold The user s Goals are displayed by selecting the User UI 1 The user s current goals MUST clearly be shown ticket in the top left hand corner of the screen The Map represents the User s trains as blue and The user MUST be able to track the progress of orange blips showing their locations in relation to User UI 2 their trains the stations Sort of implemented The score display is available but it is not linked to a Player object as Players User UI 3 MU
12. IP IN ag 4 Testing Document TEAM HEC Introduction 1 1 Overview 1 2 People 1 3 Testing History of the Project 1 4 Testing Quality Test Procedures 2 1 Test Bed Setup 2 2 Adding new tests 2 3 Mocking Unit Testing 3 1 Introduction 3 2 Tests 3 2 1 CoreGameTest 3 2 2 ShopTest 3 2 3 Train Tests 3 2 3 1 TrainTest 3 2 3 2 RouteTest 3 2 4 Card Tests 3 2 4 1 CardTest 3 2 4 2 GoldCardTest 3 2 4 3 ResourceCardTest 3 2 4 4 TeleportTest 3 2 4 5 GoFasterStripesCardTest 3 2 4 6 CardFactoryTest 3 2 5 MapTest 3 2 5 1 StationTest 3 2 5 2 MapObjTest 3 2 5 3 ConnectionTest 3 2 6 Dijkstra 3 2 6 1 DijkstraTest 3 2 6 2 EdgeTest 3 2 6 3 NodeTest 3 2 7 Goal Tests 3 2 7 1 GoalTest 3 2 7 2 GoalFactoryTest 3 2 8 PlayerTest Interface Testing 1 Introduction 1 1 Overview This document outlines the testing strategy for the first stage of development of Locomotion Commotion It includes descriptions of all of the automated unit tests our interface testing strategy and our requirements verification testing If you have taken on our code you should easily be able to replicate our results 1 2 People Unit Testing was predominantly done by Callum Hewitt the project manager However for more specialised parts of the code unit tests were created by their respective authors including Matthew Taylor Elliot Bray and Sam Anderson Interface testing was generally informal with final checks devised towards the end of
13. LocomotionCommotion core Test class Test methodi Run all tests in the selected project package or source folder testsrce Ju New_configuration FG JUnit Plug in Test Jython run Jython unittest Launch Group OSGi Framework PyDev Django 23 PyDev Google App Run amp Python Run amp Python unittest R Randoop Launcher Test runner JUnit 4 Keep JUnit running after a test run when debugging Browse Search Search Filter matched 21 of 21 items Multiple launchers available Select one 4 At the bottom you might see an error saying Multiple launchers available Click Select one Eclipse JUnit launcher and then OK This dialog allows you to specify which launcher to use when multiple launchers are available for a configuration and launch mode Use configuration specific settings han ork Launchers Android JUnit Test Launcher Eclipse JUnit Launcher Description The Eclipse JUnit Launcher supports running and debugging JUnit tests Coox l cnca 5 Click Run to run the configuration The configuration should now be saved in the quick run menu so you can use it at any time Tey ey Orvrari Gis V Ju 1 FullTest 2 DesktopLauncher 2 Creates an param star Run As gt blic Route M Run Configurations Organize Favorites curren
14. ST clearly show both players scores currently don t have scores MUST clearly differentiate between different Both Player trains have different textures User UI 4 player s trains Names are displayed as labels next to the Player s scores at the top of the game screen The current player s turn is shown on top of the End Turn User UI 5 COULD display both players names button Users MUST have access to a start menu system The interface is designed You can currently start jeni to start games load games and quit the program games and quit the program and load games This should be the first screen the users see 22 interface is set up but it doesn t perform an action At launch this is the first screen the player s see Pressing the button in the top right corner opens Users MUST have access to an in game menu ne ae rn hea es ote the system pause screen that allows user to save Be See ete TNE STAPESCTEEN Save game ISN User UI 7 linked to the button games and exit to the start screen The buttons are ready for a preferences screen in the pause menu and in start a preferences screen is available However the pause screen button does not lead to a preferences screen and at the The start and pause screens SHOULD also start menu the preferences screen currently does User UI 8 feature controls for a preferences screen nothing User UI 9 MUST display trains on screen We have textures representing th
15. ackage as the code they test However the files are stored in the testsrc folder which can be seen in the package explorer under LocomotionCommotion core To set up the test bed you will first need to make sure you have loaded the project correctly Visit this wiki or read the user manual to see how to get started with the Locomotion Commotion repository After Eclipse has been set up follow these steps 1 Select Run gt Run Configurations Java LocomotionCommotion core src com TeamHEC LocomotionCommaotion Train Rou File Edit Refactor Source Navigate Search Project CZT Window Help m v K kE Set Next Statement Ctrl Alt R 8 Package Explorer 2 gfu JUnit B vo p ER Coverage Last Launched Ctrl Shift F11 B LocomotionCommotion LocomotionCommotion r Q Run Ctri F11 4 LocomotionCommotion core LocomotionCommot Debug F11 OL 4 SH src A Run Hist r c H com TeamHEC LocomotionCommotion a 5 H com TeamHEC LocomotionCommotion Card Run As 3 H com TeamHEC LocomotionCommotion Game Run Configurations E com TeamHEC LocomotionCommotion Goal z Debug History gt ff com TeamHEC LocomotionCommotion Goal 2 Select JUnit from the left hand list and then select the new launch configuration button at the top Create a configuration that will launch a JUnit test Create manage and run configurations Ma x ex New launch configuration Gj Android Application Jo Android JUni
16. buy Changes shop screen to sell Nothing Yet Buys the corresponding item quantity if valid card does not have quantity Increases quantity Decreases quantity The notification window for the starting sequence 18 Does not update prices label Does not update label correctly Does not update label correctly Non functional Non functional Non functional Non functional Non functional Non functional Non functional Non functional Non functional Non functional game_menuobje Ticket symbol in Toggles side Non functional ct_tickettoggle the top left menu that shows the players goals game_menuobje Goal screen Toggles goal Non functional ct_goalscreenbt buttoninthetop screen n left game_menuobje The pause button Toggles pause Non functional ct_menubtn three horizontal menu bars in the top right game_menuobje Thei button inthe Toggles map info Non functional ct_infobutton bottom right image game_menuobje The dollar symbol Opens shop Non functional ct_shopbtn button in the bottom right game_menuobje The train symbol Opens train Non functional ct_traindepotbt button inthe depot n bottom right game_menuobje The end turn Ends turn and ct_endturnbutto button calls associated methods game_card_togg The show cards Toggles the lebutton button at the visibility of cards bottom game_resources Three horizontal Toggles the _togglebutton bars button in
17. discovered that they were working from Coal Price instead of the correct one for their fuel This was caused by a copy paste error and was quickly amended 3 Customers could buy too many cards We added a limit so that the UI wouldn t crash when it had too many cards in it s card hand to display Shop Tests that Shop initialises correctly White Box Callum Hewitt Pass tShop Shop Tests that the correct amount of fuel is White Box Callum Hewitt Pass tBuyFuel bought for the right price and can not be bought when the customer has no money Shop Tests that the correct amount of fuel is White Box Callum Hewitt Pass tSellFuel sold for the right price and can not be sold when the customer doesn t have the correct fuel Shop Tests that a customer can buy up to 7 White Box Callum Hewitt Pass tBuyCard cards only when they have the right amount of Gold 3 2 3 Train Tests 3 2 3 1 TrainTest Trains are important structures in our game and interact heavily with the UI They must be tested thoroughly 1 We didn t find many bugs using these tests Most of the problems we had with trains were UI and were fixed using the interface tests or were related to route and were fixed below These are mainly here for regression testing gi a ane Train Tests that all the different types of trains White Box Callum Hewitt Pass tTrain are initialised correctly Train Tests that removal of SpeedUpgrade works White Box Callum Hewitt Pass
18. e Player s trains User UI 10 MUST display hazards on screen NOT IMPLEMENTED SEE ARCHITECTURE DOC Stations have textures and are labelled with their User UI 11 MUST display stations on screen associated city Routes are represented with lines which are visible User UI 12 MUST display routes on screen on the map Player fuels and gold are located at the bottom of the screen on the left hand side Selecting show cards will reveal user cards and player trains are User UI 13 MUST display player resources on screen displayed on the map 23
19. ests No errors were found but it was implemented for regression testing as when this Card starts to take parameters it will become important to test it properly TeleportCard Checks the new position of White Box Callum Hewitt Pass tlmplementCard the train matches that of London TeleportCard Checks the constructor White Box Callum Hewitt Pass tTeleportCard initialises correctly 3 2 4 5 GoFasterStripesCardTest Used to increase the players Train speedMod by 10 currently uses the players first train due to lack of UI implementation Again this has mainly been implemented for regression testing for the same reasons as TeleportCard GoFasterStripesCard Checks the trains White Box Callum Hewitt Pass k speedMod is increased by tImplementCard 10 GoFasterStripesCard Checks the constructor White Box Callum Hewitt Pass initialises correctly tGoFasterStripesCar d 3 2 4 6 CardFactoryTest Used to create new Card Instances on demand 1 We accidentally mixed up CreateMagicCard and CreateResourceCard so each would try and create the other We were getting IndexOutOfBounds errors however as CreateMagicCard would try to generate a card from the MagicCardList in range 0 to ResourceCardList size which often returned out of bounds This was fixed by switching the methods CardFactory Creates 5000 random White Box Callum Hewitt Pass tCreateAnyCard cards and checks that at least 1 instance of each exists CardFactory C
20. find testing problems more quickly The unit tests are all functional tests and test actions of objects as opposed to non functional tests which check how something feels and are more closely aligned to user experience All of these tests can be run very quickly and are designed for regression testing They should be run after significant changes are made to the codebase ensuring that the project is still stable If they fail then you know that your recent changes have broken some features The testing approach for unit tests has been to add tests to methods which could break easily For tests with inputs we have only tested valid inputs Invalid cases have not been considered This is due to time constraints on tests We felt that the methods we test should never be in a situation that they receive invalid values So at least for now it was better to direct our attention to increasing test coverage for a large proportion of the backend than test more inputs for a smaller number of methods 3 2 Tests 3 2 1 CoreGameTest This section is responsible for testing CoreGame This is a very key class that ties most of the back end together and is referenced heavily by the front end game screen For this reason we used reflection to access the private fields so we could check that the getters were working correctly This is the only test that does this These tests have helped catch some key bugs Running these tests we have fixed the following problems
21. lRouteCost getFuelLengthCost float getFuelType getRoute setSpeedMod int setFuelPerTurnfint m Ppeeeeeoeoeoeoeoeoeood 8 methods selected Create final method stubs E Create tasks for generated test methods 2 3 Mocking To run new tests you will need to run them with the GdxTestRunner class This initialises OpenGL and libGDX features correctly as well as the file system Tests will fail without this class To run with GdxTestRunner make sure that your test class has imported the following org junit runner RunWith com TeamHEC LocomotionCommotion Mocking GdxTestRunner Then above the class declaration add RunWith GdxTesrtRunner class This should fix most problems with graphics during testing However some classes which instantiate more complex UI structures won t be able to be tested even with this solution These should be tested using Inspection 23 RunWith GdxTestRunner class 24 public class CardFactoryTest 3 Unit Testing 3 1 Introduction Unit tests are the main testing method for the back end We used JUnit to create dynamic tests which execute code in a testing environment We test that outputs are generated correctly for certain methods Black Box and that certain methods change their objects in the right way White Box These testing types are distinguished in the table below All of the assertions have an error message set to print if it a test fails This helps us
22. ld References gt 3 Example build gradle DEITS P E Other Ctri N R OGLdpf log Refresh FS amp LocomotionCommoti 76 Set to true whe 2 Name your test class using the convention ClassToTest test Use the browse button next to Class under test to find the class you want to test Then press next JUnit Test Case Select the name of the new JUnit test case You have the options to specify the class under test and on the next page to select methods to be tested 5 New JUnit 3 test New JUnit 4 test E Source folder LocomotionCommotion core src Package com TeamHEC LocomotionCommotion Train Name TrainerTest Superclass java lang Object Which method stubs would you like to create T setUpBeforeClass T tearDownAfterClass0 V setUp0 7 tearDown0 constructor Do you want to add comments Configure templates and default value here E Generate comments Class undertest Train 3 Select the methods you want to test and then click Finish You shouldn t need to test any getters or setters New JUnit Test Case DF gt a s Test Methods Select methods for which test method stubs should be created Available methods a EO Train a Select All Train String Fuel int int int boolean Route Player getActor Deselect All_ getNameQ getValueQ getOwner getSpeed getSpeedMod getFuelPerTurnQ getFue
23. ou click on it it opens relevant information for that train depending on current state Enters routing mode Covers up stations preventing them from being clicked selected for purchasing Non functional Non functional planRoute Plan route button on the train info window Pause menu 17 game_pause_res ume game_pause_sa ve game_pause_set tings game_pause_m ainmenu game_shop_bac kbtn shopBuyButton shopSellButton buyButton coal oil electric nuclear and card addButton coal oil electric and nuclear minusButton co al oil electric and nuclear getStartedWind ow Resume button on the pause screen Save button on the pause screen Settings button on the pause screen Main menu button on the pause screen The back button on the main shop window Back button on the buy and sell windows Buy button on the main shop window Sell button on the main shop window Train screen not implemented yet The buy button for coal oil electric nuclear and card to purchase the chosen item The plus button for increasing quantity for coal oil electric and nuclear The minus button for decreasing quantity for coal oil electric and nuclear The window that appears when a game starts Closes the pause menu Nothing yet Nothing yet Changes the screen to start menu Closes the shop Goes to shop start screen Changes the shop screen to
24. ransfers White Box Callum Hewitt Pass tEndTurn control and increments turn count Core Checks that StartTurn correctly White Box Callum Hewitt Pass tStartTurn increments player fuel based on owned station Core Tests that getBaseResources Black Box Callum Hewitt Pass tGetBaseResources generates the correct resources Core Tests that CoreGame has access to the White Box Callum Hewitt Pass tGetGameMap WorldMap Core Tests that getPlayerl returns the right White Box Callum Hewitt Pass tGetPlayerl player Core Tests that getPlayer2 returns the right White Box Callum Hewitt Pass tGetPlayer2 player Core Tests that getTurnCount returns the White Box Callum Hewitt Pass tGetTurnCount turn count Core Test that getTurnLimit returns the turn White Box Callum Hewitt Pass getTurnLimit limit Core Tests that getPlayerTurn returns White Box Callum Hewitt Pass tGetPlayerTurn correctly Core Tests that saveGameJSON generates a BlackBox Callum Hewitt Pass tSaveGameJSON valid JSON file that represents the CoreGame object 3 2 2 ShopTest This section is responsible for the Shop class This is quite an important class as much of the resource management parts of the game hinge on shop being correct Errors found using these tests include 1 Problems with selling Electric fuel Rounding errors kept giving recurring decimals This was fixed by using a maths library 2 Some fuels were selling for the wrong price We
25. reates 500 magic card White Box Callum Hewitt Pass tCreateMagicCard and checks at least 1 instance of each type exists with no resource cards present CardFactory Creates 5000 resource White Box Callum Hewitt Pass tCreateResourceCard cards and checks there is at least one instance of each and none of them contain a MagicCard 10 3 2 5 MapTest 3 2 5 1 StationTest The Station class in itself does not have much complexity but is used by a variety of other classes so it is important that the values it receives it assigns correctly No errors were found here except in relation to Player Station tStation Tests that the Station White Box Callum Hewitt Pass initialises all values correctly 3 2 5 2 MapObjTest The Map is built up of MapObj it is important that the MapObj s are created correctly and can be found using there correct names A map object does not have to be a station No errors were found here Test that the name is White Box Callum Hewitt Pass the assign one and test that it does not havea station 3 2 5 3 ConnectionTest Connections are the the routes between two map objects They are very critical map objects We found no errors but kept the tests for regression testing Map Test that connection White Box Callum Hewitt Pass between two map ACONMEEHON object is valid Map Checks that the White Box Callum Hewitt Pass tlsReverseof connection recognises its inverse and does not recognise
26. rs what is not tested by Unit tests The Table below lists each interactive UI element with a description of how the element can be recognised in the game and what action it should perform if it does not currently perform an action the action has been listed as Nothing yet It also lists any errors discovered when testing the UI elements and if they were fixed along with if the feature is functional alters the state of the game or non functional alters purely the Ul UI elements that do not yet have their functionality listed are described as Non functional currently as upon implementation they should become functional but as they stand are non functional Description of Description of Errors Functional or element action discovered Non function al newGameButto The new game Move screen up Doesn t move to Non functional n button on the to the new game correct position main menu menu loadGameButto The load game Move screen Doesn t move to Non functional n button on the right to the correct position main menu load game menu 14 preferencesButt on howToPlayButto n exitButton newGameBackB utton turnTimeoutBut ton stationDomButt on newGameGoBut ton turn50Button turn100Button turn150Button loadGameBackB utton preferencesGam eBackButton howToPlayGam eBackButton settingsButton The preferences button on the main menu The how to play button on the main menu
27. some connection that is not its inverse 3 2 6 Dijkstra 3 2 6 1 DijkstraTest Dijkstra is used to compute the minimum path length between two station objects 1 The main bug we found with this was where Comparable hadn t been implemented for Node and the priority queue would fail to add Nodes as they could not be compared This was ammended by implementing the interface 11 Dijkstra Tests constructor is White Box Callum Hewitt tDijkstra intiliased correctly by comparing the Dijkstra testComput Tests that the White Box Sam Anderson ePaths calculated res a value in between 0 and 2000 Alo tests that reward is anon negative number Dijkstra testLlookUp Ensures the returned White Box Sam Anderson Node node is a Node in nodeList Ensures the returned node is not an empty node Dijkstra testInitialise Ensures that graph White Box Sam Anderson Graph initialisation is correct Asserts that every node in staionList is in node list 3 2 6 2 EdgeTest Edges are how Dijkstra represents Connections in a form easier to perform the algorithm No errors were found here Test the edge object is White Box Callum Hewitt Pass not null and the weight matches with the assign one 3 2 6 3 NodeTest Nodes are how Dijkstra represents MapObjs in a form easier to perform the algorithm No errors were found here Tests White Box Callum Hewitt Pass The mapobj equals the one assigned The edges size is correc
28. t The minDistance is correct The next node is not null 12 3 2 7 Goal Tests 3 2 7 1 GoalTest Goals are very critical to the game They represent how the player will score 1 We found an error where Goals wouldn t create properly They would be half formed We were missing quite a lot of the important variables We made sure they were instantiated correctly 2 We had lots of problems converting the results from Dijkstra s algorithm into a form that could be given as a reward This took some fiddling but we got it working eventually Goal Tests that the goal has White Box Callum Hewitt Pass tGoal a start and end station Goal Test that the goalhas White Box Callum Hewitt Pass tAssignTrain a train assigned to it Goal Test that the goal is White Box Callum Hewitt Pass tlsSpecial not special When it shouldn t be Goal Test that the reward is White Box Callum Hewitt Pass tgetReward greater than zero Goal Test that the start date White Box Callum Hewitt Pass tgetStartDate is not null 3 2 7 2 GoalFactoryTest GoalFactory is the only place Goals are generated outside of tests It is important that they are right 1 We fixed a bug where StartStation and EndStation were the same GoalFactory Test that the goal White Box Callum Hewitt Pass tCreateRandomGoal factory returns a fully valid goal 3 2 8 PlayerTest This section is responsible for testing the Player class it is an important class as it interacts with
29. t Test E C C Application Eclipse Application IronPython Run amp IronPython unittest E Java Applet 4 O Java Application c DesktopLauncher Ju JUnit JG JUnit Plug in Test 2 Jython run Configure launch settings from this dialog E Press the New button to create a configuration of the selected type Press the Duplicate button to copy the selected configuration J Press the Delete button to remove the selected configuration Press the Filter button to configure filtering options Edit or view an existing configuration by selecting it Configure launch perspective settings from the Perspectives preference page 3 Inthe new launch configuration window Select the Test Runner to be JUnit 4 and the click Run all tests in the selected project package or source folder Press Search and look for the testsrc source folder You can rename this configuration to FullTest at the top Create manage and run configurations Multiple launchers available select one to continue Cmxl ex type filter text Android Application J Android JUnit Test E C C Application Eclipse Application IronPython Run IronPython unittest Java Applet E Java Application E DesktopLauncher Ju JUnit El Test _69 Arguments Classpath E JRE 7 Source B Environment Common Run a single test Project
30. tMapt routeTndex A 6 Add more configurations for individual test packages by adding new run configurations in the same way and change testsrc to one of the individual test packages in the testsrc folder 2 2 Adding new tests When writing new tests ensure that you create a package in testsrc of the same name as the package the class you want to test is under 1 Right click the package the testcase needs to be part of in Package Explorer Select New gt JUnit Test Case H com TeamHEC LocomotionCommotion Map 45 Used to reload E com TeamHEC LocomotionCommotion MapActors 46 param path cur com TeamHEC LocomotionCommotion Player 47 _ ___s param routelnc ad aient New g Java Project ij com TeamHed Go Into G2 Android Application Project 4 ent com TeamHEC A A CoalTrain j Open in New Window T Project a eI Open Type Hierarchy F4 Y Package D cee Shown AlteShiftew gt Class B salva E Copy Ctrl C r Ei K oute zava Copy Qualified Name Enum A RouteLister Annotation fj SpeedUpgy alee ee Source Folder J Train java Delete Delete F 48 Java Working Set Jj TrainDepot en R eee D TrainInfoUl C Folder TrainUpgra Source Alt Shift S gt f File a an com TeamHEG Refactor Alt Shift T gt Untitled Text File testsrc cm Z gt BA JRE System Library I Import Ei Ap XML File r gt BA Gradle Dependend g Export EY JUnit Test Case assets 4 bui
31. the project to ensure continued quality This document defines exactly how the interface should work and some tests that can be performed for each aspect of to ensure it still works correctly These inspection tests were performed by Elliot Bray and Rob Precious Our verification tests were done via inspection and are used to ensure that our Game delivers on the user requirements Any requirements which haven t been delivered in this iteration have been justified in the architecture document 1 3 Testing History of the Project For about 4 weeks during the project we had a problem where we could not run any tests This lead to some unstable development particularly on the backend whilst the error was being tracked down The problem was eventually solved by mocking OpenGL and other LibGDX features in a class GdxTestRunner The solution was found online Read carefully the section about adding new tests to see how to avoid this problem for new tests 1 4 Testing Quality It is impossible to test every possible scenario and some parts of our code were impossible to test at all mainly due to continued problems with mocking graphics libraries However as a team we feel that our tests cover as much code as is necessary to be confident that the software will perform as expected Our inspection tests backup our unit tests well and should cover most problems 2 Test Procedures 2 1 Test Bed Setup All tests for our code are declared in the same p
32. ttempt to access an index of an ArrayList that was empty throwing an exception This was fixed with adding a isEmpty if statement in inStation which returned true if empty Co Pass Pass Pass Route tGetTrainPos Route tRouteReloadConstru ctor Route tGetTotalLength Route tGetLengthRemaining Route tGetStation Route tUpdate Tests that the coordinates of a train within a route are correct after moving the train through a route Tests the second Route Constructor used to implement an existing route is correct Adds connections to a route and checks if the total length of the path is correct Moves a train through it s route checking if the length remaining is correct Checks if a train is currently in a station within the route Update moving the train through it s route checking it s position is correct Matthew Taylor Matthew Taylor Matthew Taylor Matthew Taylor Matthew Taylor Matthew Taylor Pass Pass Pass 3 2 4 Card Tests 3 2 4 1 CardTest Cards are one of the more interesting features of the game It was important that they worked correctly No bugs were found using these tests but we implemented them for the purpose of regression testing Tests that an instance of Card is initialised White Box Callum Hewitt Pass correctly Uses coalCard Card Tests that a Card s owner can be set White Box Callum Hewitt Pass tSetOwner correctly 3 2 4 2 GoldCardTest
33. unctional Non functional Non functional Non functional Non functional Non functional Doesn t raise Non functional Doesn t lower others Doesn t show used card button Wrong index Functional sent Not clickable due to bounds issue Non functional Functional ee ee er es E planRouteButto The button onthe Plan route didn t n goal ticket in the hide when leaving players goal bounds window Non functional closes goal menu Opens the station info window Open routing mode Adds selected goal to player goals The button on the goal ticket in the goals window addGoalButton Not passing the right index The back button on the goal screen backButton Non functional refreshGoalButt Not implemented Non functional on on the UI Non functional The station blips on the map The select button on the station info window stationSelect If in starting sequence it selects player 1 and 2 stations otherwise it purchases stations Not recognising trains being in the station Closes the routing mode Confirm button in routing mode confirmRouteBu tton Undoes the last connection Undo button in routing mode undoLastRouteB utton Undoes all connections made abortRouteButt Abort button in on routing mode Cancels the route Cancel button in routing mode cancelRouteButt The train blips that moves around the map Moves around the map if y
34. y Non functional currently Functional Non functional currently Non functional currently Non functional currently Non functional Non functional Non functional Non functional displayButton soundButton controlButton homeButton Display settings button on the preferences screen Sounds settings button on the preferences screen Control settings button on the preferences screen Button between previous and next on the how to play screen Nothing yet Nothing yet Nothing yet nextButton Next button on the Nothing yet how to play screen prevButton useCardButton goalActor actor for player goals and goal menu goals RemoveButton 1 3 Previous button on the how to play screen Nothing yet Any of the possible Raises the card 7 cards the player has The use card button above a card The tickets goals are displayed on Up and right of a goal in the goal window if you have selected it in the goal screen up shows the new card button and lowers any other raised cards Calls use card method passing the selected card 2 If its a player goal hover will show the plan route button if its a menu goal it will show add goal button If goal has just been chosen from goal menu remove button will undo that choice otherwise it will remove 16 _ Zz Plan route didn t hide when leaving goal bounds Wrong texture showing Non f

Download Pdf Manuals

image

Related Search

Related Contents

CLIMATIC 50_MUL34S-0805 09-2005  BOOSTAIR TOUTES POSITIONS  User Manual for the Regional Environmental Information System  NOTICE DE MODE D`EMPLOI ET D`ENTRETIEN  WA 5080 - Bauknecht  Single Board PC User Manual  Zusatz zur Anleitung BPA 100 (Navi-Version) Annex to user manual  945851_oras_electra  DSL-2640T ADSL2+ Wireless Router User Guide  HP SureStore E Disk Array 12H User`s and Service Manual  

Copyright © All rights reserved.
Failed to retrieve file