Q&A Notes: Testing


When writing test cases, we identify a set of inputs going into a function, and then we compare actual output to expected output to determine whether the test passed.

Given some example test cases for the following function:

  1. int Add( int a, int b );

    This function takes in two numbers and returns the sum of them

    Test # Inputs Expected output
    1    
    2    
  2. int Max( int a, int b );

    This function takes in two numbers and returns the larger of the two

    Test # Inputs Expected output
    1    
    2    
  3. int Sum( int arr[], int arrSize );

    This function takes in an array of numbers and returns the sum

    Test # Inputs Expected output
    1    
    2    

Author: Rachel Wil Sha Singh

Created: 2023-09-10 Sun 17:05

Validate