How to use

To understand Hapao's test blueprint, please visit the Test Blueprint section.


Hapao is accessible from the Pharo menu, by clicking on the background. Once opened, a list of packages installed in the Pharo image will appear. To select one, just click on it and add it to the list on the right. You can also add a valid expression for the package in the textfield in the lowest section, click on 'validate' to validate the expression and for the package to be added to the list. A valid expression could be, for example: each beginsWith: 'Mondrian'


The following navigation options are accessible via contextual menus offered when right-clicking on an element in Hapa'o or in the system browser

  • Jump from a system browser to the test blueprint. An option to jump to Hapa'o is accessible by right-clicking on a class definition in the system browser (the standard tool to write and browse code in Pharo). The class is selected in the test blueprint.
  • Jump to a class or method definition from Hapa'o.
  • Jump to the definition of unit tests that reference the selected class from Hapa'o.
  • Methods can be removed by right-clicking on it in Hapa'o. To prevent accidents, only non-covered methods can be removed.

From Hapao's top menu you have the following options:

  • Unit tests may be executed within Hapao to immediately see the difference in the blueprint by clicking the 'Run tests'.
  • The 'Info' button display a information about the package itself, like number of clases and methods, and the percent of covered methods.
  • 'Open new' opens a new instant of the current Hapao instance.

Programmatically using Hapa'o:

A number of facilities are provided to programmatically assess the coverage. This is useful when one wants to use the profiling information for other means than visualizing it.

The following expression profiles the execution of the unit tests of all the packages that constitute Mondrian: <pre> profile := HapaoTestCoverage runTestsForPackagesMatching: 'Mondrian*' </pre>

The coverage for each class and methods is accessible using accessors:

<pre> (profile >> #MOGraphElement) coverage "=> 84.69%".

(profile >> #MOGraphElement >> #absoluteBounds) coverage "=> 100%" </pre>

The test blueprint is opened with: <pre> profile visualize </pre>

What's new

  • Pharocast on Hapao
    24 April 201112:22:34 am by admin
    "Vanessa and Alexandre show us Hapao, an innovative test coverage tool implemented in the Pharo Smalltalk programming language. You will see how they analyse the ProfStef interactive tutorial, increas...
  • Mondrian
    25 March 20119:52:01 pm by admin
    The code coverage of Mondrian has been significantly increased over the past two weeks. 78.84% of the methods are executed by the unit tests.
  • MetacelloBrowser
    19 January 201112:11:10 pm by admin
    MetacelloBrowser is a tool to manage configurations in Pharo. At the beginning, MetacelloBrowser did not have any tests. Thanks to Hapa'o, it has now a coverage of 75%. Code is available on www.squeak...