Skip to topic | Skip to bottom


MichaelaGreiler.TestHoundr1.6 - 30 Oct 2012 - 16:45 - MichaelaGreiler

Start of topic | Skip to actions




TestHound is a static analysis tool which analyses test code, detects test smells and guides developers and test engineers during improvement and refactoring of test code.

What TestHound solves

Designing automated tests is a challenging task. One important concern is how to design test fixtures, i.e. code that initializes and configures the system under test so that it is in an appropriate state for running particular automated tests. Test designers may have to choose between writing in-line fixture code for each test or refactor fixture code so that it can be reused for other tests. Deciding on which approach to use is a balancing act, often trading off maintenance overhead with slow test execution. Additionally, over time, test code quality can erode and test smells can develop, such as the occurrence of overly general fixtures, obscure in-line code and dead fields. Test smells are poor solutions to recurring implementation and design problems in test code. Until now, no support has been made available to developers during the analysis and adjustment of test fixtures.

To address this shortcoming, we developed a TestHound. TestHound automatically analyzes test fixtures to detect fixture-related smells and guides improvement activities.


Please feel free to download it here:
Latest Version:
Previous versions:


The installation process of TestHound is straight forward:
  • extract the folder TestHound_vX to a location of your choice.
  • Run the jar comprised within the folder.

Quick Start

The GUI of TestHound should start when the jar is execute (either double-click, or via the command line: "java -jar TestHound-vX.jar"), which allows to direct TestHound to the particular code base, as illustrated by the picture below.


To run TestHound on your code base you need provide it with three things:

  • the folder containing your test code (java classes)
  • a folder containing all dependencies your applications requires to run the tests
  • a XML file of all the tests you want to analyse (e.g., can be obtained via JUnit)

After you provided TestHound with the correct information, press the button "Analyze Test Code". TestHound will update you on the progress of the analysis by prompting the status in the text-box below the "Analyze Test Code" button.

When the analysis has finished, the button "Show result report" will become active and opens the standard browser to display the result report, as exemplified in the picture below (based on the eGit test code base).


The HTML-report consists of three main parts:

  • the problem summary page: summarizing all problems (indicated by icons) within a list view
  • the fixture classification summary page: giving an overview of all the fixture mechanisms used within the code base in list form
  • the detail report per class: which can be accessed, by clicking the class name in one of the overview pages

An example of the detail report, reporting problems and refactoring solutions is illustrated below.


Implementation Details

TestHound is a static analysis tool, implemented in Java and supports languages which compile to Java byte code by using the Apache BCEL library to extract facts. TestHound supports the JUnit and TestNG test frameworks, but can easily be extended to support other frameworks. The results of the analysis are comprised in a hypertext report.


We evaluated the applicability and the usefulness of TestHound with a mixed research approach: we applied TestHound to three case studies, and involved 13 developers in the evaluation (by means of interviews and a questionnaire). The questionnaire used to evaluate TestHound can be downloaded here: Questionaire.pdf

Edit | Attach | Printable | Raw | More topic actions
Revisions: | r1.6 | > | r1.5 | > | r1.4 | Page history | Backlinks
You are here: MichaelaGreiler > TestHound

to top

Copyright © 2003-2018, Software Engineering Research Group, Delft University of Technology, The Netherlands