CS576: Assignment 3

Introduction

The goals of this assignment are to: (a) create a white-box test suite for each class of the ATM (Automatic Teller Machine) simulator; (b) use junit to automate the white-box test suite; (c) use emma to assess the code coverage of the white-box testing suite.

In the second assignment you automated the black-box testing execution process by developing a testing suite, using junit, that exercised the ATM via a newly created API. You also employed the emma tool to assess the code coverage of your test suite.

In this assignment you are asked to create white-box tests for each class of the ATM code. Specifically, you are asked to create a junit test file that corresponds to each class in the ATM code distribution. These junit test files will test the methods of each class as well as testing the protocol of each class (when this is appropriate because some classes do not have an explicit or implicit protocol). For example, if a class implements a File class, the junit test code should test what happens when a file is used under the correct protocol (i.e., file is opened, read or written, and then closed) as well as what happens when a File class is used without abiding to its protocol (e.g., when a file is read or written before it has been opened.)

After your junit white-box test suite is created, you should execute it using emma-instrumented bytecode and create a code coverage report, as you did in the second assignment for black-box testing. You are also asked to submit the html output of the emma code coverage tool along with your testing document. Simply instruct emma to generate the html report after you are done executing the entire white-box test suite. In your document, comment on how well the white-box tests cover the source code of the ATM simulator, and contrast these results to those in Assignment 2, where only black-box testing was used. If your white-box testing statement coverage is low you might want to improve it by adding more white-box test cases. You should use white-box testing to test all of the ATM code, which includes the GUI code, which was ignored in Assignment 2.

Do not submit, or use and any of the black-box test cases from the previous assignment. This assignment explores how far you can go on white-box testing alone.

Deliverables

The deliverables for this assignment are: Submit your assignment by 6:00PM of the due date via e-mail to the TA (evs23 @ drexel.edu). Please package the deliverables as a single zip file. Late assignments will not be accepted.