FabrizioSandri / RcppDeepState

RcppDeepState, a simple way to fuzz test code in Rcpp packages
https://fabriziosandri.github.io/gsoc-2022-blog/
6 stars 5 forks source link

Logging improvements #9

Closed FabrizioSandri closed 2 years ago

FabrizioSandri commented 2 years ago

Description

The purpose of this pull request is to improve the logging system of RcppDeepState. In this way developers that will be able to rapidly identify any issues that may arise using this library.

FabrizioSandri commented 2 years ago

With the last few commit I improved the logging system when some functions being analyzed contains as argument data types that are not allowed.

In detail, the function deepstate_pkg_create fails if developers try to run the TestHarness creation procedure on a library with functions containing in their signature (the argument list), data types which are not allowed with the following error message:

Testharnesses cannot be created for the package - datatypes fall out of specified list!!

This has been improved, printing for each function not analyzed, the list of parameters that fall out of the allowed list.

FabrizioSandri commented 2 years ago

Since importing RInside in the R code is not essential, I deleted it from the imports in the most recent commits. There is no need to import RInside because it is already there in the DESCRIPTION file, in the dependencies list. RInside will instead be imported and used inside the C++ code.

Additionaly I discovered that certain code parts require a little bit of review. For instance, there are parts of the code that are not used, such variable definitions. For example, I deleted the following line in the commit b012edb.

prototypes_calls <-deepstate_get_prototype_calls(package_path)

Because RcppDeepState is all about speed and performance to run the tests, even little adjustments like this one may have some impact.

FabrizioSandri commented 2 years ago

With the most recent updates, I added the verbose argument to various RcppDeepState methods. This option is used to offer more detailed information if it is set to TRUE. This parameter uses the value from the global option verbose by default.

FabrizioSandri commented 2 years ago

@tdhock do you think I need to make any other adjustments? I plan to review again the logging part later on. To allow you to review these changes, I have sent you an invite to participate as a collaborator.

tdhock commented 2 years ago

for the list of supported types, instead of one column per type please try one row per type like this:

datatype <- function(ctype,rtype,args)data.table(ctype,rtype,args)
types_table <- rbind(
  datatype("int", "IntegerVector", "(low,high)"),
  datatype("double", "NumericVector", "(low,high)"))
setkey(types_table, ctype)
type_info <- types_table[my_type]
type_info$args
FabrizioSandri commented 2 years ago

@tdhock I replaced the list of supported datatypes with the types_table you mentioned in your previous comment and discussed in the Google meet of Tuesday.