Skip to content

VER-229: [Backend] Randomize Top-Rated Snippets on Landing Page #205

@nhphong

Description

@nhphong

As a user, I want the top-rated snippets on the landing page to be randomized so that I see varied content and other high-quality snippets have a chance to be displayed.

Acceptance Criteria:

  1. Current Criteria Compliance:
    • The system should continue to select snippets that have the highest confidence score and at least one user_starred relation.
  2. Random Selection:
    • When multiple snippets share the highest confidence score, the system should randomly select 10 snippets to display on the landing page.
  3. Fair Visibility:
    • Ensure that the randomization logic provides fair visibility to all snippets with the highest confidence score and a user_starred relation.
  4. Performance:
    • The random selection process should not significantly impact the loading time of the landing page.
  5. Testing:
    • Implement unit and integration tests to verify that the randomization logic works as expected.
    • Test scenarios where:
      • There are fewer than 10 snippets with the highest confidence score.
      • There are exactly 10 snippets with the highest confidence score.
      • There are more than 10 snippets with the highest confidence score.

Tasks:

  1. Analyze the current logic for selecting snippets for the landing page.
  2. Design the randomization algorithm to select 10 snippets when multiple snippets share the highest confidence score.
  3. Implement the randomization logic in the codebase.
  4. Write unit tests to verify the randomization logic.
  5. Conduct performance testing to ensure the randomization does not degrade page load times.
  6. Update documentation to reflect changes in the snippet selection process.

Additional Notes:

  • Consider using a randomization library or function that ensures uniform distribution of snippet selection.
  • Review the user experience to ensure that the randomization enhances content discovery.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions