Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How do you test your game?  (Read 2889 times)
0 Members and 1 Guest are viewing this topic.
Offline Gudradain
« Posted 2009-03-10 01:40:41 »


Lately, I realize testing my game to check if everything works fine was a lot harder than testing my little school homework and that it consumes a lot of my developing time.

What I used to do in my school homework was simply to print out the information transform by my program and then check if it's the same as the value I expected. I repeat this test in a couple of different situations and if it's correct all the time I consider it works. If no, I try to find the bugs.

The problem is that this method don't work very well for testing my game. One of the issue I face is that my code is in a loop and it might work for the first 2000 times but at the 2001 time it will produce an unexpected behavior. No exception, no error, it's just that it doesn't produce the result I expected.
To test that, I usually try to execute the code on paper, if I think it's correct I run it and stare at the program to see if it does the right thing (which can be pretty long).

I was wondering if anyone know a better method.
Offline fletchergames

Senior Devvie

« Reply #1 - Posted 2009-03-10 02:15:12 »

You may be able to do unit testing for some parts of your code, but mostly you just have to play the game and try to break it.

It's usually a good idea to try to get other people to play it too.
Offline zammbi

JGO Coder

Medals: 4

« Reply #2 - Posted 2009-03-10 05:13:09 »

I find writing tests annoying, and if I'm the only one going to be coding the game then I won't write tests.
I just make sure my code is good quality (using findbugs plug-in helps) and have a good error logger which users can report the log to get it fixed.
Even though my game is an alpha it is very stable.

Current project - Rename and Sort
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2009-03-10 08:25:51 »

I have developed my own FPS and I give you the following advices:
- write at least some unit tests for the most complex parts of your source code even though you're alone on the project
- use some tools that analyses your source code (Findbugs...)
- release early
- release often
- if your project is open source, some people might give you more precise advices on the way of implementing some features
- allow the users to test your game (ease the way of installing your game)

Julien Gouesse | Personal blog | Website | Jogamp
Offline princec

« JGO Spiffy Duke »

Medals: 1033
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #4 - Posted 2009-03-10 11:23:56 »

I play my games during development for about 4 hours every day - the other 4 spent developing or so. It's pretty time consuming. When they're nearly ready for release we let them loose into the wild and pick up any stranger exceptions automatically via our hiscore table. That quickly finds nearly all the crashing bugs and helps us focus on what to fix for the release. Rinse, repeat.

Cas Smiley

Offline Gudradain
« Reply #5 - Posted 2009-03-10 14:06:00 »

Hmmm, looks like there is no way to avoid the play to find bug part  Sad. I usually test it after each modification so at least I find most of the bugs very soon.

I'm not familiar with unit testing. When you talk about the most complex parts of your code, does it means like the physics?
Offline Mike

« JGO Spiffy Duke »

Medals: 149
Projects: 1
Exp: 6 years

Java guru wannabe

« Reply #6 - Posted 2009-03-11 16:54:39 »

Physics or code that is dependant on other code that is dependant on other code and so on.

Also, know what to focus on with each bigger build and try to at least test the crucial functionalities every time to make sure that they still work.

As for my practise I stand in line with the rest of the answers, add some big feature and test it often. And have your friends play through things as often as you can.

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Eli Delventhal

JGO Kernel

Medals: 42
Projects: 11
Exp: 10 years

Game Engineer

« Reply #7 - Posted 2009-03-12 17:24:39 »

Use the breakpoint tool in your program, it can be your best friend. Have a test somewhere for the specific type of bug you're expecting, then once it's broken you can see the values of all your variables. Similarly you can go through your code line by line to determine exactly what it's doing.

See my work:
OTC Software
Pages: [1]
  ignore  |  Print  

EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (125 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!