Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Estimating a code regularity proxy of the Mastrave modelling library

Language: Layout:
+ ] Show input
Absolute running time: 3.25 sec, cpu time: 2.97 sec, memory peak: 50 Mb, absolute service time: 3.32 sec  
edit mode |  history  | discussion
Estimating a code regularity proxy of the Mastrave modelling library
--------------------------------------------------------------------
   
About the Mastrave modelling library (http://mastrave.org ):
   Mastrave is a free software library written to perform vectorised 
   scientific computing and to be as compatible as possible with both 
   GNU Octave and Matlab computing frameworks, offering general purpose, 
   portable and freely available features for the scientific community.  
   Mastrave is mostly oriented to ease complex modelling tasks such as 
   those typically needed within environmental models, even when 
   involving irregular and heterogeneous data series.
   
About code regularity:
   Source code complexity is measured with a great variety of metrics.
   Lines of code (LOC) or the Mc-Cabe's cyclomatic complexity (MCC) 
   are frequently used but also widely debated.
   As a very simple index for discussing the cognitive complexity of code, 
   in http://dx.doi.org/10.1145/2597008.2597140 it is suggested that 
   code regularity "may significantly reduce complexity, because once one 
   figures out the basic repeated element it is easier to understand 
   additional instances".
   Their proposed "metric for regularity is based on the observation that 
   regularity lies at the basis of text compression. [...] Therefore,
   the compression ratio can be used as a metric for regularity.
   
About code regularity in Mastrave:
   Mastrave implements the Semantic Array Programming paradigm and is
   structured using a detailed coding style for algorithms and comments.
   This disciplined coding style should generate a noticeable level of
   code regularity.
   For testing this hypothesis, the GNU Octave/MATLAB functions of the 
   library have been considered. The compression ratio of single files and 
   of the whole set of functions is computed with GNU gzip (option -9).
   The results show that part of the code regularity emerges when 
   considering the coding style consistency of the whole set of functions. 
   
uncompressed_bytes = 1053728

 
Method 1 : simple compression as zip archive (file by file)
compressed_bytes = 218605

compression_ratio =  0.79254
 
Method 2 : zip compression from a tar archive (whole set of files)
Method 2a: .tar.gz directly generated with GNU tar:
compressed_bytes = 157751

Method 2b: .tar.gz from a .tar file (GNU tar) then compressed (GNU gzip):
compressed_bytes = 157751

compression_ratio =  0.85029
 
List of processed files:
processed_files = Makefile.am
Makefile.in
cell2sparse.m
cell2sparse_.m
cellstr2index.m
central_value_nosparse_.m
check_is.m
computing_env_info.m
create_contiguous_intervals.m
create_contiguous_intervals_.m
cummean.m
cumstd.m
cumsumsq.m
cumvar.m
dist_corr.m
elem.m
fileinfo.m
find_disjoint_interval.m
find_disjoint_interval_.m
func_let.m
get_cell_elem.m
get_reference_data.m
gettext.m
graph_reduce.m
int2ordinal.m
mastrave.m
mat2groups.m
mat2layers.m
mat2multi.m
mat2multi_.m
matfind.m
mblk_fun.m
mdeal.m
mdeal_.m
mfind.m
mfind_.m
mloop.m
mplot_vline.m
mreg_replace.m
msplit.m
mstream.m
mstrrep.m
mtvroot.m
multi2colblocks.m
multi2mat.m
multi2mat_.m
mwlin.m
num2cellstr.m
rand_idx.m
rand_idx_.m
real2index.m
relativeind.m
score.m
screed.m
series_cell2mat.m
series_cell2mat_.m
series_shift_domain.m
series_shift_domain_.m
shortmatch.m
sortable2index.m
struct2vars.m
train_pca.m
txt_justify.m
vars2struct.m
wmedian.m


    
                
λ
.NET NoSQL database for rapid development