Best Practices¶
Openwater is committed to supplying high-quality, safe, and reliable products and services. The Quality Statement is published on the OpenwaterHealth GitHub organization.
Openwater recommends that all developers follow open-source standards along with the appropriate regulatory standards for the region of development. Contact your local authorities for a complete list of applicable rules and regulations.
Development lifecycle¶
Open-LIFU software follows a modular, iterative, and incremental development lifecycle aligned with the principles of IEC 62304. Development is managed through:
- Version-controlled repositories (Git + GitHub)
- Feature-driven development with issue tracking and pull requests
- Milestone-based delivery and release tagging
Each major software component — firmware, FPGA logic, Python SDK, test tools — is maintained in its own repository.
Design philosophy¶
Openwater designs and processes are governed by our Quality Management System and abide by these core principles:
- Safety-first. Built-in safety systems ensure operation within regulatory limits.
- Open standards. All product designs are released, enabling academic and commercial use with attribution.
- Modularity. Component-based architecture allows customization of individual subsystems without redesigning the entire platform.
- Accessibility. Designed to be manufacturable using standard fabrication methodologies and widely available off-the-shelf components.
- Collaborative iteration. A transparent, safety-prioritized feedback loop gathers community input and contributions through an open-source platform.
Configuration and change management¶
- All source code and build tools are maintained in Git repositories
- Each commit is tracked, reviewed, and tagged
- Issues and bugs are logged in GitHub Issues with associated milestones
- Change logs are maintained per release
- Critical changes are subject to peer code review
Versioning¶
Versioning follows Semantic Versioning (SemVer):
| Increment | Meaning |
|---|---|
| MAJOR | Breaking architectural or API changes |
| MINOR | New backward-compatible features |
| PATCH | Bug fixes or performance improvements |
Verification & validation¶
- Unit tests implemented for embedded firmware and Python code
- Manual and automated test procedures executed on every release:
- USB streaming verification
- Histogram decoding accuracy
- Frame sync and laser timing tests
- Full-system functional regression tests
- Test logs, waveform captures, and timing measurements are archived for traceability
Documentation¶
Software is documented using:
- In-code documentation (docstrings, comments)
- GitHub README files
- Architecture and design documentation in Word and Markdown
User documentation is provided for:
- SDK usage
- CLI tools and GUI
- Developer onboarding
Maintenance strategy¶
- Bug reports and feature requests are triaged on GitHub
- Routine releases are issued quarterly or as needed
- Backward compatibility is maintained within major versions
- Deprecated features are clearly marked and scheduled for removal in future releases
Firmware best-practice guidelines¶
Embedded firmware (STM32)¶
- Developed in C, using STM32Cube HAL and CMSIS
- MISRA C guidelines applied where practical to improve safety, portability, and static-analysis results
- Code structured for:
- Readability — clear naming, small functions, single responsibility
- Safety — defensive programming, bounds checking, explicit initialization
- Testability — hardware abstraction, minimal global state
Additional best practices:
- Use explicit-width types (
uint32_t,int16_t) for all interfaces and registers - Avoid hidden side effects in macros; prefer
static inlinefunctions - Initialize all peripherals and state explicitly; do not rely on reset defaults
- Separate driver, middleware, and application logic
- Use assertions and error return codes for fault detection
- Guard ISR code for minimal execution time and deterministic behavior
- Enable compiler warnings (
-Wall -Wextra) and treat warnings as errors where feasible
Software best-practice guidelines¶
Python SDK and GUI tools¶
- Compliant with PEP 8 and fully type-annotated using
typing - Modular design with clear separation of:
- Hardware interface / transport
- Data processing and analysis
- GUI and user interaction
- Tested on Python 3.10+ on Windows 11 and Linux
Additional best practices:
- Use dataclasses or typed models for structured data
- Avoid hardware access in GUI threads; use async or worker threads
- Validate all external inputs and device responses
- Centralize error handling and logging
- Write unit tests for protocol parsing and data processing
- Keep hardware interfaces mockable for offline testing
- Document public APIs and SDK usage with docstrings
License¶
Open-LIFU uses several licenses by component. The reciprocal firmware and scientific core is assigned AGPL-3.0-or-later; applications, SDKs, tools and integrations are assigned Apache-2.0; hardware reference designs have an approved CERN-OHL-S-2.0 destination; and documentation and sample data use CC-BY-4.0. Some repositories still carry earlier license files while rights-reviewed relicensing is in progress.
Read the current LICENSE and file-level notices in the specific repository before reusing a component. See the licensing overview and the organization contribution policy.