当前位置:网站首页>一些突然迸发出的程序思想(模块化处理)
一些突然迸发出的程序思想(模块化处理)
2022-07-02 09:44:00 【荻风溪畔】
今天在测试写完的算法程序,但是整个程序全部跑通是需要很长时间的(10~30分钟)。
我在想怎么才能测试某一部分的程序呢,也就是其中有问题的那一块。
1. 单步调试
单步调试确实不错,能检查运行到某一个行的实时数据,但是我这个程序如果是在后半断出现错误的话,我岂不是也要等到程序运行到后面才能进行调试?这对于时间这么长的程序来说显然效率低下(别问我怎么知道的)
2. 程序模块化(高内聚低耦合)
其实我这个算法程序可以大概分成运算和绘图两个模块,但是目前来看,绘图很依赖运算的结果,调用结果数据才能运行,写的耦合太高,程序的维护成本和可读性变低了。我应该要实现让每个模块尽可能独立完成特定的子功能.
先让运算模块中生成一个绘图需要的csv文件,再通过读取这个文件来绘图。而不是直接调用结果数据。
这样我在运算模块正常输出的情况下,只测试有问题的绘图模块就好了。
边栏推荐
- Sweetheart leader: Wang Xinling
- drools执行String规则或执行某个规则文件
- In development, why do you find someone who is paid more than you but doesn't write any code?
- 浏览器node事件循环
- 趣味 面试题
- 计数类DP AcWing 900. 整数划分
- String palindrome hash template question o (1) judge whether the string is palindrome
- LeetCode—<动态规划专项>剑指 Offer 19、49、60
- Win10 system OmniPeek wireless packet capturing network card driver failed to install due to digital signature problem solution
- Embedded Software Engineer career planning
猜你喜欢

线性DP AcWing 897. 最长公共子序列

"As a junior college student, I found out how difficult it is to counter attack after graduation."

In development, why do you find someone who is paid more than you but doesn't write any code?

The blink code based on Arduino and esp8266 runs successfully (including error analysis)

包管理工具

Jenkins user rights management

Docker-compose配置Mysql,Redis,MongoDB

JSON序列化 与 解析

Brush questions --- binary tree --2

Anxiety of a 211 programmer: working for 3 years with a monthly salary of less than 30000, worried about being replaced by fresh students
随机推荐
China traffic sign detection data set
单指令多数据SIMD的SSE/AVX指令集和API
Introduction to CPU instruction set
Bom Dom
Sse/avx instruction set and API of SIMD
堆 AcWing 838. 堆排序
BOM DOM
Drools terminates the execution of other rules after executing one rule
Go学习笔记—多线程
drools执行完某个规则后终止别的规则执行
Does C language srand need to reseed? Should srand be placed in the loop? Pseudo random function Rand
Embedded Software Engineer career planning
FBX import under ue4/ue5 runtime
kubeadm join时出现错误:[ERROR Port-10250]: Port 10250 is in use [ERROR FileAvailable--etc-kubernetes-pki
Multiply LCA (nearest common ancestor)
Intel 内部指令 --- AVX和AVX2学习笔记
ThreadLocal的简单理解
线性DP AcWing 902. 最短编辑距离
Addition, deletion, modification and query of MySQL table (Advanced)
Lekao: 22 year first-class fire engineer "technical practice" knowledge points