Testing Via Blueprints

Hi All,

I have been poking around at trying to get a decent behavior driven development (BDD) system put together in Blueprints. I decided to go BP with it because it makes it that much easier for our designers to iterate over specs for the game and as we have a small team our designers often make changes and it’s nice to have that safety net in BP so they can easily update a test or fix the bug that might have been introduced.

I am looking into integration level testing with the test boundary as close to the player level as we can get, at the user input level.

Basically what we have so far works like this from the perspective of the person writing a test:

We are going for the Given, When, and Then notion. The test shown here says:
Given the player spawns at 0, 0, 0. When the player presses W for 1 second. Then the player should move to 600, 0, 90

Obviously this is a very simple test and you would likely have multiple Givens, Whens, and Thens but you get the idea.

Right now this is focused around simple input validation just to get the POC up and running. The final goal of this is to:

  • Be able to write integration tests to make sure that the game functions as it should at a basic level
  • Run scenario simulations for testing AI (our AI learns so this was important to us)
  • Perform more advanced testing validating advanced game mechanics are working as expected. This would include things like making sure your leveling system is working when players get XP, making sure damage dealt is accurate, testing collision, etc. This is a very long list.
  • Testing game balance. In a game like we are making (Crucible) we need to make sure the player abilities are balanced and with this we can run simulations on that for given scenarios without much effort.
  • Allow for individual game customization
  • Have a HUD to manage running tests and seeing the outputs

That aside, is this something the general community would be interested in? I also have a question posted on the Answer Hub here regarding this: How do I simulate a keypress - Blueprint - Epic Developer Community Forums

As always any additional feedback is greatly appreciated.

1 Like

What’s your question?

Simply if this is a thing the community is interested in.

Also any general input/feedback on the idea of testing in blueprints and using BDD for game dev. There is currently nothing out there like this and I would like to start a conversation about it

Yeah this is a great idea. Did you do this up in c++ or extend player controller in BP?

Definitely BDD is something that I would like to see possible within blueprints so you have my vote!