Question: In java object oriented programming you must design and implement tests for all of your bots. These tests should test all qualities of each type
In java object oriented programming you must design and implement tests for all of your bots. These tests should test all qualities of each
type of bot. You will make a main Test class and static methods for each of your tests. You will
demonstrate your understanding of polymorphism through this testing process. Remember:
polymorphism is the ability to put an object of a descendent type into an ancestor type variable. Eg
you may put a FlexibleBot in a Bot.
Checklist of tests:
Make a minimum of one bot of each type in your hierarchy. If you made different bot classes,
you will make objects for each of those types. Make an ArrayList or type bot to put all of
the bots into. Pass that list to the Map.
Make an ArrayList of the interface type to demonstrate your knowledge of
polymorphism.
Demonstrate moving all bots using a traversal over the list to demonstrate polymorphism.
Demonstrate the use of downcasting to call methods that dont exist in Bot class.
Test the FlexibleBots following qualities: These are required
aTest to see if a bot will move all the way to another Entity and stop.
bTest to see if the bot will turn when it cant move
cTest to see if the bot will move all the way to the edge of the map
dTest to see what the bot does when the speed is greater than the distance to the closest
bot
eTest to see what the bot does when the speed is greater than the distance to the edge
fTest to see what happens when the bot is surrounded and cant move
gTest Speed up and speed down.
hTest teleport
iTest counterturn
For each bot that you created, make a new method to perform tests of all new methods. See the
following examples. You must make at least tests for each bot.
aKillBot: test to see what happens when there are no bots in its path
bKillBot: test to see what happens when there are multiple bots in its path
cKillBot: test to see what happens when there is only one bot in its path
dReproducingBot: Test to see what happens when it is surrounded
eReproducingBot: Test to see what happens when there is only one space to move after
generating bots. Will it wall itself in
fThese are only suggestions; you must come up with test ideas on your own.
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
