Behavior Driven Development with Calabash for Achieving Continuous Quality

Behavior Driven Development with Calabash for Achieving Continuous Quality

/, Mobile Application Development, Mobile Application Testing/Behavior Driven Development with Calabash for Achieving Continuous Quality

We at Perfecto Mobile continues to innovate and provide a variety of commercial and open source tools for mobile app developers and testers so they can continuously develop, test and deploy mobile apps with confidence. We’re happy to announce added support for Calabash – the latest integration to our open source portfolio. With the new integration Perfecto Mobile’s users can develop Calabash tests in the form of Features, Scenario’s and step-definitions and execute them in a governed cloud of real mobile devices using the leading CI (continuous Integration) servers such as Jenkins, CloudBees, TeamCity and TFS.

calabash

Behavior driven development (BDD) is a modern quality assurance technique which aims to reduce TTM and enhance quality for mobile and non-mobile apps for iOS and Android. In the past we used the terms Test Driven Development (TDD) or Extreme Programming (XP) which aimed toward the same goal of developing your module in parallel with testing it in a rapid way.

 

Behavior Driven Development follows outside-in development, in which the application code is written after its externalities have rubybeen defined. It’s conceptually similar to Test Driven Development (and is in fact based on it), but takes it one step further; instead of creating tests that describe the shape of APIs, application behaviors are specified.

 

Recently, and especially in mobile where a need to shift quality activities earlier in the development lifecycle to meet continuous integration goals, BDD has become a standard method of agile software development. Cucumber and Calabash tools are using Ruby as their development language (also Java and ObjectiveC are supported).
Calabash is a mobile open source solution which is an extension of Cucumber.

 

Typically the flow of developing a Cucumber or a Calabash test case will consist of the below steps as shown in Figure 1. The advantage of such technology is the ease of writing software readable specification together with the development of your tests for high quality. In a simple statement developers iteratively translate use cases into test code during app development
Fig 1

Figure 1 BDD Steps

 

As shown in Figure 1, users start by specifying their business application features (e.g. Login to an application or math calculation like Addition as shown above) in a readable language. The next step is to write the use cases in a similar way, that are enabled by your application’s features. Than the following step is to develop the step definition in Ruby (or Java) and to have Cucumber execute when it passes over the BDD text description.

 

As you can see in Figure 2, below, using the Calabash declarative query syntax, users can identify real OS level objects and perform the actions and use cases as seen above in an easy way on native and hybrid mobile apps. Calabash enables query for labels, web elements, text boxes and any other objects within native and web/hybrid apps. In the specific example below there is a simple way of entering text to a mobile native apps using setText option and then press Login using the Touch function.

Figure 2
Figure 2: Perfecto Mobile Android App object analysis achieved using Calabash

Digital quality

Eran Kinsbruner is the Lead Technical Evangelist at Perfecto and Author of the Digital Quality Handbook and Continuous Testing for DevOps Professionals books. He is formerly the CTO for mobile testing and Texas Instruments project manager at Matrix, Eran has been in testing since 1999 with experience that includes managing teams at ADT, Sun Microsystems, General Electric, and NeuStar. You can find Eran on Facebook, Twitter @ek121268, LinkedIn, and on his professional mobile testing blog at https://continuoustesting.blog/.

2 Comments

  1. Eran Kinsbruner, Lead Technical Evangelist
    Ashish Pandey May 14, 2015 at 1:23 am - Reply

    How we can test for iOS devices using Perfecto

    Can we execute scripts in Parallel on multiple devices.

    If i already have scripts created in Calabsh for my app, how i am going to test using Perfecto.

    Is Test automation in Perfecto for mobile devices done on emulator or Real devices.

    What plan we can take if we need to evaluate Perfecto Mobile.

    Quick response will be appreciated as need to Evaluate Perfecto ASAP.

    Thanks,
    Ashish

    • Eran Kinsbruner, Lead Technical Evangelist
      Roy Nuriel May 21, 2015 at 2:55 am - Reply

      Hi Ashish,

      Perfecto Mobile provide continuous quality Lab with real devices in the cloud. User connect to our cloud and interact with real devices around the globe.

      To your questions:

      1. In order to test iOS device you need to select iOs device from the list of devices and start to interact with it (manual, automation or performance).
      2. Automation scripts can run in parallel. Meaning each test can run on more than one device.
      3. Calabash – We implemented the integration with Calabash. This give you the ability to leverage your existing Calabash tests and execute them on our cloud. If you need more info please contact our support for guidance.
      4. Perfecto Mobile solution operated on real devices connected to real networks.

      In order to evaluate our solution I would encourage you to submit for the trial and get initial feeling on how the solution works. In addition contact us to get additional information and support.

      Good Luck,
      Roy

Leave A Comment