# Gsoc2025Testing&Integration

**URL:** <https://talk.openelis-global.org/t/gsoc2025testing-integration/1078>\
**Category:** GSOC\
**Created:** [January 24, 2025, 5:46pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078 "2025-01-24T17:46:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayush\_Jha](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Ayush\_Jha](https://talk.openelis-global.org/u/Ayush_Jha)\
**Post date:** [January 24, 2025, 5:46pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/1 "2025-01-24T17:46:20Z")

</div>

Continuing the discussion from [Google Summer of Code (GSoC) 2025 Officially Announced](https://talk.openelis-global.org/t/google-summer-of-code-gsoc-2025-officially-announced/1045/11):  
hello @all  
I created this new topic to ask my personal doubts about the testing and integration process and to increase the coverage  
The first task is to understand the coverage report and solve the missing coverage one at a time

---

<div class="post-metadata">

**Author:** ![Ayush\_Jha](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Ayush\_Jha](https://talk.openelis-global.org/u/Ayush_Jha)\
**Post date:** [February 4, 2025, 7:04pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/2 "2025-02-04T19:04:53Z")

</div>

Is it just me or the codebase is really tough to understand  
can somebody give hints or bifurcations of the service and controller layers.  
I feel like there is too much to look at.  
somebody guide me please I have gone through the files(not all) but I just keep getting confused.

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [February 4, 2025, 7:09pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/3 "2025-02-04T19:09:45Z")

</div>

where specifically do you want guidance @Ayush_Jha

---

<div class="post-metadata">

**Author:** ![Vickabire](https://avatars.discourse-cdn.com/v4/letter/v/47e85d/32.png) [@Vickabire](https://talk.openelis-global.org/u/Vickabire)\
**Post date:** [February 4, 2025, 8:16pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/4 "2025-02-04T20:16:47Z")

</div>

We have both the frontend and backend in the same repository.

Now to locate the controllers, service layer methods, you need to click in each subdirectory representing an object used in openelis. For example: [OpenELIS-Global-2/src/main/java/org/openelisglobal/patient at develop · I-TECH-UW/OpenELIS-Global-2 · GitHub](https://github.com/I-TECH-UW/OpenELIS-Global-2/tree/develop/src/main/java/org/openelisglobal/patient), when you click patient, you fill find the other subdirectories related to the patient i.e service, controller, value…etc.

---

<div class="post-metadata">

**Author:** ![Ayush\_Jha](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Ayush\_Jha](https://talk.openelis-global.org/u/Ayush_Jha)\
**Post date:** [February 5, 2025, 6:36pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/5 "2025-02-05T18:36:57Z")

</div>

@Agaba_Derrick_Junior  
see classes like `PatientService` and `TestService`, but I’m not clear on:  
How business logic is split between these services (like what belongs to `PatientService` vs. `PersonService`).

---

<div class="post-metadata">

**Author:** ![Ayush\_Jha](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Ayush\_Jha](https://talk.openelis-global.org/u/Ayush_Jha)\
**Post date:** [February 5, 2025, 6:38pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/6 "2025-02-05T18:38:13Z")

</div>

and also like how the service layer talks to the controllers. Like, when a controller calls `PatientService`, what exactly happens? How do DAOs fit in? And I’m not sure where business logic lives vs. basic CRUD stuff. CAn you like point me to one simple flow (e.g., fetching a patient) to see how the layers connect? or just give example.

---

<div class="post-metadata">

**Author:** ![Ayush\_Jha](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Ayush\_Jha](https://talk.openelis-global.org/u/Ayush_Jha)\
**Post date:** [February 5, 2025, 6:52pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/7 "2025-02-05T18:52:32Z")

</div>

Also Like suppose for

> patientreport.java

the test coverage shows very low So do we need write the unit tests also right? Because it would be more beneficial  
if I start with unit tests and then move to integration test which is the actual task.

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [February 5, 2025, 7:01pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/8 "2025-02-05T19:01:21Z")

</div>

Basically the **PatientService** handles patient-specific business logic (like `getSubjectNumber()` or `getNationality()`), while **PersonService** manages personal details (e.g., name, birthdate). **DAOs** handles basic CRUD operations, querying the database and acting as a bridge between the application and the database.

an example in the [Patient’s Test](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/develop/src/test/java/org/openelisglobal/patient/PatientServiceTest.java)

- `patientService.get( )` which fetches a patient.
- `patientService.insert(patient)` and this saves a patient and its a (basic CRUD).
- `patientService.getSubjectNumber(patient)` returns business logic tied to the patient.

hope this is rich enough to break it down

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [February 5, 2025, 7:04pm UTC](https://talk.openelis-global.org/t/gsoc2025testing-integration/1078/9 "2025-02-05T19:04:50Z")

</div>

The most important task is to begin with Intergration tests [see example](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/develop/src/test/java/org/openelisglobal/dictionary/service/DictionaryServiceTest.java)
