arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.07712cs.SE
收藏

Mock深度测试:面向深度学习数据与模型的分离开发

Mock Deep Testing: Toward Separate Development of Data and Models for Deep Learning

Ruchira Manke, Mohammad Wardat, Foutse Khomh, Hridesh Rajan

AI总结:

针对深度学习数据与模型难以独立测试的问题,提出Mock深度测试方法及KUnit框架,通过模块化分解和Mock依赖建模实现组件单元测试,有效识别并解决问题,提升开发效率。

摘要:

尽管深度学习(DL)已渗透并成为许多关键软件系统的核心组件,但当前软件工程研究尚未探索如何分别测试对DL方法有效运行至关重要的数据和模型。独立测试这些组件的主要挑战源于数据与模型之间的紧密依赖。本研究探索这一空白,引入Mock深度测试方法用于DL应用的单元测试。为实现单元测试,我们提出一种设计范式,将工作流分解为独立、可管理的组件,最小化顺序依赖,并模块化DL的关键阶段。对于这些组件的单元测试,我们建议使用Mock对其依赖进行建模。这种模块化方法促进组件的独立开发和测试,确保开发过程中的全面质量保证。我们开发了KUnit框架,用于为Keras库启用Mock深度测试。我们通过实证评估KUnit以确定Mock的有效性。对从Stack Overflow和GitHub获取的50个DL程序的评估显示,Mock有效识别了数据准备阶段的10个问题和模型设计阶段的53个问题。我们还对36名参与者使用KUnit进行了用户研究,以感知我们方法的有效性。使用KUnit的参与者成功解决了数据准备阶段的25个问题和模型设计阶段的38个问题。我们的研究结果强调,Mock对象为单元测试提供了依赖的轻量级仿真,促进早期错误检测。最后,为评估KUnit的可用性,我们进行了研究后调查。结果表明,KUnit对DL应用开发人员有帮助,使他们能够在不同阶段有效独立测试每个组件。

英文摘要:

While deep learning (DL) has permeated, and become an integral component of many critical software systems, today software engineering research hasn't explored how to separately test data and models that are integral for DL approaches to work effectively. The main challenge in independently testing these components arises from the tight dependency between data and models. This research explores this gap, introducing our methodology of mock deep testing for unit testing of DL applications. To enable unit testing, we introduce a design paradigm that decomposes the workflow into distinct, manageable components, minimizes sequential dependencies, and modularizes key stages of the DL. For unit testing these components, we propose modeling their dependencies using mocks. This modular approach facilitates independent development and testing of the components, ensuring comprehensive quality assurance throughout the development process. We have developed KUnit, a framework for enabling mock deep testing for the Keras library. We empirically evaluated KUnit to determine the effectiveness of mocks. Our assessment of 50 DL programs obtained from Stack Overflow and GitHub shows that mocks effectively identified 10 issues in the data preparation stage and 53 issues in the model design stage. We also conducted a user study with 36 participants using KUnit to perceive the effectiveness of our approach. Participants using KUnit successfully resolved 25 issues in the data preparation stage and 38 issues in the model design stage. Our findings highlight that mock objects provide a lightweight emulation of the dependencies for unit testing, facilitating early bug detection. Lastly, to evaluate the usability of KUnit, we conducted a post-study survey. The results reveal that KUnit is helpful to DL application developers, enabling them to independently test each component effectively in different stages.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