当前位置:网站首页>一些突然迸发出的程序思想(模块化处理)
一些突然迸发出的程序思想(模块化处理)
2022-07-02 09:44:00 【荻风溪畔】
今天在测试写完的算法程序,但是整个程序全部跑通是需要很长时间的(10~30分钟)。
我在想怎么才能测试某一部分的程序呢,也就是其中有问题的那一块。
1. 单步调试
单步调试确实不错,能检查运行到某一个行的实时数据,但是我这个程序如果是在后半断出现错误的话,我岂不是也要等到程序运行到后面才能进行调试?这对于时间这么长的程序来说显然效率低下(别问我怎么知道的)
2. 程序模块化(高内聚低耦合)
其实我这个算法程序可以大概分成运算和绘图两个模块,但是目前来看,绘图很依赖运算的结果,调用结果数据才能运行,写的耦合太高,程序的维护成本和可读性变低了。我应该要实现让每个模块尽可能独立完成特定的子功能.
先让运算模块中生成一个绘图需要的csv文件,再通过读取这个文件来绘图。而不是直接调用结果数据。
这样我在运算模块正常输出的情况下,只测试有问题的绘图模块就好了。
边栏推荐
- VLAN experiment
- The second composition template of postgraduate entrance examination English / chart composition, English chart composition is enough
- Jenkins user rights management
- The differences and relationships among port, targetport, nodeport and containerport in kubenetes
- 单指令多数据SIMD的SSE/AVX指令集和API
- 计数类DP AcWing 900. 整数划分
- CPU指令集介绍
- Discrimination of the interval of dichotomy question brushing record (Luogu question sheet)
- LeetCode—剑指 Offer 59 - I、59 - II
- OpenCV中cv2.VideoWriter_fourcc()函数和cv2.VideoWriter()函数的结合使用
猜你喜欢
Enhance network security of kubernetes with cilium
Deep copy event bus
Floyd AcWing 854. Floyd求最短路
[ybtoj advanced training guidance] judgment overflow [error]
Go学习笔记—多线程
async/await 异步函数
(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.
线性DP AcWing 898. 数字三角形
Lekao: 22 year first-class fire engineer "technical practice" knowledge points
BOM DOM
随机推荐
深拷貝 事件總線
浏览器node事件循环
Intel 内部指令 --- AVX和AVX2学习笔记
Day12 control flow if switch while do While guessing numbers game
Error in kubeadm join: [error port-10250]: port 10250 is in use [error fileavailable--etc kubernetes PKI
What is the relationship between NFT and metauniverse? How to view the market? The future market trend of NFT
(C language) 3 small Codes: 1+2+3+ · · +100=? And judge whether a year is a leap year or a normal year? And calculate the circumference and area of the circle?
How to write a pleasing English mathematical paper
Drools executes the specified rule
Find the factorial of a positive integer within 16, that is, the class of n (0= < n < =16). Enter 1111 to exit.
1380. Lucky numbers in the matrix [two-dimensional array, matrix]
Go学习笔记—基于Go的进程间通信
This "little routine" is set on the dough cake of instant noodles. No wonder programmers are always hungry
2.7 binary tree, post order traversal - [FBI tree]
深拷贝 事件总线
Jenkins user rights management
PR 2021 quick start tutorial, learn about the and functions of the timeline panel
The differences and relationships among port, targetport, nodeport and containerport in kubenetes
drools动态增加、修改、删除规则
Anti shake throttle