Generate the snapshot
To generate a snapshot, you need to use the Execute tab in the Application editor:
A wizard will then be displayed enabling you to set the various date and naming options if required:
- The initial General Information wizard page enables you to select:
- Capture Date - by default the current date will be pre-selected. If you wish to pre or post date your Snapshot, please select the correct date in the calendar. Note that you can also choose the time (24 hour clock applies) using the fields underneath the date selector. When complete, the Capture Date will be displayed as follows: DD/MM/YY HH:MM
- Label - by default, the label will be predetermined by the CAST Management Studio, based on the date and time the wizard is opened. You can, however, enter your own label - but remember that the label is displayed in the CAST Engineering Dashboard. Note that if you change the Capture Date, then the Label will not automatically update - if you wish to retain a date based label, you need to update it manually.
- Application Version - by default, the CAST Management Studio will enter the current version name, however you are free to change this if necessary.
- Once all the fields have been filled in to your satisfaction, click Next to continue. The Execution Options screen will then be displayed:
- This page enables you to select:
- Skip Application Analysis - you have already executed the analysis as suggested in 2.2.1. Run the Analysis, then you can tick this option to save valuable time.
- Ignore Empty Module - You should leave this as is (please see the CAST Management Studio help for more information)
- Send mail report (if configured) - Leave this ticked.
- Upload Snapshots to Measurement Service (if configured) option will be selected by default. This option ensures that the data is uploaded to the Measurement Service for use in the CAST Application Analytics Dashboard when a snapshot has been successfully generated.
If you are generating a first snapshot during an application on-boarding, CAST recommends that you deactivate the Upload Snapshots to Measurement Service (if configured) option. This will avoid unwanted or incorrect information being uploaded to the CAST Application Analytics Dashboard.
If this initial snapshot generation is successful you can manually upload the results to the Measurement Service without needing to re-generate the snapshot: see the section below entitled Upload snapshot data to the Measurement Service.
- Click Finish.
- The CAST Management Studio will then automatically generate a snapshot for the current Application.
- When complete, you should see a step-by-step list of the action's processes in a dialog box:
Please note that CAST supports concurrent snapshot generation on the same workstation (whether through GUI/CLI) with the following conditions:
- only one active execution for a given application/triplet should be run at any one time
- you should ensure that you configure application/triplet specific values for the following CAST locations:
- TEMP (User's temporary path)
This can be achieved by:
- defining an application/triplet specific Windows environment variable (for example %APPLICATION%)
- using this Windows variable in the CastGlobalSettings.ini file (ensuring you uncomment the variable in the CastGlobalSettings.ini file)
- changing the Windows variable path each time you generate a snapshot for a specific application/triplet
It is only possible to define the TEMP location in the CastGlobalSettings.ini file, as shown below. However, when using the CLI, omitting the logRootPath, workingPath and temporaryPath options will redirect all files to TEMP anyway. In the same way, when using the GUI, leaving Log/LISA/LTSA path fields blank in the CAST Management Studio preferences will ensure all files are redirected to TEMP.
"Application X" needs to be analyzed before taking the snapshot
If you receive the warning displayed above when attempting to generate a snapshot there are two possibilities:
- If this is the first time you have generated a snapshot and the job has not previously been analyzed, then the "Skip Analysis Job" option (available in the options wizard displayed when you generate a snapshot) will mean the snapshot is generated without the analysis having been run first. This can lead to incomplete results. Ensure you untick the "Skip Analysis Job" if the job has not previously been analyzed on its own.
- If you receive this warning and your job HAS previously been analyzed, then it is possible that you may be running the CAST Management Studio as a different Windows user or on an entirely different workstation. If this is the case then the CAST Management Studio will consider that the configuration has changed and will treat the analysis jobs as not having previously been run. This is because the LISA, LTSA and Log preferences (which are used in an analysis) are specific to the Windows user. In this situation CAST recommends that you untick the "Skip Analysis Job" option before you continue with the snapshot generation.
Performance issues when using an Oracle Server host for the CAST AIP schemas
If you encounter performance issues when generating/deleting a snapshot using CAST AIP schemas hosted on an Oracle Server, CAST recommends that you consider making the following changes to force the use of the ALL_ROWS optimizer mode instead of the default RULE mode:
Add the following to the globallysharedsettings.ini file: (located here: %PROGRAMDATA%\CAST\CAST\<version>):
Add the following to the CAST-MS.l4j.ini file (this file does not exist by default therefore you must create it in the root CAST AIP installation folder):
Restart the CAST Management Studio
Restart the CAST Management Studio before you attempt to generate the snapshot again.
Check the results
The easiest and quickest way to check the results of a snapshot generation is to open the CAST Application Engineering Dashboard and view your results.
If you don't have one set up yet (or your licensing agreement does not allow you to install one), you can invoke the "on the fly" legacy CAST Engineering Dashboard or the CAST Application Engineering Dashboard by clicking the Open CED or Open AED options in the CAST Dashboard Service editor:
When using the options you will be prompted for passwords to access each dashboard, they are as follows:
- Open AED > admin/cast (case-sensitive): note that this user has the ROLE_ADMIN role (which cannot add actions to the Action Plan)
- Open CED > CAST/CAST (case-sensitive)
Tips for checking the results
Detect any third party libraries, generated code or code that is not maintained by the project
- Impact: This source code is not important for the project, because project can't do anything regarding it. It is better to exclude it.
- Remediation: Exclude this source code from the dashboard. It should be analyzed by AIP but it shouldn't appear in the dashboard.
- Details: Most of the time, third party libraries are very complex and not documentation.
- Tips: you can check it in top cyclomatic complexity tab for example. or you can search for some specific string pattern like 'gen', 'test' ...
Check module weight
- Impact: Bad aggregation for modules gives bad assessment quality.
- Remediation: Usually, good aggregation is done with aggregation by Artifacts.
- Details: By default, grades are measured on the entire Application
- Tips: consolidation mode is defined in the Assessment Model in the CAST Management Studio:
Check dead code / Unreferenced functions or methods
- Impact: Some rules dealing with unreferenced objects have a high weight and these rules are very useful for the project to help identify rapidly dead code in the source code.
- Cause: unreferenced objects may come from mistakes in the configuration due to specific frameworks that are not correctly managed.
- Remediation: review your configuration and run the analysis again.
- Tips: in the CAST Engineering Dashboard, you can look at rules starting with "unreferenced XXX".
Check naming convention (if configured)
- Impact: default parameters are often wrong and rules dealing with naming conventions are normally low.
- Remediation: assess the Assessment Model and change the parameters for these rules.
- Tips: be careful with these types of changes, the impact is very low as it is dealing with documentation, transferability.... And people are more focused on performance or robustness. Secondly, to keep a good baseline and to be able to compare apple with apple, it is sometimes better not to correct it.
Check file volumes
- Impact: make sure, in terms of volume, you have the same range of files in input (in the source folder) and in output (CAST Engineering Dashboard).
- Remediation: if some files are missing, you may have to re-analyze the application.
- Tips: some open source tool exist (like cloc) to help you to count files in the source code folder.
If the initial snapshot is not satisfactory, delete it - this will delete it from the Dashboard Service and the Measurement Service (if you chose to upload the results to the Measurement Service):
- Select the snapshot
- Click the delete button as highlighted below:
- You will now need to make any configuration changes that you require and then re-generate the snapshot.
If you encounter performance issues when deleting a snapshot using CAST AIP schemas hosted on an Oracle Server, CAST recommends that you consider making some changes to force the use of the ALL_ROWS optimizer mode instead of the default RULE mode. This is explained above in Performance issues when using an Oracle Server host for the CAST AIP schemas.
Upload snapshot data to the Measurement Service for viewing in the CAST Application Analytics Dashboard
If the snapshot now contains the information you expect, then you can upload it to the Measurement Service:
Note that the CAST Application Analytics Dashboard can officially support the upload of a maximum of 200 applications. CAST recommends that you choose only the most critical applications from the business view point - i.e the applications that need to be monitored with high visibility by CIOs and managers.
You can perform a manual upload of the snapshot you have just generated to the Measurement Service for display in the CAST Application Analytics Dashboard:
When you are generating a snapshot for a subsequent version of the Application (i.e. one that you have already on-boarded), and you are confident that the results of the snapshot generation will be correct (i.e. the new source code changes are relatively minor) then you can upload the snapshot data to the Measurement Service automatically during the snapshot generation using the Upload Snapshots to Measurement Service (if configured) option in the snapshot generation wizard:
Check results in the CAST Application Analytics Dashboard
Once the snapshot data has been uploaded to the Measurement Service, CAST recommends that you check the results in the CAST Application Analytics Dashboard. However, you may first need to reload the CAST AAD cache so that results are displayed correctly:
Reload the CAST Application Analytics Dashboard cache
The CAST Application Analytics Dashboard features a data cache to improve the speed at which data is displayed in the dashboard. This means that when requesting data, the CAST Application Analytics Dashboard may return data direct from the cache rather than fetching it from the Measurement Service. This means that data displayed in the dashboard may not be up-to-date - particularly if you have very recently generated a snapshot and uploaded data to the Measurement Service and were expecting to see this new data.
To reload the cache, see CAST-AAD-AED - Reload the cache
Check the results
Browse to your CAST Application Analytics Dashboard, login and check the results:
Configure access to the CAST Application Engineering Dashboard/CAST Engineering Dashboard from the CAST Application Analytics Dashboard
The CAST Application Analytics Dashboard enables users (via the "microscope" icon) to access directly the underlying data in the CAST Dashboard Service database via the CAST Application Engineering Dashboard or the legacy CAST Engineering Dashboard. Both dashboards provide detailed information about the top level data displayed in the CAST Application Analytics Dashboard. This configuration is license dependent.
Access to the underlying data is provided via a URL (pointing to the required dashboard) that is stored in the Measurement Service.
- If you have deployed the combined "AAD-AED" WAR file then the URL is configured automatically to point to the CAST Application Engineering Dashboard and cannot be overridden to point to a separate CAST Engineering Dashboard deplyoyment.
- However, if you have separate standalone deployments using the standalone CAST-AAD.war / CAST-AED.war / CAST-CED.war files, then access to the CAST Application Engineering Dashboard (AED) or CAST Engineering Dashboard (CED) is not implemented automatically and you will need to manually upload a URL as decribed below.
Deployment considerations: standalone or combined WAR file?
If you have deployed the CAST Application Analytics and Engineering Dashboards from the combined CAST-AAD-AED.war file (as described in Installing and configuring the CAST Application Analytics Dashboard and in Installing and configuring the CAST Application Engineering Dashboard) then access to the CAST Application Engineering Dashboard (AED) is implemented automatically. You do not need to do anything further.
- automatic access is only implemented for each CAST Dashboard Service that is configured for viewing in the CAST Application Engineering Dashboard. So if you have consolidated data from a CAST Dashboard Service into a CAST Measurement Service for viewing in the CAST Application Analytics Dashboard, but you have not declared this CAST Dashboard Service in the CAST Application Engineering Dashboard configuration, then the automatic access will not function and users will be notified that access is not yet configured.
- automatic access cannot be overridden to point to a separate CAST Engineering Dashboard deployment.
If you have deployed the CAST Application Analytics and Engineering Dashboards using the standalone CAST-AAD.war / CAST-AED.war / CAST-CED.war files (as described in Installing and configuring the CAST Application Analytics Dashboard, Installing and configuring the CAST Application Engineering Dashboard and in Installing and configuring the CAST Engineering Dashboard and Discovery Portal), then access to the CAST Application Engineering Dashboard (AED) or CAST Engineering Dashboard (CED) is not implemented automatically and you will need to proceed as follows:
Uploading a URL for the CAST Engineering Dashboard
- Simply enter the URL in the field URL above, in the format http://<server>:[<port>]/CAST-CED (you should tailor the <server> and <port> entries to your environment)
Uploading a URL for the CAST Application Engineering Dashboard
- For each CAST Dashboard Service that you want to drill down into, you must first determine the context "name" of the Dashboard Service as defined in the context.xml file for the CAST Application Engineering Dashboard (AED).
- First locate and open the following file in a text editor:
- Then take the following example which shows three CAST Dashboard Service each with different context "names" (the context "name" is the value defined after the second forward slash in for example name="jdbc/domains/APP1" (i.e. APP1)). We will use the APP1 name defined for the V80_CENTRAL_APP1 Dashboard Service:
- Open the CAST Management Studio and move to the Services view.
- Double click the corresponding Dashboard Service to open its editor (i.e the V80_CENTRAL_APP1 in this example):
- Enter the URL to your CAST Application Engineering Dashboard. This will take the following form - you should tailor the <server> and <port> entries to your environment. The <context-name> value refers the value we determined earlier, in this example APP1. So we will add the following URL:
- Click the Add URL to Measurement Service
- Restart your application server so that the changes are taken into account.
- Now users can drill down into the CAST Application Engineering Dashboard.
- you will need to repeat this action for EACH CAST Dashboard Service (the CAST database used by the CAST Engineering Dashboard) that you want your users to be able to drill down to.
- you may need a specific license that enables access to the CAST Application Engineering Dashboard before this feature will function in the CAST Application Analytics Dashboard.
- you must have already generated a snapshot and uploaded snapshot data to the Measurement Service before you attempt this
Remove source code and delete the delivery
Depending on the policy in your organization, when you have generated a snapshot successfully and have pushed the results to the Measurement Service for display in the CAST Application Analytics Dashboard, you can delete extracted source code from the Delivery folder to free up space on disk, and then permanently delete the delivery (i.e. the Version):
Delete source code
If you have generated a snapshot, pushed the results to the CAST Application Analytics Dashboard and your Delivery Managers have provided source code for Version 2 of your Application, you may now want to free up some disk space by removing the extracted source code stored in the Delivery folder relative to the Delivery (Version). Doing so, will also move the Delivery to the Delivery without source code section in the Delivery tab in the CAST Management Studio. Log and configuration files will still be retained.
Delete a delivery
If you want to permanently delete a delivery, use this option - no trace of the Delivery will remain. As a best practice, CAST recommends that you avoid deleting the most recent Delivery as it is not possible to undo this action.