0% found this document useful (0 votes)
11 views18 pages

Code Coverage Receiver Guide R24

sdf

Uploaded by

Wakorintho
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views18 pages

Code Coverage Receiver Guide R24

sdf

Uploaded by

Wakorintho
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Code Coverage Receiver

R24

Information in this document is subject


to change without notice.
No part of this document may be
reproduced or transmitted in any form or
by any means, for any purpose, without
the express written permission of
TEMENOS HEADQUARTERS SA.
© 2022 Temenos Headquarters SA -
all rights reserved.
Code Coverage Receiver
Document History

Revisio
Date Amended Name Description
n
1 June 23rd 2016 T. Aubert Initial version
2 Sept. 12th 2016 T. Aubert Add the xml files description

3 March 22nd 2019 S. Sakthi R19 AMR Review

4 March 25th 2020 S. Sakthi R20 AMR Review

Basheer
5 April 12th 2021 R21 AMR review
Ahamed

6 April 25th 2022 [Link] R22 AMR review

7 April 6th 2023 [Link] R23 AMR review

H. Sanofar
8 March 6th 2024 R24 AMR Review
Nisha

2 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Copyright

Copyright © Temenos Headquarters SA 2009-2024.


All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this
document may be reproduced, transmitted, or made available directly or indirectly to a third party
without the express written agreement of TEMENOS UK Limited. Receipt of this material directly
TEMENOS UK Limited constitutes its express permission to copy. Permission to use or copy this
document expressly excludes modifying it for any purpose or using it to create a derivative
therefrom.

Errata and Comments


If you have any comments regarding this manual or wish to report any errors in the
documentation, please document them and send them to the address below:
Technology Department
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland

Tel SB: +41 (0) 22 708 1150


Fax: +41 (0) 22 708 1160

Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@[Link]

3 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Table of Contents
Document History................................................................................................................... 2
Copyright................................................................................................................................ 3
Errata and Comments............................................................................................................. 3
Introduction............................................................................................................................. 5
Quick start (command line)..................................................................................................... 5
To start the server..................................................................................................................... 5
To stop the server...................................................................................................................... 5
To create an instance................................................................................................................. 5
To start an instance................................................................................................................... 5
To stop an instance.................................................................................................................... 5
To delete an instance................................................................................................................. 5
To have a full status of your server............................................................................................5
To have a status of one single instance.....................................................................................5
To reset an instance................................................................................................................... 6
To create a report...................................................................................................................... 6
Very Quick start (command line)................................................................................................ 6
The code coverage configuration file.........................................................................................7
Using the UI............................................................................................................................... 8
The inconsistencies.................................................................................................................. 10
Remote management by command line..................................................................................10
Start the receiver:................................................................................................................. 11
Shutdown the receiver:......................................................................................................... 11
Return the status of all (or a single) instance:......................................................................11
List all the instances’ names:................................................................................................ 11
Create a new Instance:......................................................................................................... 11
Delete an instance:............................................................................................................... 11
Reset an instance (clear the collected data):........................................................................11
Start an instance:.................................................................................................................. 11
Stop an instance:.................................................................................................................. 11
Generate a report (can take few minutes):...........................................................................11
The report................................................................................................................................ 12
The welcome page................................................................................................................ 13
The inconsistencies view....................................................................................................... 13
The report details.................................................................................................................. 14
XML files............................................................................................................................... 17

4 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
Introduction
The Code Coverage Receiver (ccr) is a standalone program which will receive information via
TCP from different running JBC code. This program can generate full html report. It can be
managed via a web interface as well as via command lines. The ccr can be configured to receive
information from different versions on the JBC.

Quick start (command line)


The Code Coverage Receiver (ccr) has only one binary (ccr / [Link]). It is located in the
<home_of_ccr>/bin directory. Before anything, make sure that the environment variable
JAVA_HOME pointing to a jre 1.7.x. From this binary, you can do all the necessary.

To start the server


ccr (.bat) start
This will start the server in background.

To stop the server


ccr (.bat) shutdown
Once the server is started, you need to create a new instance (this is effectively what will
receive information from your JBC programs.

To create an instance
ccr (.bat) create <instance_name> <tcp port> [“start”]
example: ccr create Test 12345 start
If you omit the start at the end, the instance is created but not started. You can start / stop and
instance like this:

To start an instance
ccr (.bat) start <instance name)
example: ccr start Test

To stop an instance
ccr (.bat) stop <instance name>
example: ccr stop Test

To delete an instance
ccr (.bat) delete <instance name>
example: ccr delete Test

To have a full status of your server


ccr (.bat) status

To have a status of one single instance


ccr (.bat) status <instance_name>

5 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
To reset an instance
ccr (.bat) reset <instance_name>
Resetting an instance means clearing all data received so far (starting fresh).

