Does anyone know any framework that is compatible/integrated with Unity3D? I'm interested in Unit, Integrated and UI testing.
Although I have never used them, it seems Unity released their own set of testing tools.
I recently did my master's thesis on automated system testing of programs made with Unity. In my thesis, I evaluated some of the currently used methods and what tools can be used. I also proposed my own testing approach. You can read about it in my thesis here.
To quickly summarize I found that capture and replay tools can be used, but they offer very low level of abstraction and thus any small change to the game will result in that the tests should be redone. Therefore using capture and replay tools cannot be used when the game is in development. 1
In some cases bots can be used, when there is an enemy AI implemented in the game. For example in the case of the EA football game 2 bots were used for testing. They made two AI football teams fight each other.
I ended up using model-based testing approach since it provides large coverage and allows generating any number of test scripts.
The image shows the architecture of the approach I used. I wrote a testing framework, which I used to control the system under test (SUT) and to get the state of the game. The framework connects to scripts running in the program over socket connection. I made the framework open source (the link can be found in the thesis)
I am hoping to promote MBT for game testing and if you need any help you can send me an e-mail, which can be found in my profile.
1 Omar el Ariss, Dianxiang Xu, Santosh Dandey, Bradley Vender, Philip E. McClean, and Brian M. Slator. A systematic capture and replay strategy for testing complex GUI based java applications.
2 Fazeel Gareeboo and Christian Buhl. Automated testing: A key factor for success in video game development. case study and lessons learned. 2012. Pacific NW Software Quality Conference
Yes, there is a UI testing framework recently released on Unity asset store It is compatible with Unity Canvas UI and can be integrated with other UI solutions here.
Puppetry can find a GameObject by its name and position in the hierarchy, and then emulate interaction with it (Click, SendKeys, DragAndDrop, Swipe, etc). Plus you can get its component to make additional validation.
You can make UI testing in Editor or combine it with Appium, for example, to test the application on mobile devices. To use it on a device, Puppetry can provide screen coordinates of a GameObject, and you can click on them, or just use Puppetry's click.
The framework is easy to combine with NUnit, XUnit or MSTest.