Automated Testing

thatoneguy

New member
Hi Justin,

Do you have recommendations for how to make automated tests for behavior trees? Is there an easy way to plug into the tree during the test to see that the tree took an expected path given the conditions the test set up? My initial thought is to put in a bunch of "test hook" variables and have the tasks set them for testing purposes, but that seems laborious. I'm hoping there is an easier way.
 
I have a set of unit tests that I run with Behavior Designer but this was designed before Unity's Test Runner so it's kind of messy and I'm not comfortable releasing it. For version 2 I plan on using Test Runner which should make things easier and I can share my setup but that's still a ways away.

Off the top of my head if you don't want to change any tasks you could enable logging on the behavior tree component and then somehow grab the log within your test program. You could then compare the expected versus actual results. With this method you wouldn't have to change the behavior tree at all.
 
Top