Hi there,
Could anyone please provide some clues on how to do a Unit/UI test to a game, for me, a beginner in app/game development?
I am making a little game, and basically I’ve done coding for the gameplay. My game is rather simple. Basically it just switches between different “GKState”. When entering each state, I give nodes of actors some actions, and when leaving each state, the actions are removed. The nodes are either “SKNode” or “SKSpriteNode” and are wrapped in “GKComponent”. In some states, I give nodes “GKBehavior”.
I’ve been thinking how to test. For Unit test, I learned that it’s for the app’s logic. But my (perhaps naive) understanding is that I can prove the logic is all correct because I play the game and it runs well. I accept the point that we should test it numerically not just visually. But, for example, for the “presentScene” method of “SKView”, should I make some dummy scene and, when entering the dummy scene, should I make some dummy nodes with giving the dummy nodes some actions? Perhaps I can do these, but what’s the meaning?
For the UI test, I found all I can retrieve from a UI is the images. But for a game, since actors have different positions and speed and images every time I run the game. So it looks for me that it’s not very possible to do UI test for a game, either via the “UI recording” or programmatically. I also think my playing is a test.
So far, for Unit test, I just measure the time of loading my resources. For UI test, I just tested a button in my game.
Thanks a lot for any clues!