迈向基于 LLM 的自动化试玩测试
Towards LLM-Based Automatic Playtest
AI总结:
本文提出基于LLM的自动化试玩测试方法Lap,通过将游戏画面转为数字矩阵并利用ChatGPT生成动作,在CasseBonbons三消游戏中实现了优于现有工具的代码覆盖率和崩溃检测效果。
摘要:
试玩测试是人们通过游玩电子游戏来进行测试的过程。它对于游戏软件的质量保证至关重要。人工试玩测试耗时且昂贵。然而,自动化这一过程极具挑战性,因为试玩测试通常需要领域知识和解决问题的能力,而大多数传统测试工具缺乏这些能力。人工智能(AI)的最新进展为将大型语言模型(LLMs)应用于试玩测试开辟了新的可能性。然而,仍存在重大挑战:当前的 LLM 无法视觉感知游戏环境,且大多数现有研究集中于基于文本的游戏或具有健壮 API 的游戏。许多非文本游戏缺乏提供游戏状态文本描述的 API,这使得直接应用 LLM 进行试玩测试几乎不可能。本文介绍了 Lap,这是我们基于 LLM 的自动化试玩测试的新方法,它使用 ChatGPT 测试三消游戏,这是一类玩家在行或列中匹配三个或更多相同图块以获得分数的游戏。Lap 包含三个关键阶段:游戏环境处理、基于提示的动作生成和动作执行。给定一个三消游戏,Lap 拍摄游戏棋盘的快照并将其转换为数字矩阵。然后,它提示 ChatGPT-O1-mini API 根据该矩阵建议移动,并尝试性地应用建议的移动以赚取积分并触发游戏棋盘的变化。它迭代地重复上述三个步骤直到超时。为了进行评估,我们在开源三消游戏 CasseBonbons 上使用 Lap 进行了案例研究,并将其与三种现有工具进行了实证比较。我们的结果令人鼓舞:Lap 通过实现更高的代码覆盖率和触发更多程序崩溃而优于现有工具。本研究为自动化测试和 LLM 应用的未来提供了启示。
英文摘要:
Playtesting is the process in which people play a video game for testing. It is critical for the quality assurance of gaming software. Manual playtesting is time-consuming and expensive. However, automating this process is challenging, as playtesting typically requires domain knowledge and problem-solving skills that most conventional testing tools lack. Recent advancements in artificial intelligence (AI) have opened up new possibilities for applying Large Language Models (LLMs) to playtesting. However, significant challenges remain: current LLMs cannot visually perceive game environments, and most existing research focuses on text-based games or games with robust APIs. Many non-text games lack APIs to provide textual descriptions of game states, making it almost impossible to naively apply LLMs for playtesting. This paper introduces Lap, our novel approach to LLM-based Automatic Playtesting, which uses ChatGPT to test match-3 games, a category of games where players match three or more identical tiles in a row or column to earn points. Lap encompasses three key phases: processing of game environments, prompting-based action generation, and action execution. Given a match-3 game, Lap takes a snapshot of the game board and converts it to a numeric matrix. It then prompts the ChatGPT-O1-mini API to suggest moves based on that matrix and tentatively applies the suggested moves to earn points and trigger changes in the game board. It repeats the above-mentioned three steps iteratively until timeout. For evaluation, we conducted a case study using Lap on an open-source match-3 game, CasseBonbons, and empirically compared it with three existing tools. Our results are promising: Lap outperformed existing tools by achieving higher code coverage and triggering more program crashes. This research sheds light on the future of automatic testing and LLM applications.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。