【STMT】Halstead复杂度

软件测试笔记二 掌握数据流分析、控制流分析、软件复杂度度量。 静态测试方法: 一。 数据流分析 1. 定义: 数据流分析测试是指变量定义(赋值)与使用位置的一种基于程序结构性的测试方法。重点关注变量的定义与使用。 2.数据流分析与路径测试的区别在于:: 路径测试基本上是从数学(控制流图)角度来分析的,而数据流测试则是利用了变量之间的关系,通过定义-使用路径和程序片,得到... 阅读详情

Halstead复杂度

Halstead复杂度度量是软件复杂性的难度度量元,用于在程序产生或设计完成之后估算软件的复杂性。Halstead复杂度度量基于程序中的操作符和操作数的数量,对操作符和操作数的不同选取将得到不同的结果。常见的操作符和操作数如下

  • 操作符:保留字、函数调用、运算符
  • 操作数:常数、常量、变量

需要注意的是,声明变量的数据类型保留字可以不计入操作符数量。根据编程规范的不同,在一条声明语句中既可以只声明一个变量,也可以声明多个变量,因此如果计入操作符数量,不同的编程规范可能导致差别较大的结果。
Halstead复杂度有11个常用的度量指标。设 n 1 n_1 n1​表示程序中不同的操作符个数, N 1 N_1 N1​表示程序中出现的操作符总数, n 2 n_2 n2​表示程序中不同的操作数个数, N 2 N_2 N2​表示程序中出现的操作数总数, S S S表示程序中的语句数,Halstead复杂度的所有指标都可以用 n 1 , N 1 , n 2 , N 2 , S n_1, N_1, n_2, N_2, S n1​,N1​,n2​,N2​,S来计算。Halstead度量指标如下

  • 程序词汇表长度 Program Vocabulary: n = n 1 + n 2 n = n_1 + n_2 n=n1​+
halstead:Halstead 复杂性度量的 JavaScript 实现 霍尔斯特德 Halstead 复杂性度量的 JavaScript 实现。 安装 npm install halstead --save 用法 halstead(source); 执照 麻省理工学院执照 立即下载

相关推荐

时间复杂度测试程序

分别测出代码计算x^n所需的时间长短,用于观察迭代递归循环三种不同方法对程序运行时间所产生的影响。

揭秘个人开发者接支付宝的‘野路子’:不用企业资质,用Python模拟扫码转账与回调监听

本文探讨了个人开发者如何通过Python模拟支付宝扫码转账与回调监听的技术实现,解析了支付宝URL协议格式,并设计了本地化的支付状态监听方案。文章强调该方法仅用于技术研究,实际应用需遵守支付宝官方接口和金融合规要求。

weixin_30736301的博客 417

第七章 Wi-Fi连接过程

系列文章目录 第一章 国内下载AOSP最新源码的方法 第二章 下载AOSP WiFi相关的代码 第三章 将源码导入Android Studio(无需编译idegen) 文章目录系列文章目录前言一、Wi-Fi连接是什么?二、Wi-Fi连接的过程1. 手动连接总结 前言 Wi-Fi连接分为下面几种过程,每种的流程都有些许差异: 手动连接 自动连接 在BSS之间漫游 Passpoint热点连接 一、Wi-Fi连接是什么? Wi-Fi连接是指STA(手机)连接到AP(无线路由器)的过程,这个过程分为链路

Frank.Zhang的专栏 2532

Bootloader详解,理解Bootloader看这篇就够了

这里写目录标题一、Bootloader作用(目的)二、完成Boot最终目的的前提条件三、对前提条件的详细说明3.1、对前提条件(1)的说明:3.2、对前提条件(2)的说明:3.3、对前提条件(3)的说明:3.4、对前提条件(4)的说明:3.4、对前提条件(5)的说明:四、loader是干啥的 一、Bootloader作用(目的) Bootloader=Boot + loader Boot的目的: 最终目的:跳到C语言中;为了C语言运行程序会进行一系列的初始化,系统一上电后如何通过一系列的设置让软件程序员

iduuigdg的博客 11万+

【Go语言实战】(9) gRPC 实现一个简单微服务

文章目录写在前面1. 安装1.1 grpc1.2 proto1.3 protobuf2. 编写代码2.1 初始化项目2.2 编写proto2.3 编写服务端2.4 实现客户端3. 演示 写在前面 这一次我们用gRPC实现获取用户的信息 1. 安装 1.1 grpc grpc的安装直接go get即可 go get google.golang.org/grpc 1.2 proto 下载proto,我是下载这个的。 然后解压出来把bin目录放在直接放在系统变量当中 1.3 protobuf 我们在

面向生活编程 3275

数学建模学习(121):Python实现模糊AHP(Fuzzy AHP)——从原理到实践

Python实现模糊AHP(Fuzzy AHP)

全栈川川 1556

【YOLOv11多模态融合改进】| CVPR2025 LCA轻量交叉注意力 双向模态交叉引导 + 双支路噪点抑制,兼顾纹理与热目标特征融合

可见光模态富含纹理、色彩、边缘细节,但夜间/低照度场景信噪比极低,暗区噪声泛滥;红外模态依靠热辐射凸显弱小目标、暗区物体轮廓,但缺失真实色彩与精细纹理。简单拼接/逐加融合仅做浅层特征叠加,无法建立可见光纹理、红外热特征的双向引导关联,两类模态互补信息无法精准互通;普通自注意力仅单模态内部建模,跨模态交互匮乏,红外热目标易被可见光暗噪声淹没,可见光有效纹理易被红外灰度信息覆盖;

Limiiiing的博客 131

基于PChmi.dll的PLC报警显示和记录(C#)

本文介绍了如何使用C#编写基于PChmi.dll的程序,实现PLC报警的显示和记录功能。通过订阅PLC的报警事件,我们可以实时显示报警信息,并通过日志文件记录报警历史。PLC(可编程逻辑控制器)在工业自动化领域中扮演着重要的角色,而报警显示和记录是PLC应用中常见的需求。本文将介绍如何使用C#编写基于PChmi.dll的程序,实现PLC报警的显示和记录功能。当然,这只是实现报警显示和记录的基本框架,具体的实现方式可能因不同的PLC和HMI库而有所差异。你需要根据你所使用的具体库和设备进行相应的调整和修改。

ByteLegend的博客 1674

Docker MySQL 全量+增量定时备份 小白保姆级教程

Linux CentOS / Ubuntu 服务器Docker 容器化部署 MySQL8线上生产库、测试库均适用MYSQL_CONTAINER="mysql8" # 你的Docker MySQL容器名称MYSQL_PWD="Root@123456" # 你的MySQL root账号密码DB_NAME="test_db_a" # 你自己要备份的数据库名称BACKUP_DIR="备份目录路径" # 自定义备份存放路径改完重新授权、手动测试一遍即可。

与海 289

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

上一篇: 【NLP】最小编辑距离
下一篇: 【STMT】McCabe环路复杂度
FantasticGold
博客等级 码龄10年 15粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值