The OpenCTF component test framework helps to build automatic tests for all (visual and non-visual) VCL components in a Delphi application. It is based on the DUnit framework.

How does it work?

  • OpenCTF iterates over the Forms and DataModules and dynamically creates test cases for the components
  • Customized test classes detect which components have to be tested, and configure the test steps

OpenCTF screenshot

How can it help me?

OpenCTF provides an easy way to build automatic quality checks for large projects where many components have to pass repeated tests.

Here are some examples:

  • detect missing or wrong property values – e.g. Buttons without assigned Actions, DataSources without associated DataSet
  • detect unassigned event handlers – e.g. missing OnExecute event
  • check that all DataSets can be opened
  • check the tab order
  • find invisible components (e.g. invisible TabSheets which better should be hidden at runtime)

Is it easy to use?

Creating and customizing tests for your specific needs is very easy:

  • Adding OpenCTF tests to a DUnit test suite requires only one or two lines of code
  • Writing your own custom component tests is simple, many examples are included in the source distribution

Hosted on Sourceforge

Source example

program OneFormTest;
  TestForm in 'TestForm.pas' {Form1};
  // Register Form classes
  // run the tests

One thought on “Automatic Component Tests for Delphi VCL Applications

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s