Previously I introduced you to Bubbles and provided a brief overview. Now let’s take a closer look at Bubelen. Bubelen is the reference implementation for bubbling.
Compiler Support
Bubelen currently supports:
- Delphi 5
- Delphi 6
- Delphi 7
- C++ Builder 5
- C++ Builder 6
- Kylix 1
- Kylix 2
- Kylix 3
- Octane (When released)
When Octane (Delphi for .Net) is released support for Visual Studio and other .NET IDE's can also be supplied.
Interface Variants
GUI
Bubelen GUI is the most widely used version, because it is the most user friendly and contains the most features. Bubelen GUI looks like this:

Fig. 1: Base Demo
Bubelen GUI allows bubbles to be executed by category, individually, or all as a suite. Suites are custom definable and a bubble can be a part of several suites. Bubelen GUI also allows access to history, charting and launching of playgrounds.
Console
Bubelen console allows basic execution of bubbles. Bubelen console is useful for easier cross platform testing between Delphi (and C++ Builder), Kylix, and Delphi for .Net.
Bubelen console also allows better integration into batch files, or as part of a QA check when called from a build automation tool such as FinalBuilder.
Bubelen console accepts command line parameters that specify which bubble(s) or groups to execute. Bubelen console then outputs the output directly to the console and returns an error code via the console if all bubbles did not succeed.
If no arguments are passed to the Bubelen console, a basic user interace is presented.
At this time Bubelen console does not support many of the advanced features such as charting or history. In the future it will be expanded to support more of the features.
Server
Bubelen server is an implementation of Bubelen console that is hooked to a TCP server. This allows remote access using telnet to execute bubbles remotely.
Most bubbles are for internal examination, however it is often necessary to execute bubbles remotely for performance or behavior testing. By using Bubelen server and running on a remote server this can be easily accomplished.
Bubelen server is currently under construction and will be available soon.
Bubelen GUI allows bubbles to be executed by category, individually, or all as a suite.
Setup and Installation
The first step in using Bubelen is to install and set it up. Fortunately this is rather easy and I shall cover it step by step.
kbmMemtable
Bubelen requires kbmMemtable version 3.10 or higher. kbmMemtable Standard is available as freeware. Bubelen uses kbmMemtable to story history and other statistics about bubbles. kbmMemtable was chosen because it has minimal setup requirements, is well supported, and is freely available.
If you do not have kbmMemtable table 3.10 or higher installed you will need to install it or upgrade your existing version. kbmMemtable is available at http://www.components4programmers.com/products/kbmmemtable/.
After downloading be sure to consult install.txt in the zip for installation directions.
Bubelen Setup
Bubelen includes an install which automates much, but not all of the installation.
1. Download the Bubelen install from
http://www.indyproject.org.
2. Run BubelenSetup.exe and choose a directory of your choice. This will install the Bubelen source and install the new project wizard.
3. Open the Bubelen package file (dpk) for your version of Delphi.
4. Click the Install button on the package window.
Newer versions of Bubelen are also available directly from the Bubelen VCS. However such versions are the live development versions and not official releases.
Paths
Bubelen and kbmMemTable need to be added to library paths so that you can compile Bubelen applications and demos. To do this perform the following steps:
1. In Delphi, select Tools, then Environment Options from the main menu.
2. Select the Library tab.
3. Click the ... button to the right of Library Path.
4. Add the paths for the Bubelen directory and KBMMemTable.
Introducing Base Demo
Before I delve into how to create and integrate new bubbles, let's take a quick tour of Bubelen GUI. The easiest way to do this is with one of the provided demos. The demos are rather basic but are being expanded with more examples.
BaseDemo.dpr
BaseDemo.dpr is provided as the most basic of Bubelen demos and designed to provide an introduction to Bubelen without overwhelming the user.
BaseDemos consists of two bubble groups. One group is called StringThing which is a StringReplace variant. The other tests the VCL's TStrings class.
Bubble Groups
Base Demo consists of two sets of bubbles. Bubbles are contained within a form or a datamodule. Each form or datamodule can contain one or many bubbles. Typically they contain several related bubbles to more easily share code. Instead of creating one big bubble it is usually preferable to create many small, related bubbles and group them together on a single form or data module.
In BaseDemo both tests have been grouped on datamodules.

