Lab: Printf Testing |
![]() |
Objectives: |
At the conclusion of this lab, students will have created a black box test for a software application. | ||||
Background: |
Testing your code is one of the steps in developing a software application. There are several kinds of testing, but in this lab we will explore black box testing. In black box testing, you know the expected behavior of the application, but you do not see the code. From the lab on on the first day of class, you programmed many output statements to produce specific output formats for integer, double, and String values. In this lab, you will look at the behavior of Parts B and C. Your job will be to build a test to find bugs(defects) in the provided code. Use the PrintfLab.html to refresh your memory about what this application did. Use the specifications for B and C to build your test cases. |
||||
New Terms: |
|
||||
Materials: |
PrintfLabBug.class
lab-printf.php (The original lab) PrintfLab.html (documentation page) tst-99.in (sample input file 1 test case) tst-99.out (sample expected output file) printf-test.prog (the "test tester") |
||||
When: |
|
Professors Harris have built a solution to the printf lab, which you see in the Materials section. But because they are devious, they have also introduced some defects.
Your job will be to build a test to find the defects(bugs) in the instructors' code (given to you as PrintfLabBug.class above). A test is a series of test cases designed to exercise the code and demonstrate defects that exist in that code. A test case is one particular test run (one set of test values). Testing is one part of the debugging process. In this lab, your job is to identify all of the defective code in the provided appliction by designing a series of test cases to thoroughly check each of the different formats.
You cannot test every possible value through the application. Testers sample the values based on some standard strategies. You should:
For this lab, you will build two files for each test case. The first file will contain the input that you will use for the test case, and the second file will contain the output that you expect to see as a result. We have given you one input and one output file to use as a "starter", tst-99.in and tst-99.out respectively. Your files should follow these formats.