While AI coding tools have demonstrated potential to accelerate software development, their use in scientific computing raises critical questions about code quality and scientific validity. In this paper, we provide ten practical rules for AI-assisted coding that balance leveraging capabilities of AI with maintaining scientific and methodological rigor. We address how AI can be leveraged strategically throughout the development cycle with four key themes: problem preparation and understanding, managing context and interaction, testing and validation, and code quality assurance and iterative improvement. These principles serve to emphasize maintaining human agency in coding decisions, establishing robust validation procedures, and preserving the domain expertise essential for methodologically sound research. These rules are intended to help researchers harness AI's transformative potential for faster software development while ensuring that their code meets the standards of reliability, reproducibility, and scientific validity that research integrity demands.
翻译:尽管AI编码工具已展现出加速软件开发的潜力,但它们在科学计算中的应用引发了关于代码质量和科学有效性的关键问题。本文提出了十条AI辅助编码的实用准则,旨在平衡利用AI能力与保持科学及方法论严谨性之间的关系。我们围绕开发周期中的四个核心主题展开论述:问题准备与理解、上下文管理与交互、测试与验证,以及代码质量保证与迭代改进。这些原则着重强调在编码决策中保持人类主体性、建立稳健的验证流程,并保留方法论严谨研究不可或缺的领域专业知识。本准则旨在帮助研究者利用AI的变革潜力加速软件开发,同时确保其代码符合研究完整性所要求的可靠性、可复现性与科学有效性标准。