Development Guide

Welcome to the Nexus development documentation. This guide covers everything you need to know to contribute to and develop with Nexus.

Contents:

Overview

This development guide is organized into several sections:

Getting Started

Architecture and Design

Development Workflow

Tools and Automation

Quality Assurance

Documentation and Release

Development Principles

Nexus development follows these core principles:

Quality First

  • Comprehensive testing (1539+ tests)

  • High code coverage (target: 100% for native platform)

  • Static analysis and MISRA C compliance

  • Continuous integration and automated testing

Developer Experience

  • Clear and consistent APIs

  • Comprehensive documentation

  • Easy-to-use build tools

  • Fast iteration cycles

Portability

  • Platform abstraction layers

  • Minimal platform-specific code

  • Consistent behavior across platforms

  • Easy porting to new platforms

Maintainability

  • Clean code architecture

  • Consistent coding standards

  • Comprehensive documentation

  • Regular refactoring

Development Workflow

Typical Development Cycle

  1. Plan: Review requirements and design

  2. Implement: Write code following standards

  3. Test: Write and run tests

  4. Review: Submit for code review

  5. Integrate: Merge after approval

  6. Validate: Verify in CI/CD

Feature Development

# 1. Create feature branch
git checkout -b feature/my-feature

# 2. Implement feature
# - Write code
# - Add tests
# - Update documentation

# 3. Verify locally
python scripts/building/build.py
python scripts/test/test.py
python scripts/tools/format.py

# 4. Commit changes
git add .
git commit -m "feat(module): add new feature"

# 5. Push and create PR
git push origin feature/my-feature

Bug Fix Workflow

# 1. Create bug fix branch
git checkout -b fix/issue-123

# 2. Reproduce bug
# - Write failing test
# - Verify bug exists

# 3. Fix bug
# - Implement fix
# - Verify test passes

# 4. Commit and push
git commit -m "fix(module): fix issue #123"
git push origin fix/issue-123

Code Quality Standards

Testing Requirements

  • All new code must have tests

  • Minimum 90% code coverage

  • All tests must pass before merge

  • Property-based tests for HAL implementations

Documentation Requirements

  • All public APIs must be documented

  • Doxygen comments for all functions

  • User guides for new features

  • Examples for complex functionality

Code Review Requirements

  • At least one maintainer approval

  • All CI checks must pass

  • All review comments addressed

  • Code follows style guidelines

Tools and Resources

Development Tools

  • CMake: Build system

  • Git: Version control

  • Python: Build scripts and tools

  • Doxygen: API documentation

  • Sphinx: User documentation

  • clang-format: Code formatting

  • clang-tidy: Static analysis

Testing Tools

  • Google Test: Unit testing framework

  • Hypothesis: Property-based testing (Python)

  • lcov/gcov: Code coverage

  • Valgrind: Memory analysis

  • AddressSanitizer: Memory error detection

Debugging Tools

  • GDB: GNU debugger

  • OpenOCD: On-chip debugger

  • J-Link: SEGGER debugger

  • ST-Link: STMicroelectronics debugger

CI/CD Tools

  • GitHub Actions: Continuous integration

  • Codecov: Coverage reporting

  • Doxygen: Documentation generation

Getting Help

If you need help:

  • Documentation: Read the relevant guide

  • Issues: Search existing issues on GitHub

  • Discussions: Ask questions in GitHub Discussions

  • Maintainers: Contact project maintainers

Contributing

We welcome contributions! See 贡献指南 for details on:

  • Reporting bugs

  • Suggesting features

  • Submitting pull requests

  • Code review process

Community Guidelines

  • Be respectful and constructive

  • Follow the code of conduct

  • Help others learn and grow

  • Share knowledge and experience

Next Steps

See Also