Obviously there are many AAA studios that use Unreal. Maybe Epic could reach out and ask what they do on this front and provide suggestions to the great unwashed. Maybe even a guest blog post. Hopefully they don’t come back saying they employee testers @ $2 per hour
For myself, I have heaps of checks in my code and a few check(TestWorldConsitency()); type things. I have a few “test maps” that automate stuff on Tick(), but it is really unrefined. Please don’t flame me to say but you are not doing real automated tests or unit tests.
I’ve also got some millage from using the PVS- which you can see that better support is on the roadmap for 4.17. I’m sure I have a relatively small project, but it only took me a day to get everything passed (or marked as a false positive) and us single independent developers working on individual independent projects get it for free.
I kind of think that those people who seriously use this sort of thing would probably pay for a license.
I think it is a bit sneaky as well and has a bit of wisdom. I’ve being in work places where devs (having no budget on the own) just start using these sorts of tools on the sly. Along comes some compliance person (or busy body, whatever) and kind of forces the issue (which if the devs went through the “proper process” would just being blown off - sometimes it is easier for the money person just to say yes).
[=alpaka;728734]
… Has anyone experimented with writing simulation code in unmanaged parts of the game (POCOs) and using the VS test toolkit?
[/]
To answer my own earlier question: If you are fine with (or even prefer) foregoing all the UE4 C++ extensions by using POCOs, it is quite possible to create a library project, which you can unit test with the regular VS test system, then link it into your project. This allows you to use unmanaged code both in the test explorer and in your game. If you need to unit test UObject code, need reflection, or are using managed code otherwise, I’m afraid you’re stuck with the built-in testing framework.
There are basically two options: a static library (.lib) or dynamic library (.dll). I couldn’t easily figure out how to use the hot reload feature for non-module DLLs, or how to build them as stand-alone DLLs (can’t link to the generated DLLs from the build tool, it seems), so I went with the static library. There is an introduction to linking them using UBT here: https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System, but you should update it to 4.16 using ReadOnlyTargetRules instead of TargetInfo.
I would also like to note the following workaround for using the automation system a little more efficiently (quoting myself on the Answer hub):
[]
Just in case anyone is looking for a sorta workaround to this: I played around a bit with hot reloading modules that contain tests and while you cannot change an existing test, adding a new one seems to work fine (recompile module from the editor - or, if the test is in your module, it also works when building from VS - then hit Refresh Tests in the session frontend).
So when you want to change an existing test to make it pass or whatever, you can change its name from Test to something else (I use Test2, Test3, etc.). Unfortunately, the old test class stays around as a ghost until you restart the editor, so it messes up the “Run All tests in a category” functionality. Note that you can have multiple test classes in a single source file so genuinely adding new tests is not a big issue.
While this is obviously not a perfect solution, it’s somewhat workable and is at least better than having to restart the editor all the time. Once in a while, you can clean up all the numbers and just restart the editor.
[/]
[=“, post:3, topic:41969”]
of the documentation, existing examples and functionality that exists for automation tests in UnrealFrontend is designed for people that are writing automation tests for the actual engine. For someone working on the engine, automation tests are something of a 1st class feature.
For someone that wants to write automation tests for an actual game, the system is more of a 3rd class experience. Outdated documentation, unclear support and everything else I mentioned above. What I’m asking for is that Game-Centric Automation Testing be on the Roadmap as a 1st class feature.
[/]
Bump 100% agree with everything is requesting in regards to Game-Centric Automation Testing.
It is 2023, buggy AAA game releases have taken huge hits to entire franchises and branding (such as Cyberpunk 2077 & BF 2042), there is no way I am going to ship a game without unit testing! Also live service games cannot be sustainable without automation!