Debugging and Profiling Apps

Learn tips to help fine-tune the performance of Ionic apps, as well as testing techniques to ensure the application logic is sound.

Software testing

Testing is a huge part of software development, and there’s nothing enjoyable about picking up another developer’s work to find bug after bug in an impenetrable mess of undocumented, spaghetti-like code, particularly when there are deadlines to meet and a million and one other tasks simultaneously weighing you down.

Therefore, it pays to observe best practice standards for coding, testing, and optimizing for best results when we’re developing our apps, regardless of which individual will be responsible for maintaining the codebase.

When testing our Ionic apps, there are a number of approaches we can take:

  • Browser debugging
  • Unit testing
  • UI testing

We will only focus on browser-based debugging and profiling techniques predominantly using the Console API to test the performance of our code.

Console API

The Console API gives us quite a few methods to choose from, the most commonly used being:

  • The log method
  • The dir method
  • The dirxml method
  • The profile/profileEnd method
  • The time/timeEnd method
  • The trace method

We can then use any single one or a combination of these to determine how well our code is performing and whether there are any bugs in the application logic or optimizations required.

Undoubtedly, most are familiar with using console.log(), but let’s put a handful of different methods to work in a sample application like our AppyMapper application that we built.

Get hands-on with 1400+ tech skills courses.