... | ... | @@ -13,6 +13,7 @@ Having the Technical Dent Toolbox Docker Container already deployed on your loca |
|
|
Each of these tools has its own web service that is divided into additional endpoints. The web services allow the individual and remote invocation of the tools to start analysis and to return pre analysed data. This is achieved through the dedicated API exposed by the RESTful web server which allows the user to perform simple HTTP GET and POST requests to the web services. Several inputs need to be provided as URL-encoded parameters to these requests. The URLs, parameters and indicative examples for each of the web services are provided in the next sections. Regarding the identification of refactoring opportunities, in the toolbox, we include two high-level approaches:
|
|
|
|
|
|
• **Code-Level refactorings, as suggested by SonarQube:** We present a list of TD issues identified at the source code level, ordered by code smell probability. In particular, we calculate the percentage of the files in which a specific code smell resides in (probability to maintain a file that suffers from the specific smell) and multiply it by the average interest probability of these files. The resulting code smells interest probability represents the possibility that a developer faces this issue when maintaining the system.
|
|
|
|
|
|
• **Design-Level refactorings are provided in two forms:** Either in the form of extract method refactoring opportunities, i.e., ways to split a long method; or in the form of move class refactorings, i.e., ways to improve the modularity of software packages so that they obey to the Single Responsibility Principle.
|
|
|
|
|
|
# Invocation of the individual services (APIs)
|
... | ... | @@ -23,7 +24,7 @@ After starting the Docker Container of the Technical Debt Toolbox back-end, its |
|
|
<local_IP>:<defined_port>/<service>
|
|
|
```
|
|
|
|
|
|
where the <local_IP> is the IP of the local machine on which the Technical Debt Toolbox Docker Container has been deployed, whereas the <defined_port> is the port of the Server that is defined by the user during the installation and <service> is the service invocation that the user wants to call (for example: principalSummary, interestSummary).
|
|
|
where the <local_IP> is the IP of the local machine on which the Technical Debt Toolbox Docker Container has been deployed, whereas the <defined_port> is the port of the Server that is defined by the user during the installation and <service> is the service invocation that the user wants to call (for example principalSummary, interestSummary).
|
|
|
|
|
|
In order to invoke any of the available web services, the right resource (i.e., end point) should be used. The resources (i.e., end points) of the web services of the Technical Debt Toolbox are listed below:
|
|
|
|
... | ... | @@ -65,7 +66,8 @@ In the following, a more detailed description of how these services can be used |
|
|
|
|
|
## TD Analysis Service
|
|
|
|
|
|
The entry point of the TD Toolbox of Breaking Point Tool is a RESTful web server written in JavaScript using the Express framework. Express.js, or simply Express, is a web application framework for Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. To decouple the functionalities, a web service per task has been created. The main web-services supported by TD Breaking Point Tool, return data in a json format and are listed below:
|
|
|
The entry point of the TD Toolbox of Breaking Point Tool is a RESTful web server written in Java using the Spring Boot framework. Spring Boot framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. Spring is widely used for creating scalable applications. For web applications, Spring provides Spring MVC which is a widely used module of spring which is used to create scalable web applications. Spring Boot is built on the top of the spring and contains all the features of spring. The main web-services supported by TD Breaking Point Tool return data in a JSON format and are listed below:
|
|
|
|
|
|
- **TD Principal:** This web service is responsible for generating TD Principal for a given software application. The metrics are calculated at project, package and file level.
|
|
|
- **TD Interest:** This web service is responsible for generating TD Interest for a given software application. The metrics are calculated at project, package and file level.
|
|
|
|
... | ... | @@ -80,7 +82,7 @@ The entry point of the TD Toolbox of Breaking Point Tool is a RESTful web server |
|
|
|
|
|
| Parameter | Description | Required | Type |
|
|
|
|:------------:|:---------------------------------------------------------------:|:--------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
|
| projectID | The name of the project. The name should be the same as the name that given through the analysis phase. | Yes | String |
|
|
|
| projectID | The name of the project. The name should be the same as the name given through the analysis phase. | Yes | String |
|
|
|
|
|
|
**Principal Indicators**
|
|
|
|
... | ... | @@ -96,7 +98,7 @@ Authorization: - |
|
|
|
|
|
**Response**
|
|
|
|
|
|
The response format is like a table (columns, rows). Includes TD in minutes, TD in currency, number of bugs, number of vulnerabilities, number of duplications, and number of code smells for the each artefact. Same output for java and c projects.
|
|
|
The response format is like a table (columns, rows). Includes TD in minutes, TD in currency, number of bugs, number of vulnerabilities, number of duplications, and number of code smells for each artefact. Same output for java and c projects.
|
|
|
```
|
|
|
{
|
|
|
"principalIndicators":{
|
... | ... | @@ -156,7 +158,7 @@ The response format is like a table (columns, rows). Includes TD in minutes, TD |
|
|
|
|
|
**Principal Summary**
|
|
|
|
|
|
Principal summary includes the same metrics as before but at project level.
|
|
|
The principal summary includes the same metrics as before but at the project level.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
... | ... | @@ -168,7 +170,7 @@ Headers: - |
|
|
Authorization: -
|
|
|
|
|
|
**Response**
|
|
|
The response includes TD in minutes, TD in currency, number of bugs, number of vulnerabilities, number of duplications, and number of code smells at project level. Same output for java and c projects.
|
|
|
The response includes TD in minutes, TD in currency, number of bugs, number of vulnerabilities, number of duplications, and number of code smells at the project level. Same output for java and c projects.
|
|
|
```
|
|
|
{
|
|
|
"principalSummary":{
|
... | ... | @@ -205,7 +207,7 @@ The response includes TD in minutes, TD in currency, number of bugs, number of v |
|
|
|
|
|
| Parameter | Description | Required | Type |Notes |
|
|
|
|:------------:|:---------------------------------------------------------------:|:--------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
|
| projectID | The name of the project. The name should be the same as the name that given through the analysis phase. | Yes | String |
|
|
|
| projectID | The name of the project. The name should be the same as the name given through the analysis phase. | Yes | String |
|
|
|
| language | The programming language of the software project that needs to be analyzed. | Yes | String | Accepted strings are: java and c. For c++ projects use c.
|
|
|
|
|
|
|
... | ... | @@ -224,7 +226,7 @@ Headers: - |
|
|
Authorization: -
|
|
|
|
|
|
**Response**
|
|
|
The response includes interest metrics in project level. These metrics are: interest and principal in currency, breaking point, and interest probability.
|
|
|
The response includes interest metrics in the project level. These metrics are: interest and principal in currency, breaking point, and interest probability.
|
|
|
```
|
|
|
{
|
|
|
"interestSummary":{
|
... | ... | @@ -239,7 +241,7 @@ The response includes interest metrics in project level. These metrics are: inte |
|
|
|
|
|
**Interest Indicators**
|
|
|
|
|
|
Interest indicators includes interest metrics at artefact level.
|
|
|
Interest indicators include interest metrics at artefact level.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
... | ... | @@ -360,7 +362,7 @@ The response is a value between 0 and 1. The interest for this project among the |
|
|
|
|
|
**Interest Line Chart**
|
|
|
|
|
|
Interest at project level for each version.
|
|
|
Interest at the project level for each version.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
... | ... | @@ -374,7 +376,7 @@ Authorization: - |
|
|
|
|
|
**Response**
|
|
|
|
|
|
The response includes the interest of the project for each version. For projectID = ‘Neurasmus’ there are 9 version, so the sample response has 9 rows.
|
|
|
The response includes the interest of the project for each version. For projectID = ‘Neurasmus’ there are 9 versions, so the sample response has 9 rows.
|
|
|
```
|
|
|
{
|
|
|
"lineChartInterestTD":{
|
... | ... | @@ -395,11 +397,11 @@ The response includes the interest of the project for each version. For projectI |
|
|
|
|
|
**Principal Line Chart**
|
|
|
|
|
|
Principal at project level for each version.
|
|
|
Principal at the project level for each version.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
|
|
In this example, we want to retrieve principal per version for the project with ID ‘Neurasmus’ and language ‘c’. Same output for java projects.
|
|
|
In this example, we want to retrieve the principal per version for the project with ID ‘Neurasmus’ and language ‘c’. Same output for java projects.
|
|
|
|
|
|
{GET} http://195.251.210.147:7070/lineChartPrincipalTD/search?projectID=Neurasmus&language=c
|
|
|
|
... | ... | @@ -430,7 +432,7 @@ The response includes the principal of the project for each version. For project |
|
|
|
|
|
**Breaking Point Line Chart**
|
|
|
|
|
|
Breaking Point at project level for each version.
|
|
|
Breaking Point at the project level for each version.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
... | ... | @@ -444,7 +446,7 @@ Authorization: - |
|
|
|
|
|
**Response**
|
|
|
|
|
|
The response includes the breaking point of the project for each version. For projectID = ‘Neurasmus’ there are 9 version, so the sample response has 9 rows.
|
|
|
The response includes the breaking point of the project for each version. For projectID = ‘Neurasmus’ there are 9 versions, so the sample response has 9 rows.
|
|
|
```
|
|
|
{
|
|
|
"lineChartBreakingPointTD":{
|
... | ... | @@ -464,7 +466,7 @@ The response includes the breaking point of the project for each version. For pr |
|
|
```
|
|
|
**Cumulative Interest Line Chart**
|
|
|
|
|
|
Cumulative Interest at project level for each version.
|
|
|
Cumulative Interest at the project level for each version.
|
|
|
|
|
|
**Sample Request**
|
|
|
In this example, we want to retrieve cumulative per version for the project with ID ‘Neurasmus’ and language ‘c’. Same output for java projects.
|
... | ... | @@ -477,7 +479,7 @@ Authorization: - |
|
|
|
|
|
**Response**
|
|
|
|
|
|
The response includes the cumulative interest of the project for each version. For projectID = ‘Neurasmus’ there are 9 version, so the sample response has 9 rows.
|
|
|
The response includes the cumulative interest of the project for each version. For projectID = ‘Neurasmus’ there are 9 versions, so the sample response has 9 rows.
|
|
|
```
|
|
|
{
|
|
|
"cumulativeInterestLineChart":{
|
... | ... | |