A Developer’s Tale: Using Microsoft technologies to integrate Myzone device with Genavix application

It is no secret that digital technology is slowly shaping the future of the healthcare industry. The use of fitness tracking devices has grown rapidly, the philosophy being ‘that which gets measured can be improved’. The MetaSys team has worked on integrating tracking devices with Fitness and Nutrition Applications.  This article describes one such achievement, namely integration of Myzone into our clients’ application.

Our client: Genavix is a venture in the preventive health care services industry. It offers members comprehensive health and fitness solutions to reduce health risks and improve wellness. They provide various fitness and nutrition plans helping associates follow a healthy lifestyle.

About Myzone: Myzone is an innovative wearable heart rate based system. It uses wireless and cloud technology to monitor physical activity. Myzone allows the user to view their fitness efforts live on their phone, such as how many calories they are burning. Users are also able to make connections and compete with other individuals in the network. Based on their fitness efforts, users are awarded MEPs (Myzone Effort Points), which they can use to challenge others on the platform.

We at MetaSys were given the task of integrating the Myzone system with our client’s application. Our solution used the fact that each Myzone device has a unique belt number, which is registered with a particular wellness facility. Users are able to submit their Myzone belt number, after which a unique ID is assigned to their profile. The client system can then track all Myzone activities.

One of the challenges we faced in the integration, was that the data obtained from the Myzone API is only available for the last three months. As a long term health app, our client tracks fitness for a much longer duration. To resolve this issue, we decided to import the data every night by creating a task scheduler, which imports data from the Myzone API into the application SQL tables.

Each wellness facility with registered Myzone belts has a unique API key. Using this API key and Myzone Cloudbase API – 2.0.3, a web request API call is made which retrieves Myzone API data of each user in the previous three months. The data is received in JSON (JavaScript Object Notation), is then interpreted in Asp.net and imported into the application SQL tables. The imported data is used to build a user fitness diary that integrates the Myzone data with data that has been manually entered in the application by the user. The detailed tracking of fitness, such as tracking calories is used to help every user, achieve their daily health and fitness goals.

If you wish to collaborate on similar projects, feel free to contact us. We have extensive experience in integrating devices into web applications such as ASP.NET Framework, JavaScript, jQuery, Microsoft SQL Server. For more details, please visit – https://www.metasyssoftware.com/dot-net

 

Few tips to help you get better at building app features through Unit Testing

At MetaSys, we place great importance on writing unit tests, as it leads to faster development and reduces the time it takes for software to get to the production stage.Unit testing is the first step of software testing, where individual units/components of a software are verified. A unit refers to the smallest module of any software, and usually has one or more inputs and often a single output. The purpose of unit testing is to check whether the units are working as expected.

Unit tests help in finding regressions, test error cases and reduces the requirement for manual testing significantly. Unit tests also help in improving the code quality, e.g. if you are not able to write a unit test for a particular scenario, then it typically means that the code needs to be refactored. For a better understanding of the topic, I recommend reading Kent Beck’s book on unit testing ‘Test-Driven Development by Example’.
Having said that, here are my comments on Unit testing –

● Any *newly*developed app feature should not be considered complete until a unit test has been performed. This means, the development estimates should always include the unit testing time. For example, a developer might build a feature without writing a unit test and perform manual testing instead for which he might spend 24 hours plus an additional 24 hours to fix bugs and regressions. Instead, it would be better to spend 48 hours or less for building a feature by writing the unit tests, as it will ensure that the code quality is better. The developer will have more confidence in the code after completing the unit test. Unit testing is particularly useful for identifying regression bugs, as the same tests can be reused to prevent future regressions.

● Some existing applications do not have any unit tests because they have been developed by developers who have not prioritized unit testing, or may not have been aware of its benefits. When new developers who are aware of unit test concepts start working on the application, they should not necessarily interrupt the work to start writing unit tests for all components immediately. Instead, the process can be undertaken gradually. For instance, if they are working on specific components that lack tests, they should take the opportunity to write unit tests, at least to verify the newly added functionality. It is important that the project manager takes care of estimates for development time for writing unit tests for old components. Over time the code coverage for these components will increase and at some point in time, it may become sensible to set a goal specifically to increase test coverage.

Advantages of unit testing –
1. It reduces the level of bugs in the production environment.
2. It builds confidence in the developer.
3. It allows the code to be easily refactored or changed.
4. Regression bugs can be caught easily.

Disadvantages of unit testing –
1. In our experience, writing unit tests requires about 20-30% more time at the beginning of the project. For a complicated project, it may require even more time.
2. If the architecture/design of the project is not correct from the beginning, then tests need to be rewritten when the project is re-architected. This can turn into a major time loss.
3. For big/complex projects, unit testing alone is not enough. Typically, integration tests and e2e tests will be required alongside the unit tests to have proper test coverage.

As developers, we always look to reduce costs whilst still fulfilling all the project requirements. Unit testing can play a big role in achieving this. Unit testing helps any developer to produce bug-free and quality software with confidence.
Over the years, MetaSys has successfully built a robust testing environment to build custom software solutions. Feel free to reach us and do share your feedback in the comments section below.