Jump to content
  • Advertisement
Timothy Sharp

How to avoid bugs

Recommended Posts

I am taking a break from my YouTube gaming career to pursue game development. My question is, how do I avoid bugs? I know I cannot all the time. 

Share this post


Link to post
Share on other sites
Advertisement
1 minute ago, Timothy Sharp said:

What do you mean?

The code is created in your head, not your fingers. 

Share this post


Link to post
Share on other sites

Bug mitigation is mostly about using the right tools, and developing sufficient discipline. Strongly-typed programming languages help, unit testing, contract-based programming, fuzz testing... lots of techniques available depending on your exact needs.

But before you worry about any of that, you need to learn how to program. Don't put cart before the horse.

Share this post


Link to post
Share on other sites
4 minutes ago, swiftcoder said:

Bug mitigation is mostly about using the right tools, and developing sufficient discipline. Strongly-typed programming languages help, unit testing, contract-based programming, fuzz testing... lots of techniques available depending on your exact needs.

But before you worry about any of that, you need to learn how to program. Don't put cart before the horse.

I have a great idea and idea for the story... or atleast the beginning I just need to learn how to program

Share this post


Link to post
Share on other sites
Posted (edited)

You can start learning programming and unit testing at the same time.  Instead of starting with "hello, world!" command-line programs, start with "hello, world!" unit tests.  For a while they might seem dumb, but once they save your ass a few times you'll start to understand why they're a good idea.

Edited by Nypyren

Share this post


Link to post
Share on other sites

Well you can go to a store and buy a pesticide!

Joking aside, the only way to completely avoid bugs is ... to do nothing! They say, when there's no code, there's no bug. You will face a lot of bugs along the way, with most of them created by your very self. That's just a natural. With knowledge and experience, you will have a way to make a decision that leads to less bug. But to gain that you'll face bugs, a lot of them.

My suggestion would be, start slow, start small, get a mentor, and write unit tests if possible!

Share this post


Link to post
Share on other sites
Posted (edited)

For me it's automatic regression tests with ample code coverage.

I find system tests do the job better than unit tests here.

My most complicated hobby project to date was a multiplayer RTS game.

There are lot's of bugs that can cause the game to go out of synch.

So I created a test where 2 bots played eachother automatically for every build that I made:

This was a complete end to end test: There were actually 2 separate instances of the program playing eachother over the network.All of this was launched automatically, so it was painless for me to test.

It took me several days to set this up.

But, It helped me catch 75% of my bugs.

In a hobby game this is specifically important because bugs demotivate you. 

 

Edited by SillyCow

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!