Score System Component Test Plan - UQcsse3200/2024-studio-3 GitHub Wiki
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.
The primary objectives of this test plan are to:
- Verify the accuracy of the
compareLists()
method in calculating percentage matches between player ingredients and order ingredients. - Ensure the
getScoreDescription()
method correctly translates numerical scores into appropriate descriptive feedback. - Validate the handling of edge cases and invalid inputs in both methods.
- Confirm the overall reliability and robustness of the Score System Component.
-
Test Method:
testCompareListsFullMatch()
- Objective: Verify that the method returns 100% when all ingredients match
- Expected Result: Return 100 for identical lists
-
Test Method:
testCompareListsPartialMatch()
- Objective: Verify correct percentage calculation for partial matches
- Expected Result: Return 67 when 2 out of 3 ingredients match
-
Test Method:
testCompareListsNoMatch()
- Objective: Verify 0% return when no ingredients match
- Expected Result: Return 0 for completely different lists
-
Test Method:
testCompareListsEmptyLists()
- Objective: Verify correct handling of empty lists
- Expected Result: Return 0 when both lists are empty
-
Test Method:
testGetScoreDescriptionGrinFace()
- Objective: Verify "Grin Face" return for scores 80-100
- Expected Result: Return "Grin Face" for scores 100 and 80
-
Test Method:
testGetScoreDescriptionSmileFace()
- Objective: Verify "Smile Face" return for scores 60-79
- Expected Result: Return "Smile Face" for scores 79 and 60
-
Test Method:
testGetScoreDescriptionNeutralFace()
- Objective: Verify "Neutral Face" return for scores 40-59
- Expected Result: Return "Neutral Face" for scores 59 and 40
-
Test Method:
testGetScoreDescriptionFrownFace()
- Objective: Verify "Frown Face" return for scores 20-39
- Expected Result: Return "Frown Face" for scores 39 and 20
-
Test Method:
testGetScoreDescriptionAngryFace()
- Objective: Verify "Angry Face" return for scores 0-19
- Expected Result: Return "Angry Face" for scores 19 and 0
-
Test Method:
testGetScoreDescriptionIllegalScore()
- Objective: Verify exception throwing for invalid scores
- Expected Result: Throw IllegalArgumentException for scores < 0 or > 100
- Java Development Kit (JDK) version used in the project
- JUnit testing framework used for testing
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.