Learn R Programming

softwareRisk: Computation of node and path-level risk scores in scientific models

Arnald Puy

The R package softwareRisk leverages the network-like architecture of scientific models together with software quality metrics to identify chains of function calls that are more prone to generating and propagating errors. It operates on tbl_graph objects representing call dependencies between functions (callers and callees) and computes risk scores for individual functions and for paths (sequences of function calls) based on cyclomatic complexity, in-degree and betweenness centrality. The package supports variance-based uncertainty and sensitivity analyses to assess how risk scores change under alternative risk definitions.

Installation

To install the stable version on CRAN, use

install.packages("softwareRisk")

To install the development version, use devtools:

install.packages("devtools") # if you have not installed devtools package already
devtools::install_github("arnaldpuy/softwareRisk", build_vignettes = TRUE)

Usage

Please see the vignette for a walkthrough of the package utilities.

A printable PDF version of this vignette is also available here.

Citation

To cite softwareRisk in publications:

Puy A (2025). softwareRisk: Computation of node and path-level risk scores in scientific models. R package version 0.1.0, https://github.com/arnaldpuy/softwareRisk.

A BibTeX entry for LaTeX users is

@Manual{puy2025_softwareRisk, title = {softwareRisk: Computation of node and path-level risk scores in scientific models}, author = {Arnald Puy}, year = {2025}, note = {R package version 0.1.0}, url = {https://github.com/arnaldpuy/softwareRisk} }

Copy Link

Version

Install

install.packages('softwareRisk')

Version

0.1.0

License

GPL-3

Maintainer

Arnald Puy

Last Published

January 21st, 2026

Functions in softwareRisk (0.1.0)

risk_form_variance_share_fun

Proportion of risk-score variance due to functional-form uncertainty
path_uncertainty_plot

Plot path-level uncertainty for the top-risk paths
path_fix_heatmap

Path-level improvement from fixing high-risk nodes
risk_ua_sa_fun

Internal helper for uncertainty and sensitivity analysis of node risk
plot_top_paths_fun

Plot the top risky call paths on a Sugiyama layout
slope_fun

Compute the linear slope of a numeric sequence
gini_index_fun

Compute the Gini index of a numeric vector
all_paths_fun

Enumerate entry-to-sink call paths and compute risk metrics at the node and path level
synthetic_graph

Synthetic citation graph for software risk examples
risk_eval_fun

Evaluate node risk under sampled parameters
theme_AP

A clean, publication-oriented ggplot2 theme
uncertainty_fun

Uncertainty and sensitivity analysis of node and path risk