Faster Goto Market (GTM) is always an underlying goal to reap the fruits of the labor, for every product development organisation. Quality, as it's common known for, always comes with a price, and is usually a determining factor in Faster GTM conversations. Its always perceived that the best of both the worlds of faster GTM and good quality can never co-exist and one need to compromised for the other.
At Halodoc, this is an interesting challenge that we have attempted to solve for our web applications by using Agile Web Automation, which enables us to go faster to market without compromising on quality.
How can we go faster to market with agile automation testing?
Each release in a nutshell, consists of development, testing and validation of the new code and deployment post the QA certification.
During the phase of validation when everything is done, someone still has to do some investigation hoping to discover whether or not all the recent code churn introduced any (surprising) problems. This last part, the regression testing, either takes too long or is crunched for time, and is usually a victim of getting impacted/compromised in favour of meeting a deadline.
How did we overcome this
UI automation is typically developed on a lag of at least one sprint. The test code being written right now might be for a code change that has been in production for weeks or months. At best, this will only tell you when something on the page changes. To tackle this - why not build automation in-sprint?
An alternate strategy for UI automation - use it to propel features forward into production faster. Shift left!
How does it work
In-sprint automation looks something like this
- At Halodoc ,we use Cucumber-TestNG BDD approach to automate our tests using POM(Page Object Model) design pattern, which forms the core of the framework
- Behaviour Driven Development (BDD): An integral part of the framework, this enables us to derive the use cases into test cases in a human readable format, much earlier in the development phase once the design is frozen, promotes effective understanding between the teams(tech/non-tech) and the stakeholders.
- Page Object Model(POM) design pattern: The design pattern widely used for Selenium automation, one class file for each page of the application under test. This class will have all Web Elements and all the possible method on that page. This pattern also adheres to the popular software development practice the DRY principle(Don’t Repeat Yourself), means that each piece of logic should be coded once and only once. The duplicate code makes the code harder to maintain.
Main components of an automated test with Cucumber Automation are:
- Feature files Building blocks of a test, scenario flows, in turn a functional test plan.
- Page Objects UI locators for a page. (A locator is an entity, upon click of which we can expect an action).
- Use of Behavior Driven Development (BDD) to create functional tests quickly and to simplify the testing process.
- Use of Gherkin (Given-When-Then) syntax to define flows.
- Utils Webdriver, Runner class and generic methods.
Automation starts with development phase:
- Developers write their new features sprinkling in unit and API testing where appropriate.
- Once the UI is close to done, they work more closely with the QAs.
- Developers provide the static html pages, which allows the QAs to build the basic skeleton structure model i.e Page Object model needed for the Cucumber framework.
- This skeleton structure is further enhanced by the building blocks in Cucumber i.e is the feature file, which provides a flow to the test.
- Once the backend APIs are integrated on the development side, these flows should work with minimal tweaks since the requirements are frozen before the sprint.
Examples of basic tests:
- Basic smoke - field validations
- Basic sanity - new feature checks
- Enhancing existing regressions
System - Regression testing:
- By the time the important coverage for that feature is built, the new code change has been explored and had rounds of bug fixing.
- The coverage problem also gets much easier.
- Instead of a person performing similar tests in 5 different web browsers, a script can run in all of the browsers in parallel while a person looks for far more important problems.
- Shift testing all the way to the left—to your business requirements design phase.
- Early testing in the development phase.
- Redundant task diminishes to a greater extent.
- Automated test scripts can be run sooner, resulting in detecting defects earlier and reducing the amount of resources used to fix issues, before they make it to production.
- Collaboration within the teams and increases the release velocity.
As we have quoted above, the benefits of Agile Web Automation framework which aims at shifting the testing all the way to the left (to the design phase) has really compelled us to adopt this framework for our mainstream web development. This has clearly helped us in achieving our goal of faster GTM without compromising on quality.
Come Join us :
Scalability, reliability and maintainability are the three pillars that govern what we build at Halodoc Tech. We are actively looking for engineers/architects/testers and if solving hard problems with challenging requirements is your forte, please reach out to us with your resumé at firstname.lastname@example.org.
Halodoc is the number 1 all around Healthcare application in Indonesia. Our mission is to simplify and bring quality healthcare across Indonesia, from Sabang to Merauke.
We connect 20,000+ doctors with patients in need through our Tele-consultation service. We partner with 2500+ pharmacies in 100+ cities to bring medicine to your doorstep. We've also partnered with Indonesia's largest lab provider to provide lab home services, and to top it off we have recently launched a premium appointment service that partners with 500+ hospitals that allows patients to book a doctor appointment inside our application.
We are extremely fortunate to be trusted by our investors, such as the Bill & Melinda Gates foundation, Singtel, UOB Ventures, Allianz, Gojek and many more. We recently closed our Series B round and In total have raised USD$100million for our mission.
Our team work tirelessly to make sure that we create the best healthcare solution personalised for all of our patient's needs, and are continuously on a path to simplify healthcare for Indonesia.