当前位置:网站首页>一些突然迸发出的程序思想(模块化处理)
一些突然迸发出的程序思想(模块化处理)
2022-07-02 09:44:00 【荻风溪畔】
今天在测试写完的算法程序,但是整个程序全部跑通是需要很长时间的(10~30分钟)。
我在想怎么才能测试某一部分的程序呢,也就是其中有问题的那一块。
1. 单步调试
单步调试确实不错,能检查运行到某一个行的实时数据,但是我这个程序如果是在后半断出现错误的话,我岂不是也要等到程序运行到后面才能进行调试?这对于时间这么长的程序来说显然效率低下(别问我怎么知道的)
2. 程序模块化(高内聚低耦合)
其实我这个算法程序可以大概分成运算和绘图两个模块,但是目前来看,绘图很依赖运算的结果,调用结果数据才能运行,写的耦合太高,程序的维护成本和可读性变低了。我应该要实现让每个模块尽可能独立完成特定的子功能.
先让运算模块中生成一个绘图需要的csv文件,再通过读取这个文件来绘图。而不是直接调用结果数据。
这样我在运算模块正常输出的情况下,只测试有问题的绘图模块就好了。
边栏推荐
- 2.6 using recursion and stack - [tower of Hanoi problem]
- Use sqoop to export ads layer data to MySQL
- Error in kubeadm join: [error port-10250]: port 10250 is in use [error fileavailable--etc kubernetes PKI
- 甜心教主:王心凌
- Shuttle encapsulated AppBar
- drools动态增加、修改、删除规则
- IPhone 6 plus is listed in Apple's "retro products" list
- arcgis js 4.x 地图中加入图片
- CDA data analysis -- common knowledge points induction of Excel data processing
- Deep copy event bus
猜你喜欢

Experiment of connecting mobile phone hotspot based on Arduino and esp8266 (successful)

Go learning notes - multithreading

Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime

Docker-compose配置Mysql,Redis,MongoDB

Anxiety of a 211 programmer: working for 3 years with a monthly salary of less than 30000, worried about being replaced by fresh students

bellman-ford AcWing 853. 有边数限制的最短路

China traffic sign detection data set

drools动态增加、修改、删除规则

CDH6之Sqoop添加数据库驱动

分布式机器学习框架与高维实时推荐系统
随机推荐
堆 AcWing 838. 堆排序
Sub thread get request
计数类DP AcWing 900. 整数划分
Simple understanding of ThreadLocal
深拷貝 事件總線
AAAI 2022 | Peking University & Ali Dharma Institute: pruning and compression of pre training language model based on comparative learning
Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime
Performance tuning project case
高性能纠删码编码
浏览器存储方案
SparkContext: Error initializing SparkContext解决方法
深拷贝 事件总线
单指令多数据SIMD的SSE/AVX指令集和API
线性DP AcWing 898. 数字三角形
drools执行指定的规则
Introduction to CPU instruction set
JSON序列化 与 解析
Intel 内部指令 --- AVX和AVX2学习笔记
(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.
Go learning notes - multithreading