[Pl-seminar] Semantics Seminar Schedule
Mitchell Wand
wand at ccs.neu.edu
Tue Mar 10 00:05:01 EDT 2009
NU Programming Languages Seminar
Wednesday, March 11, 2009
11:45-1:30
Room 366 WVH (http://www.ccs.neu.edu/home/wand/directions.html)
Unit Tests in Java
Viera Proulx
(joint work with Weston Jossey)
The design of unit test consists of three separate but collaborating
components. First, the programmer designs the test cases by defining
the needed data, method invocations, and expected outcomes. To
evaluate the tests, the programmer needs to define how the expected
and actual value should be compared, i.e. what constitutes the
successful outcome of the test and what constitutes a failure.
Finally, there needs to be a program that evaluates all tests and
reports the outcomes in a manner that helps the programmer identify
the source of the problem.
The most popular testing software in Java, JUnit, provides only a
limited support for unit test design and evaluation. The task of
comparing the expected and actual values is left entirely to the
individual programmer.
This talk presents a user-friendly and novice-appropriate library that
provides unit testing in Java. The library uses the java reflection
support to generate automatically the equality comparison of arbitrary
two objects, comparing the values of the individual fields. The user
specifies only the actual and expected objects to be compared. The
test report includes a pretty-printed display of all fields for both
the actual and expected data, and a link to the location of the failed
test.
The tester library has been used successfully by hundreds of students
at several institutions and is used daily in all of our Java
programming tasks.
================================================================
Upcoming Events:
# Nothing scheduled :-( Wouldn't you like to give a talk?
--Mitch
More information about the pl-seminar
mailing list