Score System Component Test Plan - UQcsse3200/2024-studio-3 GitHub Wiki

1. Introduction

This test plan outlines the strategy for verifying the functionality and reliability of the ScoreSystem class, which includes two main methods: compareLists() for comparing ingredient lists and getScoreDescription() for translating numerical scores into descriptive feedback.

2. Test Objectives

The primary objectives of this test plan are to:

  1. Verify the accuracy of the compareLists() method in calculating percentage matches between player ingredients and order ingredients.
  2. Ensure the getScoreDescription() method correctly translates numerical scores into appropriate descriptive feedback.
  3. Validate the handling of edge cases and invalid inputs in both methods.
  4. Confirm the overall reliability and robustness of the Score System Component.

3. Test Cases

3.1 Compare Lists Functionality

Test Case 3.1.1: Full Match

  • Test Method: testCompareListsFullMatch()
  • Objective: Verify that the method returns 100% when all ingredients match
  • Expected Result: Return 100 for identical lists

Test Case 3.1.2: Partial Match

  • Test Method: testCompareListsPartialMatch()
  • Objective: Verify correct percentage calculation for partial matches
  • Expected Result: Return 67 when 2 out of 3 ingredients match

Test Case 3.1.3: No Match

  • Test Method: testCompareListsNoMatch()
  • Objective: Verify 0% return when no ingredients match
  • Expected Result: Return 0 for completely different lists

Test Case 3.1.4: Empty Lists

  • Test Method: testCompareListsEmptyLists()
  • Objective: Verify correct handling of empty lists
  • Expected Result: Return 0 when both lists are empty

3.2 Score Description Functionality

Test Case 3.2.1: Grin Face Description

  • Test Method: testGetScoreDescriptionGrinFace()
  • Objective: Verify "Grin Face" return for scores 80-100
  • Expected Result: Return "Grin Face" for scores 100 and 80

Test Case 3.2.2: Smile Face Description

  • Test Method: testGetScoreDescriptionSmileFace()
  • Objective: Verify "Smile Face" return for scores 60-79
  • Expected Result: Return "Smile Face" for scores 79 and 60

Test Case 3.2.3: Neutral Face Description

  • Test Method: testGetScoreDescriptionNeutralFace()
  • Objective: Verify "Neutral Face" return for scores 40-59
  • Expected Result: Return "Neutral Face" for scores 59 and 40

Test Case 3.2.4: Frown Face Description

  • Test Method: testGetScoreDescriptionFrownFace()
  • Objective: Verify "Frown Face" return for scores 20-39
  • Expected Result: Return "Frown Face" for scores 39 and 20

Test Case 3.2.5: Angry Face Description

  • Test Method: testGetScoreDescriptionAngryFace()
  • Objective: Verify "Angry Face" return for scores 0-19
  • Expected Result: Return "Angry Face" for scores 19 and 0

Test Case 3.2.6: Invalid Score Handling

  • Test Method: testGetScoreDescriptionIllegalScore()
  • Objective: Verify exception throwing for invalid scores
  • Expected Result: Throw IllegalArgumentException for scores < 0 or > 100

4. Test Execution

  • Java Development Kit (JDK) version used in the project
  • JUnit testing framework used for testing

5. Conclusion

This test plan provides a comprehensive strategy for verifying the functionality and reliability of the Score System Component. By executing these test cases, we aim to ensure that the compareLists() method accurately calculates match percentages and the getScoreDescription() method provides appropriate feedback based on numerical scores. The test suite covers various scenarios, including edge cases and invalid inputs, to guarantee robust performance in different game situations. Regular execution of these tests will help maintain the quality and reliability of the Score System Component throughout the development process.

⚠️ **GitHub.com Fallback** ⚠️