To create a report
ccr (.bat) make <instance name> [-p <path of precompile>] [-s <path of sources>] [-d <report
destination path>]
The path of precompile is the path containing all the precompile jars. If it is omitted, the Code
Coverage Receiver will obviously know nothing about the subroutines not having been
executed, and the subroutine coverage ratio will always be 100%. However, the line coverage
will be correct.
If the <path of sources> is omitted, the report won't be able to drill down until the sources (not
a big deal for management reporting)
If the <report destination path> is omitted, the report will be created in the default location:
<home_of_ccr>/data/<instance name>/report
Note: Creating a report is time consuming, and it can easily take up to 1-5 minutes depending
on your machine.
Be patient!

Very Quick start (command line)

Here is in few lines how to start from scratch, up to a report.


$ ccr start
$ ccr create myInstance 12345 start

Edit your [Link] like this :


[Link] = true
[Link] = localhost (or the ip address of ccr machine)
[Link] = 12345

Run your program (eg EX). One done,


$ccr make myInstance

Done!

6 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The code coverage configuration file.

At the root of your Code Coverage Receiver, you will find a file “[Link]”.
This file contains few information to make the server running:

vm_options=-Xms256M -Xmx2048M -XX:MaxPermSize=256M

http_port = 7470

instances = Test;running
vm_options - is the java VM options used when starting the receiver.
Please consult the internet for more options.

http_port - is the main port for all the Receiver. You can change it without any problem, but
make sure your server is stopped otherwise you won't have any other choice to “kill” it.

Instances - is a coma-separated list if names of instances.

Each instance is supposed to have its corresponding <instance> directory in which you will find
<instance>.property file as well as other resources.
There is no need to configure anything. The default values are all right for a normal activity.

7 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Using the UI

This is possible to manage your receiver via a web interface. For that, open a browser a browse:
[Link]

At

that stage, you can only Shutdown the receiver or create a new instance.
Let's click on “New Instance ...”

A very simple wizard will guide you through the instance creation. Small note: press <tab> after
having typed something for activating the navigations buttons.

8 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

Once you clicked finished, your main screen will look like this:

If

you read the “Quick start (command line)” chapter, you will recognize all the options on your
screen. No need to comment them again here.

Click on “Start” and … … you are ready to go !

Everything is persisted, so if you shut down the Receiver and restart if afterwards, it will remain
in the exact same status as when you stopped it.

9 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The inconsistencies

As you can see on the previous screenshots, an instance can be either “running” or “stopped”,
but the side-icons are showing three states.

The second state indicates that there are some inconsistencies in the data received (or loaded).
This is the “warning” state!

To understand what it means, you need to understand how it is all working.


At the runtime side (when you run your jBC code), there is a special process which collects the
line executed and send them in regular basis to the Code Coverage Receiver. Alongside with the
line numbers, there are 3 other information sent:
1) The Subroutine name.
2) The total number of lines in this subroutine
3) The $PACKAGE information.

The first one is obvious. The second one is here to be able to generate a report even if you are
not specifying a precompile directory. However, imagine that you run a first time you program,
the Receiver receives a certain total number of lines, then you modify the program and re-run it
without resetting the instance.
In that case, we have an inconsistency. The report will certainly be wrong. Fortunately, we can
see these inconsistencies (see the “report” chapter later in this document).

The situation is the same with the $PACKAGE information. You will see that in the report, the
data are organized by “module” / “component”. If, in the same instance, we receive 2 times the
same routine with a different package, this creates an “inconsistency”.

Remote management by command line

Since this is possible to manage a Code Coverage Receiver remotely with the UI, this is also
possible to do it command line.
All the commands (except start) can have the “host:port” information as a prefix.

Example: to add an instance on a remote machine (running ccr!), you can type:
ccr remote_ip:remote_port create instance_name port
Example:
$ccr [Link]:7470 create myNewInstance 1212

10 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The only command which cannot have a remote ip address is “start”. This seems obvious.
However, we can do something like this:
$ccr localhost:7480 start
This will start the Code Coverage Receiver on the port 7480.
In other words, for the start command, the host “localhost” is forced.
Here is the full syntaxes of all the available commands
[…] means “optional”
<...> means “any” value
“...” means a “strict” value

Start the receiver:


ccr [“localhost”:<ip>] start

Shutdown the receiver:


ccr [<host>:<ip>] shutdown

Return the status of all (or a single) instance:


ccr [<host>:<ip>] status [<instance name>]

List all the instances’ names:


ccr [<host>:<ip>] instances

Create a new Instance:


ccr [<host>:<ip>] create <instance name> <instance_port> [“start”]

Delete an instance:
ccr [<host>:<ip>] delete <instance name>

Reset an instance (clear the collected data):


ccr [<host>:<ip>] reset <instance name>

Start an instance:
ccr [<host>:<ip>] start <instance name>

Stop an instance:
ccr [<host>:<ip>] stop <instance name>

Generate a report (can take few minutes):


ccr [<host>:<ip>] make <instance name> [-p <precompile dir>] [-s <source dir>] [-d
<destination dir>]

11 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

12 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The report

