Skip to content

Developer Documentation for PANTHER¤

This guide provides technical details for contributors and maintainers of PANTHER. Learn about the codebase, design principles, and guidelines for extending the system.


Code Architecture¤

Overview¤

PANTHER is built with modularity and extensibility in mind. Key directories: - core/: Contains core logic for experiment execution and management. - config/: Handles experiment configurations and schema validation. - plugins/: Houses plugins for protocols, services, and environments. - outputs/: Stores logs and results.


Design Principles¤

  1. Modularity:
  2. Each component has a specific responsibility, making the system easier to extend and maintain.

  3. Dynamic Loading:

  4. Plugins and configurations are dynamically loaded to support extensibility.

  5. Error Handling:

  6. Comprehensive logging and exception management ensure robustness.

Key Components¤

ExperimentManager¤

  • Orchestrates the execution of experiments.
  • Responsible for initializing test cases, deploying services, and managing results.

TestCase¤

  • Represents individual tests within an experiment.
  • Encapsulates service deployment, step execution, and assertion validation.

PluginLoader¤

  • Dynamically loads and validates plugins (e.g., protocols, environments).
  • Handles Docker integration for plugins requiring containerized environments.

Adding New Features¤

  1. Define Requirements:
  2. Clearly define the feature's purpose and scope.

  3. Modify Core Components (if necessary):

  4. Update ExperimentManager or TestCase for new test types.

  5. Develop Plugins:

  6. Create new plugins in plugins/ if extending protocols or services.

  7. Update Configuration Schema:

  8. Modify config_schema.py to support new configuration options.

  9. Write Unit Tests:

  10. Add tests in tests/ to ensure feature reliability.

Refactoring Guidelines¤

  1. Follow DRY:
  2. Avoid duplicating code; extract common functionality into reusable functions.

  3. Preserve Backward Compatibility:

  4. Ensure existing experiments and configurations remain functional.

  5. Write Comprehensive Tests:

  6. Validate changes using unit and integration tests.

Error Handling¤

Logging¤

  • All components use Python’s logging module for structured logging.
  • Logs are saved in outputs/logs for debugging.

Exceptions¤

  • Raise meaningful exceptions with descriptive messages.
  • Catch and log exceptions in critical areas (e.g., ExperimentManager).

Contributing¤

  1. Fork the repository and create a new branch for your feature or bug fix.
  2. Run the tests to ensure stability:
    pytest tests/
    
  3. Submit a pull request with detailed explanations of your changes.

For additional guidance, consult the Main README or contact the development team.