(no title)
andrewallbright | 3 years ago
I started to teach myself unity in December 2021. I've personally experienced benefits to writing automated tests and using CICD; therefore, I thought it would be fun to learn about writing tests for a 3D based software. It will be different from the web/CLI based stuff I usually write.
So, it turns out that the video game community (or at least the online circles I frequent) are extremely against the idea of writing automated testing for various reasons. This translates into there effectively being a non-existent pedagogy around teaching how to write tests for 3D based software. Content is scarce, and the content you do find is produced by people who obviously don't write automated tests. So, for me I've hit the books to arbitrage & translate techniques and philosophies into this "untapped" domain.
It's interesting because I've figured out tips & tricks that I'd consider low hanging fruit... For example, if you place a "test" camera in the test case, you can actually see what's going on in the test when it's executed. Or how important it is to clean up every created game object in your test after each test; if done right, you can keep your SUT at origin (0,0,0). Or the importance of "test prefabs" who are effectively mocks of other "real" prefabs...
One innovation that I would like to use/build that I truly consider (((revolutionary))) is this: I want the test cases I write to also automatically (or when tagged with a certain C# attribute) generate the same game objects in a "exploratory(manual) test scene." I think this innovation is the "killer app" that will completely and totally sell the value proposition of automated tests to those opposed. If you decide to build this, please also publish it on openupm and reach out to me.
I have plenty of other thoughts and ideas on this space. I love talking about automated testing; it feels like a very futuristic programmer practice. I hope this post demonstrates why this work and space is so interesting.
cpeterso|3 years ago
The client had a secret level with all game objects for testing and debugging. But reading your post makes me see that we didn’t think ahead far enough: the secret level could have been the foundation for automated unit testing game objects and battling characters.
I haven’t watched them yet, but I added these relevant videos to my YouTube backlog just this week:
* Automated Testing of Gameplay Features in 'Sea of Thieves' (GDC 2019): https://youtu.be/X673tOi8pU8
* Taking CI and automated testing seriously (2018): https://youtu.be/YGIvWT-NBHk
meesterdude|3 years ago
But I'm not dismissing testing in unity. I think there are some simple approaches to testing automation that could be done. It would be nice if unit testing made more sense but in reflection i've often found it's the integration of components that breaks or changes, less than the behavior itself.
ativzzz|3 years ago
lfpeb8b45ez|3 years ago