Test and Debug

At the beginning of this book, I explained how to trace some comments in the simulator console. I’ll now elaborate on that and give you some tips to test and debug your app like a pro.

There are two kinds of bugs:

  • Syntax bugs: There is a typo in your code. Most of the time, the Corona Simulator will display the error in the console or a dialog box.
  • Programming bugs: The simulator does not display a message, but the program is doing weird things: some values are wrong, the game does not respond, and so forth.

Syntax bugs are easy to fix. The message from the simulator is quite clear, providing the line number along With some information:

The code was:

instead of:

Programming bugs can be tricky to fix, and so I’ll spend ...

Get Create 2D Mobile Games with Corona SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.