Hello OpenELIS Community!
I will be giving my updates on the Backend Integration Testing project for GSoC 2026. Building on the foundation laid during the contributions from the previous couple of years where we established the core infrastructure and reached a 28% coverage baseline, this year’s project aims to scale up significantly, targeting a 60%+ coverage goal for all critical backend components.
Project Goal
This project aims at extending and creating more Integration Tests to achieve a Test Coverage of at least 60% for the Backend Service and Controller Layer
To standardize the backend integration testing workflow, increase test coverage across the 5-layer architecture (Service, DAO, Controller), and implement complex workflow-based integration tests using modern infrastructure (Testcontainers, DBUnit)
Project Background (Evolved from previous community contributions)
For the 2 last years, we established a Dataset-Driven Testing Strategy, ensuring realistic scenarios by using actual data instead of mocks. This year, we are moving beyond simple CRUD tests to focus on deep business logic and cross-component interactions.
Current Gaps
After an initial analysis of the current state, I’ve identified several key areas for GSoC 2026:
- Controller Layer Coverage: Many REST and Spring MVC controllers are currently excluded from component scanning in the test context (
AppTestConfig) to prevent circular dependencies. This leaves a gap in testing the web layer’s interaction with the service layer. - Infrastructure Mocking Boundaries: While we successfully mock external services (FHIR, Odoo, Mail) for isolation, we lack standardized patterns for verifying the outgoing data structure to these systems.
- Complex Workflow State: Most tests reset the database state between methods. This makes it difficult to test multi-step laboratory workflows (e.g., Sample Receipt → Analysis → Result → Validation → Release) as a single cohesive unit.
- Data Setup Friction: Manually creating DBUnit XML datasets for complex entities like Samples and Patients remains a bottleneck.
- Standardization: Some older integration tests do not yet follow the “Gold Standard” (based on
MenuServiceTest.java), leading to inconsistent test reliability.
Proposed Implementation Plan
My project will be divided into the following key milestones:
Milestone 1: Infrastructure & Standardization
- Refactor
AppTestConfigto support more granular bean registration, allowing more controllers to be tested viaMockMvc. - Audit and migrate existing integration tests to the
BaseWebContextSensitiveTeststandard. - JaCoCo Integration: Ensure JaCoCo is strictly measuring and tracking coverage for all newly added tests to maintain data-driven progress.
Milestone 2: Core Service & Controller Expansion
- Increase integration test coverage for the Patient, Sample, and Result modules.
- Ensure comprehensive coverage of CRUD operations, data retrieval, business logic validation, and error handling.
- Goal: Happy-path and error-path integration tests for every REST endpoint in these modules.
Milestone 3: Complex Workflow Testing
- Implement “Scenario Tests” that simulate full laboratory cycles.
- Develop shared datasets (
full-lab-workflow.xml) that can be used across multiple test suites to ensure data integrity across the entire stack.
Milestone 4: Tooling & Documentation
- Explore/Implement a Java-based DSL or Builder pattern for generating test data dynamically.
- Finalize the “OpenELIS Integration Testing Handbook” for future contributors.
Stay Updated
I will be documenting my journey, technical hurdles, and milestones regularly. You can follow my progress and read detailed deep-dives on my Medium blog.
Discussion Points
I would love to hear from mentors and community members:
- Are there specific “high-risk” modules that you feel are currently under-tested?
- What are the most common “integration bugs” you’ve encountered that unit tests missed?
- Any preferences on data generation tools?
Looking forward to your feedback and ideas
cc: @Herbert @pmanko @Moses_Mutesasira @reagan @tasksolver @mherman22