当前位置:网站首页>一些突然迸发出的程序思想(模块化处理)
一些突然迸发出的程序思想(模块化处理)
2022-07-02 09:44:00 【荻风溪畔】
今天在测试写完的算法程序,但是整个程序全部跑通是需要很长时间的(10~30分钟)。
我在想怎么才能测试某一部分的程序呢,也就是其中有问题的那一块。
1. 单步调试
单步调试确实不错,能检查运行到某一个行的实时数据,但是我这个程序如果是在后半断出现错误的话,我岂不是也要等到程序运行到后面才能进行调试?这对于时间这么长的程序来说显然效率低下(别问我怎么知道的)
2. 程序模块化(高内聚低耦合)
其实我这个算法程序可以大概分成运算和绘图两个模块,但是目前来看,绘图很依赖运算的结果,调用结果数据才能运行,写的耦合太高,程序的维护成本和可读性变低了。我应该要实现让每个模块尽可能独立完成特定的子功能.
先让运算模块中生成一个绘图需要的csv文件,再通过读取这个文件来绘图。而不是直接调用结果数据。
这样我在运算模块正常输出的情况下,只测试有问题的绘图模块就好了。
边栏推荐
- Find the factorial of a positive integer within 16, that is, the class of n (0= < n < =16). Enter 1111 to exit.
- spfa AcWing 851. spfa求最短路
- WSL 2 will not be installed yet? It's enough to read this article
- How to write a pleasing English mathematical paper
- CDH6之Sqoop添加数据库驱动
- AAAI 2022 | Peking University & Ali Dharma Institute: pruning and compression of pre training language model based on comparative learning
- Drools executes string rules or executes a rule file
- String palindrome hash template question o (1) judge whether the string is palindrome
- Win10 system OmniPeek wireless packet capturing network card driver failed to install due to digital signature problem solution
- JSON序列化 与 解析
猜你喜欢

Tas (file d'attente prioritaire)

Lekao: 22 year first-class fire engineer "technical practice" knowledge points

浏览器存储方案

AAAI 2022 | Peking University & Ali Dharma Institute: pruning and compression of pre training language model based on comparative learning
![[ybtoj advanced training guidance] judgment overflow [error]](/img/be/bbe357ac2f2a8839afc5af47db88d0.jpg)
[ybtoj advanced training guidance] judgment overflow [error]

Brush questions --- binary tree --2
![2.6 using recursion and stack - [tower of Hanoi problem]](/img/fc/45038170dafd104691c93716b103cf.jpg)
2.6 using recursion and stack - [tower of Hanoi problem]
![[FFH] little bear driver calling process (take calling LED light driver as an example)](/img/e7/153ae9f1befc12825d277620049f9d.jpg)
[FFH] little bear driver calling process (take calling LED light driver as an example)

Heap (priority queue)

分布式机器学习框架与高维实时推荐系统
随机推荐
Lekao: 22 year first-class fire engineer "technical practice" knowledge points
AI中台技术调研
Lekao.com: experience sharing of junior economists and previous candidates in customs clearance
Rust search server, rust quick service finding tutorial
使用Sqoop把ADS层数据导出到MySQL
CDA data analysis -- common knowledge points induction of Excel data processing
Calculate the maximum path sum of binary tree
What data types does redis have and their application scenarios
China traffic sign detection data set
Drools executes the specified rule
WSL 2 will not be installed yet? It's enough to read this article
Leetcode - Sword finger offer 59 - I, 59 - II
Lombok common annotations
Map and set
接口测试面试题目,你都会了吗?
Leetcode - Sword finger offer 37, 38
Deep understanding of P-R curve, ROC and AUC
LeetCode—<动态规划专项>剑指 Offer 19、49、60
浏览器存储方案
Go learning notes - go based interprocess communication