Author Topic: Bugs/Exploits  (Read 705 times)

Offline chesney-93

  • Level 7
  • *
  • Posts: 30
  • Reputation: +0/-0
    • View Profile
Bugs/Exploits
« on: June 14, 2011, 03:10:36 PM »
How do you find them? Users can be kind and tell you but we don't leave in a perfect world do we..

Loggin every little action? :L

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Bugs/Exploits
« Reply #1 on: June 14, 2011, 03:42:42 PM »
It must be a very degenerated community if there is not enough players who report bugs and exploits. Really, if your community degenerate to an extend when 100% of players don't care then you would be better shutting down the game and starting a new one (or just don't care either).

It is in their own best intrest to report bugs and exploits. If they don't care about it why should you? :D

Offline chesney-93

  • Level 7
  • *
  • Posts: 30
  • Reputation: +0/-0
    • View Profile
Re: Bugs/Exploits
« Reply #2 on: June 15, 2011, 07:16:56 AM »
The game it self isn't open yet, so I hope the comunity is nice haha

Offline pixlepix

  • Level 12
  • *
  • Posts: 90
  • Reputation: +0/-0
    • View Profile
Re: Bugs/Exploits
« Reply #3 on: June 15, 2011, 09:56:34 AM »
Yeah, reporting by the community is the only real way. What happens if you bug-finding system has a bug :)

Offline Mutant

  • Level 10
  • *
  • Posts: 55
  • Reputation: +5/-0
    • View Profile
    • Kingdoms
Re: Bugs/Exploits
« Reply #4 on: June 15, 2011, 04:58:40 PM »
I log all errors.... actually I log a lot more... probably slows things down a bit (although the logging libraries I use seem to be pretty good a flushing at the right times). I have a separate log for errors, so I can see if anything causes an actual crash. Those quite often (but not always!) indicate a bug. I can then go back through the debug logs and try to find out more if I need to.

Automated testing can also help. I usually add a new test if a bug is uncovered. That protects me against regressions (i.e. future changes re-introducing that bug). And I also do some degree of Test Driven Development (TDD) which can help prevent bugs getting introduced in the first place. That's quite time consuming, of course, and I don't exactly have piles of time to spend coding, so I often end up writing less tests than are optimal.

Some defensive coding can also help, i.e. thinking about what could go wrong as you're writing code. The classic example is if you have a variable that should never be less than 0, and you want to check if that value is 0, use less than or equal, not equal. E.g. if you want to check how much gold the player has, and you have checks elsewhere to ensure they never get 0 gold, you still write the if statement like:

if ( $gold <= 0 ) { .. }

rather than:

if ( $gold == 0 ) { .. }

That's a very basic example, there are many more. With web applications, you often need to think about people messing with the request. e.g. what if they disable Javascript? You need to validate things on the back-end too. Or what if they manually change the request parameters, can they see or change data they're not supposed to access?

Other than that, as mentioned, players are your best source of bug reports. That's why it's good to open your game as early as possible.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal