|
|
![forecasting_toolbox_backend](uploads/1d7b10c0921be273ad41dcb30c43784c/forecasting_toolbox_backend.png)## Description
|
|
|
|
|
|
The purpose of the Forecasting Toolbox is to provide predictive forecasts regarding the evolution of the three core quality attributes targeted by the SDK4ED platform, namely *Technical Debt*, *Energy* and *Dependability (Security)*. An overview of the structure that the Forecasting Toolbox back-end follows is presented below:
|
|
|
|
|
|
![forecasting_toolbox_backend](uploads/fd5594258bd55a13d9b99c9d0afd687b/forecasting_toolbox_backend.png).
|
|
|
|
|
|
As it can be seen. the entry point of the Forecasting Toolbox is a RESTful web server that uses the [Flask web framework](https://www.palletsprojects.com/p/flask/) wrapped inside [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/), a Python WSGI production-ready server. At a lower level, the server exposes three sub-modules, implemented as individual web services. Each web service plays the role of an end-point that allows the invocation of a set of forecasting models and returns the results, providing users with insightful information for the future evolution each of the three core quality attributes of a software application. The services supported by the Forecasting Toolbox are listed below:
|
|
|
- **TD Forecaster**: This web service is responsible for generating Technical Debt forecasts for a given software application. A TD forecast represents the predicted evolution of the total remediation effort (measured in minutes) to fix all code issues (e.g. code smells, bugs, code duplications, etc.) of a software application, up to a future point specified by the user.
|
|
|
- **Energy Forecaster**: This web service is responsible for generating Energy forecasts for a given software application. An Energy forecast represents the predicted evolution of the total energy consumption (measured in Joules) of a software application, up to a future point specified by the user.
|
|
|
- **Dependability Forecaster**: This web service is responsible for generating Security forecasts for a given software application. A Security forecast represents the predicted evolution of the Security Index (value between 0 and 1 that aggregates the entire program security characteristics) of a software application, up to a future point specified by the user.
|
|
|
|
|
|
The three web services allow the individual and remote invocation of the forecasting models developed for estimating the evolution of TD, Energy and Security. This is achieved through the dedicated API exposed by the RESTful web server, which allows the user to perform simple HTTP GET requests to the three web services. Several inputs need to be provided as URL-encoded parameters to these requests. These parameters are listed below:
|
|
|
|
|
|
| Parameter | Description | Required | Valid Inputs |
|
|
|
|:------------:|:---------------------------------------------------------------:|:--------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
|
| horizon | The forecasting horizon up to which forecasts will be produced. | Yes | An integer in range [1-N], where N depends on the volume of data used to train the regressor. Currently there is no upper limit and the service returns an error if this value is set too high. |
|
|
|
| project | The project ID for which the forecasts will be produced. | Yes | Currently the following string values are supported for testing purposes:<br>· TD Forecaster: ‘apache_kafka_measures’<br>· Security Forecaster: ‘square_retrofit_security_measures’<br>· Energy Forecaster: ‘sbeamer_gapbs_energy_measures’<br>Later, this input will be the ID of an actual project integrated into the SDK4ED platform. |
|
|
|
| regressor | The regressor model that will be used to produce forecasts. | No | One of the following string values: [‘auto’, ‘mlr’, ‘lasso’, ‘ridge’, ‘svr_linear’, ‘svr_rbf’, ‘random_forest’, ‘arima’].<br>Default value is ‘auto’. If this parameter is omitted, default value is set to ‘auto’ and the service selects automatically the best model based on validation error minimization. |
|
|
|
| ground_truth | If the model will return also ground truth values or not. | No | One of the following string values: [‘yes’, ‘no’].<br>Default value is ‘no. |
|
|
|
| test | If the model will produce Train-Test or unseen forecasts. | No | One of the following string values: [‘yes’, ‘no’].<br>Default value is ‘no’. If set to ‘no’, then the service uses the whole data to train a regressor and returns forecasts on unseen data. A value of ‘yes’ should be used only for model testing and not actual deployment into production. |
|
|
|
|
|
|
The output of the three individual web services provided by the Forecasting Toolbox, namely TD Forecaster, Energy Forecaster and Dependability Forecaster is a JSON file containing the predicted values for a particular quality attribute of the selected application (see [Usage](usage)). This JSON actually contains i) a status code of the response, ii) a N-size array containing the forecasts, where N is equal to the ‘horizon’ parameter, iii) a recap on the given parameter values, and iv) a message informing the user if the request was fulfilled successfully or not. |
|
|
\ No newline at end of file |