Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PhoneGap By Example

You're reading from   PhoneGap By Example Use PhoneGap to apply web development skills and learn variety of cross-platform mobile applications

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781785285318
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing and Configuring PhoneGap FREE CHAPTER 2. Setting Up a Project Structure with Sencha Touch 3. Easy Work with Device – Your First PhoneGap Application "Travelly" 4. Integrating the Travelly Application with Custom Service 5. Crazy Bubbles - Your First HTML5 Mobile Game 6. Share Your Crazy Bubbles Game Result on Social Networks 7. Building a Real-time Communication Application – Pumpidu 8. Building "Imaginary" – An Application with Instagram-like Image Filters 9. Testing the PhoneGap Application 10. Releasing and Maintaining the Application Index

Testing theory


There are few popular ways of writing tests. Let's look at them and understand the difference between them.

Test-driven development

Test-driven development (TDD) is a process that relies on short repetition development cycles. It means that we write tests while we are writing an implementation. The shorter the cycles are, the better. Here is a diagram showing the TDD flow:

Before we write the actual code that does the job, we need to prepare a test. After the first run, the test fails, because there is nothing implemented. After that, we have to make the test pass cycle by cycle. When it happens, we may spend some time refactoring what is done so far and continue with the next method, class, or feature. Everything starts from writing tests. This is a very good approach, because that's the place where we define what our code should do. By writing tests, we protect ourselves from writing and delivering code that is not needed. We are also sure that the implementation meets the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime