arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.06970physics.comp-ph
收藏

科学计算库中自动化回归测试的一种方法:以SPHinXsys为例

A method for automated regression test in scientific computing libraries: illustration with SPHinXsys

Bo Zhang, Chi Zhang, Xiangyu Hu

AI总结:

本文提出一种自动化回归测试方法,以开源多物理场库SPHinXsys为例,通过生成参考数据库和曲线相似度比较,在源代码更新时自动测试所有案例,确保修改不损害已验证的准确性,且原理通用。

摘要:

科学计算库,无论是内部开发的还是开源的,在工程和科学研究中都取得了巨大的进展。因此,确保由错误修复或新功能开发引起的源代码修改不会损害已经过验证和确认的准确性和功能性至关重要。鉴于这一点,本文介绍了一种开发和实现自动化回归测试环境的方法,并以开源多物理场库SPHinXsys \cite{zhang2021sphinxsys}为例。首先,每个基准测试的参考数据库是通过多次执行监测数据生成的。该数据库包含不同类型策略(即时间平均法、集合平均法以及动态时间规整法)的指标最大变化范围,涵盖了并行计算、粒子松弛、物理不稳定性等引起的不确定性。然后,在源代码修改后获得的新结果将根据基于曲线相似度的比较与这些参考数据进行测试。每当源代码更新时,将对所有测试用例自动执行回归测试,并用于报告当前结果的有效性。该回归测试环境已在SPHinXsys发布的所有动力学测试案例中实施,包括流体动力学、固体力学、流固耦合、热和质量扩散、反应扩散及其多物理场耦合,并显示出测试各种问题的良好能力。值得注意的是,虽然当前测试环境是为特定科学计算库构建和实施的,但其基本原理是通用的,可应用于许多其他库。

英文摘要:

Scientific computing libraries, either being in-house or open-source, have experienced enormous progress in both engineering and scientific research. It is therefore essential to ensure that the modifications in the source code aroused by bug fixing or new feature development wouldn't compromise the accuracy and functionality that has already been validated and verified. With this in mind, this paper introduces a method for developing and implementing an automatic regression test environment and takes the open-source multi-physics library SPHinXsys \cite{zhang2021sphinxsys} as an example. Firstly, the reference database for each benchmark test is generated from monitored data by multiple executions. This database contains the maximum variation range of metrics for different types of strategies, i.e., time-averaged method, ensemble-averaged method as well as the dynamic time warping method, covering the uncertainty arising from parallel computing, particle relaxation, physical instabilities, etc. Then, new results obtained after source code modification will be tested with them according to a curve-similarity based comparison. Whenever the source code is updated, the regression test will be carried out automatically for all test cases and used to report the validity of the current results. This regression test environment has already been implemented in all dynamics test cases released in SPHinXsys, including fluid dynamics, solid mechanics, fluid-structure interaction, thermal and mass diffusion, reaction-diffusion, and their multi-physics coupling, and shows good capability for testing various problems. It's worth noting that while the present test environment is built and implemented for a specific scientific computing library, its underlying principle is generic and can be applied to many others.

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

↑