Barcode Scanning for a web based application

In this article I will share some information about a recent barcode scanning implementation we did for a web based application for one of our clients.

Barcodes are nothing more than a machine readable form of data represented in the form of lines.  Nowadays, barcodes are an essential part of inventory management for a number of reasons. Firstly, saving time both in terms of data entry, and the automatic processing of the entries. Secondly, entry errors are reduced as the barcode scanning process has a very low error rate. Finally, barcodes help companies track the product across the entire production pipeline. Even after the product is shipped out, the company can track the product throughout its entire lifecycle.

Recently, we worked on a project for a client who wished to include barcode scanning capability in a personal health tracking software application. The required functionality was that the end-user could scan various food items and store the data in the applications web portal. This would allow the user to record their daily food intake conveniently, without wasting much time entering the data.

The first step in the implementation was a data import of standard food item barcodes, which we imported from an available data library. This gave us over 200,000 records of day-to-day food items of popular brands.

Since the users don’t typically own barcode readers, we required a solution that allowed the users to scan the barcodes using their personal electronic devices. Since most people carry mobile phones with a camera, we started looking into the option of using phone cameras as barcode readers.

Since we had a web-based application, it was preferable for us to use a client-side code library or plug-in. After evaluating a few possible options, we decided to use ‘QuaggaJS’ which is a JavaScript-based advanced barcode reader. ‘QuaggaJS’ can read various types of barcodes such as EANCODE 128CODE 39EAN 8UPC-AUPC-CI2of52of5CODE 93 and CODABAR.

‘QuaggaJS’ implements the following steps:

  1. Read the image and convert it into a binary representation
  2. Find the location and rotation of barcode
  3. Decode the barcode

We wanted to allow the users to scan barcodes using their laptop as well as mobile phones. We kept specific benchmarks about camera resolutions, and if a user’s laptop or mobile camera met those benchmarks, then they could scan the barcode. We also required an alternative solution for users with older mobile phones which did not have cameras that met the benchmark. We decided to let the user choose any of three options to enter a food on the portal:

  1. Live scan: using the mobile camera to scan the barcode
  2. File upload: upload an image of the barcode on the portal
  3. Manual entry: enter the barcode numerically

After entering the barcode, the user can look up various information about the item if it is in the library. The library includes valuable information such as calories, portion sizes, and nutritional content. Our goal was to make food tracking on the application very user friendly, and using barcode scanning we managed to provide the user a very quick and easy way to track packaged foods.

Feel free to contact us if you are interested in a similar implementation for your application.

Shift Left and Shift Right Testing practices

Agile and DevOps practices have gained popularity in the last few years, and embracing these practices has resulted in a significant change in the way software is developed and tested. It has been found that close collaboration between developers and testers, right from the initial development stage, is a key ingredient to delivering high quality products.

Agile testing is also referred to as Shift Left testing, whereas DevOps is referred to as Shift Right testing. This article aims to clarify the terminology, and to explain the practices involved in both. Reading this article will not only help you understand these practices, but will also give you insight into how to appropriately apply them.

The major difference between Shift Left and Shift Right testing practices, is the stage of the release cycle at which they are applied. Shift Left is applied during the development phase, and Shift Right is applied at the production stage.


What is Shift Left Testing?

Shift Left Testing, or Agile Testing, follows the philosophy ‘Test Early Test Often’. Our previous blog article on Agile Testing can be found here:

Shift Left Testing uses very early customer feedback to improve the quality of the release, allowing the product to reach the market sooner, and can therefore lead to a much better ROI.

There are a number of practices that can be included in Shift Left testing:

  • Unit Tests – Often created to make the development process more agile and improve the quality of code at the unit level. Developers usually write unit tests for component testing.


  • Service Virtualization – When developing software components there is likely to be a dependence on other components such as web services and APIs. For typical testing, these services need to be in place and running at the time of development. However, if these services are not available at the right time, it may lead to a dela Service virtualization involves simulating service behaviour such as requests and responses, and sample stubs of that specific service are used to continue with development and testing.


  • TDD (Test Driven Development) – TDD is a development technique where tests are written before code is written. This reduces the number of bugs from passing on to the next phase, as the tests allow for early detection of many errors.


  • BDD (Behaviour Driven Development) and Testing – BDD is a development technique where the focus is on building an application from an end-user and business perspective. BDD focuses on system-level behaviour rather than on component level behaviour. It requires developers, testers, BAs and business participants to understand and define application behaviour in different circumstances.


  • Load Testing – In this practice, the developer tries to understand system behaviour and performance under different peak conditions and tries to improve the system performance with heavy loading conditions in mind.

 Advantages of Shift Left Testing:

  • Testing Early Testing Often helps to catch defects early and reduces the cost of fixing errors.
  • Short feedback cycles from customers contributes to improvements in customer satisfaction.
  • Maximizing automated testing and minimizing manual testing helps the product to reach the market earlier.

 What is Shift Right Testing ?

Shift Right Testing, or DevOps, in the production environment can be seen as a post-production activity, where monitoring of the product performance provides feedback from end users.  It follows the philosophy that a continuous feedback loop between users and developers is essential for the success of the product.

With Shift Right testing, a completely built and fully functional application is tested by the real end-users and the real-time data is used to improve performance and remove functional bottlenecks in the system.

There are a number of practices that can be included in Shift Right testing:


  • API Monitoring – API performance and behaviour is monitored in the production environment using tools like Postman, AppDynamics and New Relic APIs.


  • A/B Testing – This refers to testing an application for various non-functional aspects like usability and The process involves comparing two versions of the same page and determining which performs better.


  • Canary Deployment – This is a deployment strategy to reduce the number of defects in production. In this strategy, the application is made available to a small subset of users first. The application performance and behaviour is then monitored for a short time period, usually a few days. Based on user feedback, a decision is made regarding whether or not the application is ready to be rolled out.

Shift Right Testing Advantages:

  • Shift Right practices are important for getting behaviour and performance data, which allows identification and removal of bottlenecks and improvement of application stability.
  • It allows for load and performance test scenarios which are almost impossible to achieve in development and test environments.
  • It provides increased test coverage and scope for automation to save time and effort.

 At Metasys, we have extensive experience in both Shift Left and Shift Right Testing practices, and follow both as per the project requirements.