Windows Testing

Erayd

Member
I'm looking for input on testing. I am wondering if there are any built in programs in GMS2 that do things like check if a variable is used in the right way. For example: if it is being set at run time but never changed. Then somewhere in the program that variable is being reset, which would be redundant since it is never being changed.

I know it comes with a great overhauled debug tool, however I need a brush up on best practices when using that if anyone has any tips.

What types of tests do you run on your game? Professional non-game developers have quite the test suites they code to ensure their code is correct as can be and I am wondering if anyone on here does something similar.

Lastly, is there a way to use the search tool on a single object or collection of objects?
 

The-any-Key

Member
I dont think the debugger is designed for this.

You can creare a own object that check each step if a variable change. Best it to create a script that change the variable exclusively and monitoring it.

In the search window you see the object name so just check the ones you need.
 
Last edited:

Genetix

Member
Might not be nearly the best method, but early on in prototypes I'll end up drawing quite a few variables directly onto the screen (or to the debug log) with text describing them, I also put in a lot of keyboard presses to change variables and test. Just depends on exactly what you need to test. Also ends up being a cool way to think about building cheat codes into your game!
 
Might not be nearly the best method, but early on in prototypes I'll end up drawing quite a few variables directly onto the screen (or to the debug log) with text describing them, I also put in a lot of keyboard presses to change variables and test. Just depends on exactly what you need to test. Also ends up being a cool way to think about building cheat codes into your game!
I used to do that in GM7 until I started using execute_string() to make things easier. When I switched over to Studio, with the removal of said function, I ended up writing a fully-fledged console that can adjust variables, create instances and throw back variable values and error messages.

It's been very useful and if you're capable of writing the code for it, I would recommend doing so.
 

Erayd

Member
I'll consider it. I can do it, however it's more where do I want to spend my time. I'll see if there are any plug ins on github or something that might be able to test my code as I write it and get back to me at runtime or something.

I wish the search tool was a little more robust and had some filter options. I would like it to exclude words in comments and seperate between object instead of giving me everything. Or only ones that directly refer back to a specific objects variable, which could be anywhere but is more specific.

I think, to be a little more clearly, what I'm looking for is some code library or program that I can write tests with which can run while my game is running to test it. Basically, it sends commands automatically to do specific things and if the outcome isn't as expected then report back. It sounds like I may be able to use objects in specific ways as sort of spies in my game to test out features just by having it running.
 
Top