7

Does anyone know any framework that is compatible/integrated with Unity3D? I'm interested in Unit, Integrated and UI testing.

6
  • Is there anything that you've already tried. A quick search returns a number of results from unity3d.com. Commented Jul 10, 2014 at 5:53
  • I've tried TestComplete and SeeTest but they are too expensive.
    – imDJK
    Commented Jul 16, 2014 at 9:56
  • Have you found a solution for this? I'm looking for exactly same thing - automated UI testing for Unity. Commented Nov 2, 2015 at 17:22
  • No, I haven't found a solution. Unity Test Tools are non-play tests and I need Runtime tests. Other solutions would be record and play testing frameworks but if you record a test on a certain device with a specific resolution, the test won't run on another device with a different resolution.
    – imDJK
    Commented Jan 12, 2016 at 14:21
  • Have you found a solution for this? I'm looking for automated UI testing for app, made in Unity. The original Unity new asset for Ui automation is failing.
    – Cleo B.
    Commented Aug 1, 2017 at 17:28

4 Answers 4

4

Although I have never used them, it seems Unity released their own set of testing tools.

  • See their introduction blogpost here.
  • See their examples here.
  • Get it from the Asset Store here. Contains both Unit and Integration tests, for the UI tests, I think you need to use an image-based-testing tool like Sikuli.
3
  • Yes, but those are unit tests. I am looking for UI tests. Taps and clicks. Normal user behaviour.
    – imDJK
    Commented Jul 16, 2014 at 9:56
  • I think the integration tests they speak of are a bit more then just unit-tests. To quote "Integration tests are also the easiest way of starting to write automation tests on a game in development, since they don’t have requirements on the architecture of the code.". For the click tests I only know image-based-testing framework. Also see stackoverflow.com/questions/14087/automated-testing-a-game and gamedev.stackexchange.com/questions/21397/…. Maybe repeat the question on gamedev.stackexchange.com that community might have exp. Commented Jul 16, 2014 at 10:17
  • Thank you for your suggestion. Unity Test Tools are not tests that can be run in Runtime. That was what I was looking for.
    – imDJK
    Commented Jan 12, 2016 at 14:22
3

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)

Architecture of the testing approach I used I used TestCast MBT for modeling and generating the tests. It is a commercial tool, but I was able to model and use the framework with NModel too, which is open source (links are 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

0

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.

0

I am working on test framework for UI testing of Unity3d application that's called Puppetry. You can find source code here and its documentation on Wiki.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.