optittm / bugprediction

A CLI tool to assess the risk of releasing your next version. Can generate a comprehensive dataset for testing your bug prediction models.
MIT License
0 stars 1 forks source link

Proposed Changes for TOPSIS Configuration and Unit Tests #73

Closed FredericDymko closed 1 year ago

FredericDymko commented 1 year ago

This pull request introduces significant updates to the TOPSIS analysis functionality in order to provide better configurability for users. The primary objective is to allow users to configure TOPSIS analysis using environment variables, making it easier to parameterize the analysis according to specific project requirements.

  1. New Configuration Options
    • Introduces new environment variables for configuring TOPSIS analysis, such as TOPSIS_CRITERIA, TOPSIS_WEIGHTS, and TOPSIS_ALTERNATIVES.
  2. CriterionParser and AlternativesParser
    • Added two new utility classes, CriterionParser and AlternativesParser, to facilitate parsing criteria and alternatives with their respective weights and names.
    • CriterionParser now raises appropriate exceptions (e.g., InvalidCriterionError, MissingWeightError, and NoCriteriaProvidedError) to handle different validation scenarios when parsing criteria.
  3. Improved TOPSIS Command
    • Modified the topsis command to utilize the new CriterionParser and AlternativesParser for parsing criteria and alternatives.
    • The topsis command now also has a more detailed docstring explaining its purpose, input parameters, and possible exceptions.
  4. Added Unit Tests
    • Included comprehensive unit tests for the new functionality, ensuring proper parsing of criteria and alternatives, and handling various validation scenarios.

All changes have been thoroughly tested locally to ensure their correctness and maintain functionality with existing code. Unit tests have been included to validate the new parsing classes and verify the expected behavior of the TOPSIS analysis.

[How to Use the New Configuration Options] With the new environment variables introduced, users can now easily configure the criteria and alternatives for TOPSIS analysis by setting the appropriate environment variables. Detailed documentation on how to use these environment variables has been added to the project's .env-example file.

Please review the proposed changes and provide feedback. These enhancements aim to make TOPSIS analysis more user-friendly and configurable, empowering users to fine-tune the analysis based on their specific project needs.