Tech Tip: Auditing Your Code with Teamstudio Analyzer

By Nigel Cheshire

Have you ever needed to test a Notes database design against certain criteria? For example, checking for corporate coding standards, or looking for potential incompatibilities with a new version of Notes? This is something that Teamstudio Analyzer can do, and this post will describe how to use that feature of the product.

Teamstudio Analyzer has been an essential part of many IBM Notes and Domino developers’ toolkits for many years. The principle of what Analyzer does is straightforward. It reads the entire design of a Notes database and creates a separate database, the contents of which documents that design in minute detail. Every design element, from forms and views to script libraries and shared fields is represented as a document in the output database, and every attribute of each design element is captured in a field within those documents. This creates a complete representation of the database design in a way that can easily be searched and sorted.

But there’s more to Analyzer than just a code documentation tool. It can also serve to audit your Notes database designs against some known set of criteria. For example, it can help you answer questions such as whether the design is compatible with a new release of Notes/Domino, whether the application can be mobile-enabled, or whether it adheres to corporate coding standards.

The audit function within Analyzer allows you to define a set of requirements or rules, and then test the design of your database against those rules. Many of these rules, such as standards or common coding errors, may be reusable. Others will have a unique temporary nature, such as a special change request or compatibility issues raised by upgrades to a new version of Notes. Analyzer includes some predefined tests that help get you started with defining typical rulesets, such as:

  • Common coding errors;

  • Potential performance problems;

  • Violations of typical organizational standards;

  • Potential application upgrade problems;

  • Potential web or operating system compatibility problems.

To use the audit feature of Analyzer, you need to create your filters in a database based on the template deanfltr.ntf, which ships with the product and is located in the Notes data directory. Upon creating the database from the template, you’ll find that there are 32 filters already defined (as of E33). These act as a good way of learning how to create your own filters.

When Analyzer runs the audit, it retrieves the filters from that database and scans the Analyzer output database looking for design elements that match the criteria in those filters. For each match, Analyzer creates a document in a separate, audit output database - the Teamstudio Reports database.

Note that the Teamstudio Reports database is used as a repository for reports from multiple Teamstudio tools. If you only have Analyzer installed, you will see the other product reports listed in the navigation pane but they will, of course, be empty.

When you create the filters, you assign a Class and a Severity to each filter. That helps prioritize and manage the filter matches in the output database.

The Notes form that is used to create the filters acts as a sort of wizard to help create the filter itself. The wizard actually creates a validation formula which is a standard Notes formula. Analyzer implements a set of advanced functions in formula language that, should you feel constrained by using the wizard, you can use directly to write your own filters from scratch. The advanced formula functions are documented in the Analyzer product documentation.

At the start of this post, I mentioned that the Analyzer audit function can be used to identify compatibility issues with new versions of Notes, or potentially help you with mobile-enabling your Notes applications. If either or both of those items are on your to-do list, you should know that we have created filter packs that identify compatibility issues with Notes and Domino 10 upgrades, as well as potential issues with running Notes apps on HCL Nomad, AKA IBM Domino Mobile Apps (IDMA). And, if you want to know more about how those filter packs work, we wrote up a post describing them.

In summary, Analyzer provides a sophisticated and highly configurable audit function that allows you to create a set of filters that can be run against any database design. You can store the filter sets so that they can be run against new versions of the same database design to ensure compliance with standards. You can also use the filter sets to identify potential problems such as incompatibility with new versions of Notes.

To learn more about Teamstudio Analyzer, click below.