You are on page 1of 10

CS1010

Lab Group C04


$ today
1. Testing

2. Assignment 2

3. Assignment 3
$ testing against requirement

1. Inputs: test cases that cover boundary input values

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.

● For loops > of 0-iteration and k-


iteration (k >= 1).

● trigger the boundary cases of if-


condition / terminating condition.
$ Example : nine
● The program nine reads a positive number
from the standard input and prints out the
position of the least significant occurrence
of 9. If the number 9 does not appear in the
given number, print 0.
$ Example : nine
● For conditionals > true-block and the false-
block.

● For loops > of 0-iteration and k-iteration (k


>= 1).

● trigger the boundary cases of if-condition /


terminating condition.
$ as02 - collatz
$ as03
● Due after recess week ( two weeks yay!😁)

● Fixed-length arrays

● Coding style !

● 3 marks efficiency marks for padovan

● Check constraint ( no loops/no conditions/ specific function)

You might also like