Novice Java programmers face great difficulties when learning to design unit tests for any nontrivial cases. Deciding whether the result of a method, or the effect the method produced represents the expected result one must understand the difference between equality based on the values an object represents versus the reference equality (identity) -and be able to define the correct equals method.We describe the tester library that supports test design, evaluation, and reporting of the results in the manner that supports a novice programmer. The library uses Java reflection and annotation to compare any two data items (primitive types or objects) by the value they represent, produces report where the expected and actual values are prettyprinted, and a failed test report includes a link to the failed test.The library has been used in classrooms and is used daily in our program design.
The design of unit tests is a fundamental part of learning to design programs. We present a Java library that supports the design of tests for a novice programmer, together with the test evaluation, and the reporting of test results in an informative manner. The tester library has been used at a number of universities with a great success.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.