You are here: UUCS>WP Web>T2Framework (26 Mar 2013, WishnuPrasetya)EditAttach


Automated unit testing tool for Java

T2 is a fully automatic, trace-based random testing tool, featuring in-code specifications and reflexive testing. It is also almost interactive; depending on the complexity of your class it can respond in less than a second, in which time it can inject thousands of tests!

T2 checks for internal errors, run time exceptions, method specifications, and class invariant. Unlike other testing tools, T2 reads specifications written in plain java! They are placed in the class we want to specify. Though not as fancy as Z or JML, in-code specifications are declarative, formal, and powerful. Maintenance effort is also minimum.

Unlike other testing tools T2 does not check individual methods in isolation. Nor does it generate Junit test scripts, though we could add this feature. T2 actually performs the test directly or on the fly. So it responds faster, perhaps even giving the feel that it is interactive. Internally it generates tests in the form of traces (sequences) of method calls; each will be checked. This has the effect that methods are basically checking each other. This is called reflexive testing. The benefit is that it still works well even if the specifications provided are very partial, whereas other testing tools typically rely complete specifications.

It is a unit testing tool; with classes as the units. Violating traces are reported, and can be saved, and reloaded for re-testing or regression.

T2 does not and cannot check concurrency.

  • Quick Example : here. More examples are provided the Manual.
  • Screen Shots : here.
  • Download : download it from Google-code. You need Java 1.5 or above. To use T2 you only need the jar file. Just include it in your classpath. Instruction on how to use T2 is in the User Manual.
  • User Manual : [ download it from Google-code ].
  • Presentation : [ ppt (powerpoint) ]
  • Integration with IDE and JUnit : see here
  • License : free to use under the GNU GPL license.


  • Papers explaining T2:
    • Trace-based Reflexive Testing of OO Programs, I.S.W.B. Prasetya, T.E.J. Vos, A.I. Baars. Tech. Report CSUU, 2007. Also in the proceeding of IEEE International Conference on Software Testing Verification and Validation (ICST), 2008. See also DOI.

Other things

  • Some result: see here
  • Related links: see here


Wishnu Prasetya,

Let us know what you think


View all comments

Student Projects

I'm looking for students to further develop T2. For Master Thesis Project, see here for further information.

For Experimentation Project, check out here.

Topic revision: r37 - 26 Mar 2013, WishnuPrasetya

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding UUCS? Send feedback