GSoC 2023: Enhancing Component Test Coverage and Quality for OpenMRS3

 

Primary mentor

@Piumal Rathnayake               

Backup mentor

@Anjula Samarasinghe 

Assigned to

@Ayush Mishra 

Summary

OpenMRS consists of several micro frontend modules and repositories, most of which have unit and integration tests written by individual developers. However, these tests exhibit inconsistencies due to the diverse testing strategies used by different developers. To address this issue, there is a need for a consistent and comprehensive test strategy or framework for the unit and integration tests of OpenMRS3, aimed at achieving a high level of test coverage. Refer to this document for more information.

 

Objectives

  • Enhancing Component Test Coverage and Quality for OpenMRS3

Expectations

The testing strategy, technologies and best practices are already defined in this document. The student has to go through the document to get a clear understanding before applying. The following requirements have to be fulfilled at the end of the project.

  1. Rewrite the existing integration tests to work with MSW (Mock service worker)

  2. Improve the Unit and Integration test coverage

    • By Writing the missing tests

    • By Improving the existing tests

Skills Needed

  • Fundamental knowledge of OpenMRS microfrontends (Setting up the environment, Basic knowledge on O3 repositories)

  • React

  • TypeScript

Project Rating and length

Medium

175 hours

Detailed Project Report

Introduction

Testing plays a pivotal role in the software development process, ensuring that software aligns with anticipated quality standards and functions as intended. Additionally, it aids in early bug and error detection, potentially preventing issues from arising. Furthermore, testing serves as valuable documentation, offering insights into how the software functions and the expected outcomes of specific interactions.

Overview

The main aim of the project was to improve the overall code quality of OpenMRS3 by enhancing the component test coverage. It was mainly focused on esm-patient-management repo. I have worked on patient-management repo and increased the coverage from 40% to 72%. We can work further to improve the coverage on this repo and then we can move to other repos like esm-patient-chart etc.

Initial Test Coverage for patient-management-repo:

 

 

Current Test Coverage for patient-management-repo:




Pull Request: 

https://github.com/openmrs/openmrs-esm-patient-management/pull/667 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/672 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/678 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/680 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/690 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/691 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/707 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/709 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/741 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/747 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/749 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/750 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/751 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/760 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/762 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/766 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/767 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/770 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/771 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/772 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/777 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/778 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/779 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/780 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/781 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/782 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/783 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/784 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/785 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/787 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/788 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/789 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/790 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/791 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/793 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/794 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/796 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/797 merged

https://github.com/openmrs/openmrs-esm-patient-management/pull/748 InReview

https://github.com/openmrs/openmrs-esm-patient-management/pull/786 InReview

https://github.com/openmrs/openmrs-esm-patient-management/pull/792 InReview

https://github.com/openmrs/openmrs-esm-patient-management/pull/732 InProgress

Issues

https://issues.openmrs.org/browse/O3-2063
https://issues.openmrs.org/browse/O3-2214
https://issues.openmrs.org/browse/O3-2288
https://issues.openmrs.org/browse/O3-2328
https://issues.openmrs.org/browse/O3-2329

Weekly Blogs

Documentation

Milestone Docs

Talk thread

Testing Documentation

Final Presentation

Resources