Once the report is generated (either by command line with the “make” option or from the UI,
you will have a “report” directory containing “static” html pages.
This report is completely detached of anything and can be moved to a new machine.
Also, a zip file of the “report” directory is generated at the same time to make a download
easier.
From the UI (Browser) perspective, the links to the report (for immediate consultation) and to
the zip (for download) appears as shown here:

The zip file can be downloaded from command line with the wget program. The url is:
[Link] name>/[Link]
eg :
[Link]
The report url (if generated in default location) is:
[Link] name>/report/[Link]

13 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The welcome page

The welcome page will give an instant view on the coverage as follows:

Note: For the purpose of the documentation, the report has been based on a full component
build of T24 (running all the unit tests). Then, the report has been generated passing AN OLDER
version of the precompiled jars to force some inconsistencies.
You can see that this report has some inconsistencies. By clicking on the “<click for full list>,
you will see all the inconsistencies. Please read the “inconsistencies” chapter for more details.

The inconsistencies view


Here is a view of the inconsistencies:

14 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

The report details


The report is organized by module / component / subroutines.
Here is the different view you will have:
The “full” initial view:

One module view

15 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
All the components

You can sort the column by clicking on them:

One component:

16 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver

One routine:

XML files
In addition to the static html files composing the report, you can find a subdirectory called
“xml”. This directory contains xml files representing the coverage information by module /
component.
Here is an example of the “module” files:

17 Temenos Application Framework Java – (TAFJ)


Code Coverage Receiver
and here an example of the “component” files:

18 Temenos Application Framework Java – (TAFJ)

Common questions

Powered by AI

Inconsistencies in CCR reports are identified during execution when data conflicts arise, such as differing subroutine line counts or varying $PACKAGE information received multiple times. Handling these requires proper instance management, ensuring instances are reset after modifications to the source code to prevent inaccurate coverage data. Inconsistencies are visually identifiable in the reports and can be further diagnosed by examining data differences in earlier and later execution contexts .

The CCR ensures operational consistency across restarts by persisting its state; when the receiver is stopped and restarted, it resumes exactly where it left off. This feature is crucial as it saves existing configurations and data, allowing seamless continuity in coverage data collection and reporting. The persistent setup helps maintain data integrity and operational efficiency .

The CCR can be managed remotely using command-line instructions with the server's IP and port prefixed to commands. This allows actions like creating or deleting instances remotely. The limitation lies in the 'start' command, which cannot be executed remotely; it can only be initiated on localhost, ensuring initial setup control remains local while managing other aspects remotely .

Omitting the precompile path during report generation limits the receiver's ability to assess unexecuted subroutines, leading to a perpetual 100% subroutine coverage. Meanwhile, if the source path is omitted, the report cannot drill down to specific code details, reducing analysis depth but still suitable for higher-level management reporting. These omissions affect the granularity and accuracy of the coverage report provided by the CCR .

To create a new instance using the Code Coverage Receiver (CCR) via the command line, you need to execute the following steps: First, start the server with 'ccr (.bat) start'. Then, create a new instance using 'ccr (.bat) create <instance_name> <tcp port> [“start”]' and start it if not started by including 'start' at the end. To generate a report, use 'ccr (.bat) make <instance name> [-p <path of precompile>] [-s <path of sources>] [-d <report destination path>]'. Ensure paths are correctly specified for accurate reporting .

The CCR-generated report includes static HTML pages with a detailed overview organized by modules, components, and subroutines. When viewed, it provides different levels of detail, from an initial full view to specifics on modules, components, and individual routines. It also highlights any inconsistencies present. Each of these views can be sorted for clarity, and the report directory itself can be zipped and moved easily across systems .

The Code Coverage Receiver (CCR) marks inconsistencies when there are discrepancies between received data and the current execution context. After a program first sends data, any changes such as modifications to subroutines without resetting the instance will produce inconsistencies, affecting the report accuracy. These inconsistencies are visible in the report, showing variations in subroutine lines or $PACKAGE information received multiple times with different contexts .

The 'CCReceiver.properties' file is crucial for the CCR setup, configuring Java VM options, the main HTTP port, and instance definitions. It sets memory limits through VM options and specifies HTTP communication by defining 'http_port', ensuring CCR communicates properly over the network. The 'instances' configuration lists active instances, maintaining operational coherence without needing further adjustments for standard use .

Enabling coverage in 'tafj.properties' involves setting 'temn.tafj.runtime.enable.coverage' to true and specifying the CCR machine's host and port. This configuration is crucial as it allows the Code Coverage Receiver to collect execution data from the Java business components (JBC) being run, enabling the generation of meaningful coverage reports that detail code usage and identify untested areas .

The XML file structure in the CCR complements HTML report files by offering a machine-readable format of the coverage data, organized by module and component. This dual format allows for flexible data usage: HTML provides easy visual analysis for users, while XML supports automated data processing and integration into other tools or systems. Having both formats accommodates a broader range of use cases, enhancing the CCR's utility .

You might also like