CSE1020 Week 8 Tutorial

Task 1: Black-Box Testing - Can You See Me Now?

Black-box testing involves testing a program without knowledge of its code. Instead, you evaluate its correctness by providing carefully chosen input and comparing the actual output to the expected output.

Example
Create a program to calculate the square root of a user-specified number. The program must satisfy the following specifications:

Solutions
The class files below represent solutions to the aforementioned problem. They have been submitted to you for testing. Only one satisfies the all of the specifications.

Which solution is correct? Remember, you can create files containing a test value and redirect input. If test1.txt contains your test value, enter the following at the prompt: java Solution1 < test1.txt. The following test files should help you:

For each test input, determine the correct output. Remember, you can use the cat command to display the contents of each file.

Each test case aims to prove violation of a specification. Which specification does each input evaluate?