Professional Documents
Culture Documents
Lab 4
Lab 4
2. Assignment 2
3. Assignment 3
$ testing against requirement
2. Outputs: test cases that cover all possible outputs (or all possible classes of outputs)
Given a positive integer, is the number prime?
• Inputs:
• 1 (smallest positive integer)
• 2 (smallest prime)
• Outputs:
• 3 (something that is prime)
• 4 (something that is not prime)
$ Example : prime
● For conditionals, use test cases that cover the execution of both the true-block and
the false-block.
● For loops, use test cases that cover the execution of 0-iteration and k-iteration (k >=
1).
● Use test cases that trigger the boundary cases of if-condition / terminating condition.
$ Example : prime
● For conditionals > true-block and
the false-block.
● Fixed-length arrays
● Coding style !