Fig. 2: TStrings Bubble Datamodule
This datamodule contains three separate but related bubbles. Each one tests TStrings, but a different TStrings implementation. The category component is an optional component that is used to group the bubbles into a single category for Bubelen.
Forms or Datamodules
It has been mentioned previously that bubbles may exist on forms or datamodules. So the natural question is "Should I use a form or a datamodule?"
Bubelen does not care either way. This is purely a decision to be decided by the situation. A form is useful if the form itself is being tested such as in a GUI test. A form is also useful as an interface for a playground. And since playgrounds and tests often share the same code, this causes the bubbles to be on a form.
Examining the Bubble
Bubbles form the core of Bubelen. Without Bubbles, there is nothing for Bubelen to do. A bubble consists of only a few properties and events. Even fewer are required for operation. Bubbles are represented by the TBXBubble component.


Fig. 3&4: Properties and Events of TBXBubble
As a minimum either the OnTest or OnPlayground events must be defined. All other properties and events are either optional or have valid defaults.
Running Bubelen
Let's run BaseDemo now and explore some of Bubelen GUI's functionality. When you first run BaseDemo, it should appear as shown previously in the Interface Variants section. This is the main interface of Bubelen GUI. It displays all the bubbles that have been compiled into this project and divides them into user specified categories.
When first run, Bubelen GUI defaults to category "All". This causes all registered bubbles to be shown in the list. Selecting a category in the left pane will filter the list of bubbles in the right pane. Bubbles can be executed individually, all at once, or by a specific category.
Each form or datamodule can contain one or many bubbles. Typically they contain several related bubbles to more easily share code
Run BaseDemo. Select the TStrings category. Now in the right pane you can see the bubbles on the datamodule shown in the Bubble Groups section. The category is defined by the category component. Not by the fact that they are on the same datamodule. Grouping them on the same datamodule is purely for user benefit of code consolidation and has no effect on Bubelen.
Now click on the TListbox item in the right pane. You will see on the toolbar that several toolbar items become enabled. The only one that remains disabled is the playground button as this bubble has no playground. While there are menu and toolbar items to execute the selected bubble, it can also be executed by double clicking it. Double click the TListbox item now.
The test will run and when it finishes a result window will be displayed. TListbox has no results so it will be empty. However this window is useful for tests that are more complicated to log their output for both debugging, but historical purposes.
Now close the result window and you will see the item has been updated with the run time. Run the test a few more times. Each time you will notice that the time field is updated and varies a little bit. A small variance is normal in most tests, but a bigger variance can flag potential problems, or code changes with a negative impact.
History
Performance history can be seen by selecting the test and clicking history. History displays the time, date, and details of all previous executions of this test.

Fig. 5: Sample History Window
Charting
Another useful option is the chart. The chart does not display historical logs, but instead displays the execution time as a line chart.

Fig. 6: Sample Chart
With this tool we can easily see if our current test is performing inline historically or not.
Playgrounds
Playgrounds are a unique feature of bubbles. The testing component is fantastic for deciding pass/fail and recording execution time. The testing component is useful for debugging as well; however during debugging it often necessary to "play" with the inputs and see the immediate results of such. Traditionally developers alter their code, run, look, and repeat. Playgrounds allow a testing interface to be used for "playing" with inputs and seeing the immediate results.
Traditionally developers alter their code, run, look, and repeat. Playgrounds allow a testing interface to be used for "playing" with inputs and seeing the immediate results
Currently BaseDemo does not have any sample playgrounds. Playgrounds are normally used with complex bubbles, and complex bubbles are not good candidates for the demos as they introduce a "learning overload". This being said, there are plans to include some demos with playgrounds.
As an example here is a screenshot of a playground from one of the Indy Bubbles:

Fig. 7: Indy Decoder Playground
What makes up this interface? You do. The interface is simply a form that Bubelen invokes as part of the OnPlayground event. In this case it reads from a directory a list of raw mail files. Double clicking on one will then attempt to use Indy to decode it and display all the output parameters. The Test portion uses the same code, but instead of displaying the information compares it against known values in INI files written out by the playground. Playgrounds can be independent, however this case demonstrates how a bubble can contain both a test and a playground that work together can be useful.
More
I hope that this brief tour of Bubelen GUI has been helpful. Next installment will cover how to create your own bubbles and Bubelen suites.
What has been covered here is just the very basics. The Bubelen team is working on many more features for the Bubelen GUI including automatic detection of large changes in execution speed, automatic memory checking, and much more.
Just like Indy, Bubelen is completely open source. So if you have more ideas or would like to help, please feel free to join the project at http://www.IndyProject.org/.