HowTo add a Data Provider: example with DB/IQ

Infoscope is a Smart Dashboard to monitor the quality of IT projects.
The Data Provider framework makes it possible to import any kind of data and thus enrich your quality model.

What is a Data Provider?

A Data Provider (or DP), in the Infoscope terminology, is module executed during an analysis, which delivers measurement data (metrics, violations etc.). It can also import any field-specific data, as for instance the CPU consumption for embedded software or tickets from a Bug Tracker. Basically, a Data Provider collects results from static code analysis tools, code coverage and test framework or lints and transform into an “Infoscope compliant” format.

From a technical point of view, it can operate in different ways: read data from a CSV file, parse a HTML file, process XML file or call services (REST, OSLC etc.).  “Squan Sources”, Infoscope’s engine, contains a Data Provider and offers many possibilities like the programming language selection. Infoscope supports more than 50 Data Providers and new ones are regularly added to support new technologies. Some of them have a “plugin” version, which means their execution will be entirely taken over by Infoscope.

Create a Data Provider: example with DB/IQ

Before creating a DP, we recommend to look at the Built-in Data Provider Framework, which allows import findings and metrics from a CSV or XML file. This framework covers most of the cases. Nevertheless, it may happen you need to create your own DP, which is one of the strengths of Infoscope.  The example below illustrates such an implementation.

DB/IQ: Quality Assurance for SQL

DB/IQ is a software suite, which offers a wide range of solutions to maintain a good performance of DB2 SQL applications on z/OS systems [https://insoft-software.com/en/products/dbiq/]. It contains a module to check and EXPLAIN SQL statements. The objective here is to integrate results from the DB/IQ analysis into Infoscope to provide a complete monitoring of DB2 applications on the Mainframe. For this, we developed a Data Provider for DB/IQ.

Data Provider step by step

1.     Configuration

The first step is to define the Data Provider by giving a name, a description and declare the required parameters as well as the rules and the corresponding help. The 300+ rules from DB/IQ-QA have been extracted and converted to create the ruleset file in XML format. This was the opportunity to specify which characteristic they belong to; e.g., “OBJECT Coded without CREATOR.name” is related to the portability. The help text has been exported and could be easily converted into the target format with help of regular expressions. English, French and German versions, available in the product, were generated.

2.     Validation

We recommend running the Validator to verify everything has been specified correctly. If not, an error message will indicate what needs to be fixed. Otherwise, the Data Provider is already available in the UI and the corresponding rules accessible from the Model Editor.

Figure 1 Ticket overview with Scrumboard at the bottom

Figure 1 DB/IQ rules displayed from the Analysis Model Editor

3.     Scripting

The last part of the Data Provider creation is to develop a script to call the DB/IQ module. In our case, we re-used the backend service developed for the Eclipse plugin add-on. The supported implementation languages are Tcl, perl, java and javascript. We adapted the service to generate a CheckStyle-like syntax output file to be aggregated to the analysis. We could also have transformed the XML output with XSLT.

It is even possible to develop scenarios that are more complex, for instance to first retrieve the tickets from a Bug Tracker and process them to prepare metrics to be imported into Infoscope.

4.     Utilisation

Once the Data Provider is ready, you can create a new project or edit an existing DB2 application analysis. On the second page of the wizard, check the DB/IQ checkbox and set the result file location. After this, the Analysis Model can be modified, here DB/IQ rules can be edited and the analysis can be run. As a result, the analysis will contain findings detected in the source code (here a COBOL program) and the violations reported by DB/IQ.

Figure 2 Control Flow Graph is now interactive

From now on, DB2 applications on the Mainframe can be analysed better. The host programming language (ASM, COBOL, PL/1, C or C++ etc.) as well as the SQL queries are both analysed. As you can see, Infoscope is open and flexible and, using the Data Provider framework, aggregates any data to have a better overview of the software quality of IT projects. If you would like to have more information, please contact us through our website: www.infoscope.com. Our experts will contact you.

Give yourself a chance to manage your IT projects efficiently
2018-05-30T15:10:32+00:00