Automated unit test generation is an established research field that has so far focused on statically-typed programming languages. The lack of type information in dynamically-typed programming languages, such as Python, inhibits test generators, which heavily rely on information about parameter and return types of functions to select suitable arguments when constructing test cases. Since automated test generators inherently rely on frequent execution of candidate tests, we make use of these frequent executions to address this problem by introducing type tracing, which extracts type-related information during execution and gradually refines the available type information. We implement type tracing as an extension of the Pynguin test-generation framework for Python, allowing it (i) to infer parameter types by observing how parameters are used during runtime, (ii) to record the types of values that function calls return, and (iii) to use this type information to increase code coverage. The approach leads to up to 87.8 % more branch coverage, improved mutation scores, and to type information of similar quality to that produced by other state-of-the-art type-inference tools.
Using Relative Lines of Code to Guide Automated Test Generation for Python
原始代码行(Raw Lines of Code,简写为Raw)是一个度量标准,乍一看,它似乎对自动化测试生成并不十分有用。它高度依赖于语言,在语义上,在一种语言中并不是非常有意义:一个编码器可以用比另一个编码器少得多的行来产生同样的效果。然而,同一项目的组件之间的相对一致性,被证明是自动化测试的一个非常有用的度量。在本文中,我们利用一个启发式的基础上的测试功能的计数,以显着提高自动测试生成的有效性。这种方法在收集代码覆盖率数据来指导测试的语言中特别有价值。我们使用TSTL(模板脚本测试语言)工具将启发式应用于基于属性的Python测试。在我们的实验中,简单的启发式算法可以大幅提高分支和语句覆盖率(通常超过20%,最高可达40%或更多),并提高故障检测率(通常超过75%,最高可达400%或更多)。该启发式也很容易与其他方法相结合,并且可以与两种用于指导随机测试的成熟方法相媲美,并且可能更有效。
PCART: Automated Repair of Python API Parameter Compatibility Issues
Key Laboratory for Safety-critical Software Development and Verification, Nanjing University of Aeronautics and Astronautics(南京航空航天大学安全关键软件开发与验证重点实验室);State Key Lab. for Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室);Department of Computer Science and Engineering, Southern University of Science and Technology(南方科技大学计算机科学与工程系);School of Automation Science and Electrical Engineering, Beihang University(北京航空航天大学自动化科学与电气工程学院)
PCART 是首个自动修复 Python API 参数兼容性问题的工具,通过自动化提取、仪器化、映射、评估、修复和验证,有效检测并修复多种参数变化问题。
PCREQ: Automated Inference of Compatible Requirements for Python Third-party Library Upgrades
Nanjing University of Aeronautics and Astronautics(南京航空航天大学);Nanjing University(南京大学);Southern University of Science and Technology(南方科技大学);Beihang University(北京航空航天大学)
Bugs in the Shadows: Static Detection of Faulty Python Refactorings
Federal University of Campina Grande(坎皮纳格兰德联邦大学);Federal University of Alagoas(阿拉戈阿斯联邦大学);Pontifical Catholic University of Rio de Janeiro(里约热内卢天主教 Pontifical 大学)
GPT-4.1 Sets the Standard in Automated Experiment Design Using Novel Python Libraries
Copelabs, Lusófona University(Copelabs与卢斯奥法纳大学);Center of Technology and Systems (UNINOVA-CTS) and Associated Lab of Intelligent Systems (LASI)(技术与系统中心(UNINOVA-CTS)及智能系统关联实验室);CICANT, Lusófona University(CICANT与卢斯奥法纳大学)