Chapter 11: Testing and Organizing Your Code

Now that you have finished the development of Corks, you are ready to perform some testing to get Corks ready for deployment to our web servers for use. To prepare for deployment and for easy maintenance, you need to organize your files. At the end of the project development, it’s also a good practice to refactor your code to place each JavaScript function into its own file. When dealing with mobile bandwidth, loading multiple small files is better than loading one large JavaScript file. You can accomplish this by removing the white spaces between each line in your JavaScript to decrease the size.

This chapter discusses refactoring your code by looking for improvements and moving each section into its own separate JavaScript and caching via manifest cache. Then you look into using optimization plug-ins such as head.js to deliver the contents of your JavaScript files asynchronously as the page loads. Finally, you determine your app’s compatibility with multiple browsers.

In this chapter, you test, clean up, and refactor your code on Corks. By the end of this chapter, you should have accomplished the following:

Organize your JavaScript code

Know how to use head.js and the manifest cache

Learn some testing techniques for mobile apps

Get Smashing Mobile Web Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.