2019 Makeup
Q.no 3
Q.no 5
Test case for a function that checks if a given parameter is prime or not:
Test Case ID: PRIME_001
Test Case Summary: Verify that the function correctly identifies whether a given parameter is prime or not.
Precondition: The function for checking prime numbers is implemented and accessible.
Test Case Steps:
- Input: Provide a positive integer number as input, e.g., n = 7.
- Action: Execute the function to check if the input number is prime.
- Expected Result: Verify that the function correctly identifies whether the input number is prime or not.
– Execution Steps:
- Open the code editor and access the function for checking prime numbers.
- Input a positive integer value, e.g., n = 7.
- Execute the function and capture the result.
- Compare the result with the expected outcome.
Expected Result:
– For input n = 7, the expected result is true (since 7 is a prime number).
Pass Criteria:
– The function correctly identifies prime numbers, returning true for prime numbers and false for non-prime numbers.
– It handles positive integer inputs correctly and provides accurate prime number checks.
This test case ensures that the function accurately identifies prime numbers, meeting the expected result and adhering to preconditions.