基于MVVM设计模式的LabVIEW NXG断点调试

 2022-06-20 11:06

论文总字数:27206字

摘 要

随着大型编程软件LabVIEW NXG的不断迭代和发布,现存源代码已经变得越来越庞大和臃肿,NI(美国国家仪器)公司的软件工程师们不得不花费额外的时间来研究现存代码的架构和功能,并在不破坏已有功能的情况下加入新的功能或者修复软件缺陷。对于公司来说,这种人力,时间和金钱上的代价会随着软件开发生命周期的延续而变得越来越大。

而LabVIEW NXG中断点调试功能部分的代码就是一个典型的软件危机实例,由于原开发者缺乏MVVM(模型-视图-视图模型)软件架构意识,写出了低内聚,高耦合的代码,等到其他功能模块出了问题的时候,已经有很多基于错误代码开发出来的拓展代码存在了。此时再修改断点调试代码,势必会牵扯到大片代码重构,花费软件工程师额外的,本不必要的开发时间并影响到多个团队的开发进度。但是为了软件质量和开发进度,即使代价再大,停下手头的工作来对断点调试代码进行重构显得尤为重要。

本文以科研的视角展开,具体从MVVM设计模式的软件架构思想,LabVIEW NXG开发的技术背景,为什么要重构断点调试代码,如何重构断点调试代码以及重构的结果等多个方面论述如何基于MVVM设计模式来重新构造LabVIEW NXG中断点调试代码。

关键词:模型-视图-视图模型,断点调试,代码重构,LabVIEW

BREAKPOINT DEBUGGING MODULE

IN LABVIEW NXG

BASED ON MVVM DESIGN PATTERN

Abstract

With the continuous iteration and release of the large programming software LabVIEW NXG, the existing source code has become increasingly large and bloated. Software engineers in NI (National Instruments) have to spend extra time to figure out the structure and function of existing code in order to develop new features and fix bugs. For the company, the cost on human resources, time, and money will increase as the software development life cycle continues.

The code of breakpoint debugging feature in LabVIEW NXG is a typical example of a software crisis. Because the original developers lacked the MVVM (Model-View-ViewModel) software architecture awareness, they wrote lots of low cohesion, high coupling code. When the code influenced other function module, there had been already many extension codes developed based on the error code. Modifying the breakpoint debugging code at this point will inevitably involve large-scale code refactor, costing software engineers extra, unnecessary development time and affecting the development progress of multiple teams. However, for the sake of software quality and development progress, it is even more important to stop the work on hand to refactor the breakpoint debugging code even though the cost is big.

This article presents the software architecture of the MVVM design pattern, the technical background of the LabVIEW NXG development, why it is necessary to refactor breakpoint debugging code, how to refactor the breakpoint debugging code, and the results of the refactoring to express how to refactor the LabVIEW NXG breakpoint debugging code based on the MVVM design pattern.

Keyword: MVVM, Breakpoint debugging, Code refactoring, LabVIEW

目 录

摘 要 I

Abstract II

第一章 绪论 1

1.1 论文的来源及背景 1

1.2 MVVM设计模式研究现状 2

1.3 本文研究内容 4

1.4 论文结构 4

第二章 研究背景及相关技术的讨论 5

2.1 LabVIEW NXG开发语言及架构简介 5

2.2 LabVIEW NXG断点调试相关功能简介 7

2.2.1 虚拟仪器技术简介 7

2.2.2 断点调试功能简介 8

2.3 企业内部关于断点调试重构的讨论 9

2.3.1 断点调试重构需求的提出 9

2.3.2 断点调试重构的抽象层对象 10

2.3.3 断点调试重构的实现层对象 10

2.4 代码重构在软件工程中的意义 12

第三章 LabVIEW NXG断点调试抽象层的研究和处理 13

3.1 针对断点调试抽象层的分析 13

3.2 断点调试抽象层的重新构造和分析 14

3.2.1 断点调试抽象层重构的思路 14

3.2.2 断点调试抽象层重构的实现细节 15

3.2.3 断点调试抽象层重构后存在的问题 17

3.3 断点调试抽象层重构后的测试框架 18

第四章 LabVIEW NXG断点调试实现层的研究和处理 19

4.1 虚拟仪器断点的研究和处理 19

4.1.1 虚拟仪器断点的定位方法 19

4.1.2 虚拟仪器断点的管理方法 20

4.1.3 虚拟仪器断点的重新构造 21

4.2 C语言断点的研究和处理 21

4.2.1 C语言断点的设置方法 21

4.2.2 C语言断点的位置更新方法 22

4.2.3 C语言断点的的重新构造 23

4.3 数学脚本断点的研究和处理 23

4.3.1 数学脚本单行多断点的设置方法 24

4.3.2 数学脚本多目标类型和位置更新的方法 24

4.3.3 数学脚本断点的重新构造 25

第五章 测试结果与成果展示 26

5.1 测试结果 26

5.2 提交成果 28

第六章 总结和展望 29

致 谢 31

参考文献 32

  1. 绪论
    1. 论文的来源及背景

LabVIEW是一种程序集成开发环境,由NI(美国国家仪器)公司研制开发并于1986年发行第一个版本,专门用于NI公司研发的图形化编程语言——G语言的的开发工作。它与G语言的关系就相当于Eclipse之于Java,Visual Studio之于C#。LabVIEW在NI出色的硬件支持和便于工程师入门,节省编码时间等诸多优点的支持下,迅速占领了工业界嵌入式系统开发的大量份额,深受工业界科学家,工程师以及相关专业师生的热爱,素有“工业界的Windows”美称。然而,经过30多年漫长的开发迭代,过老的软件平台和架构使得LabVIEW不再能够满足日新月异的工程需求,想要开发新的功能也很难继续进行。所以NI公司早在十年前就开始投入研发使用新平台,新架构的全新一代LabVIEW并称之为LabVIEW NXG。

剩余内容已隐藏,请支付后下载全文,论文总字数:27206字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;