{"title":"智能类回归测试选择算法的安全性","authors":"Susannah Mansky , Elsa L. Gunter","doi":"10.1016/j.entcs.2020.08.004","DOIUrl":null,"url":null,"abstract":"<div><p>Regression Test Selection (RTS) algorithms select which tests to rerun on revised code, reducing the time required to check for newly introduced errors. An RTS algorithm is considered safe if and only if all deselected tests would have unchanged results. In this paper, we present a formal proof of safety of an RTS algorithm based on that used by Ekstazi [Gligoric, M., L. Eloussi and D. Marinov, <em>Practical regression test selection with dynamic file dependencies</em>, in: <em>Proceedings of the 2015 International Symposium on Software Testing and Analysis</em>, ISSTA 2015 (2015), p. 211–222. URL <span>https://doi.org/10.1145/2771783.2771784</span><svg><path></path></svg>], a Java library for regression testing. Ekstazi's algorithm adds print statements to JVM code in order to collect the names of classes used by a test during its execution on a program. When the program is changed, tests are only rerun if a class they used changed. The main insight in their algorithm is that not all uses of classes must be noted, as many necessarily require previous uses, such as when using an object previously created. The algorithm we formally define and prove safe here uses an instrumented semantics to collect touched classes in an even smaller set of locations. We identify problems with Ekstazi's current collection location set that make it not safe, then present a modified set that will make it equivalent to our safe set. The theorems given in this paper have been formalized in the theorem prover Isabelle over JinjaDCI [Mansky, S. and E. L. Gunter, <em>Dynamic class initialization semantics: A jinja extension</em>, in: <em>Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and Proofs</em>, CPP 2019 (2019), p. 209–221. URL <span>https://doi.org/10.1145/3293880.3294104</span><svg><path></path></svg>], a semantics for a subset of Java and JVM including dynamic class initialization and static field and methods. We instrumented JinjaDCI's JVM semantics by giving a general definition for Collection Semantics, small-step semantics instrumented to collect information during execution. We also give a formal general definition of RTS algorithms, including a definition of safety.</p></div>","PeriodicalId":38770,"journal":{"name":"Electronic Notes in Theoretical Computer Science","volume":"351 ","pages":"Pages 51-73"},"PeriodicalIF":0.0000,"publicationDate":"2020-09-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/j.entcs.2020.08.004","citationCount":"3","resultStr":"{\"title\":\"Safety of a Smart Classes-Used Regression Test Selection Algorithm\",\"authors\":\"Susannah Mansky , Elsa L. Gunter\",\"doi\":\"10.1016/j.entcs.2020.08.004\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>Regression Test Selection (RTS) algorithms select which tests to rerun on revised code, reducing the time required to check for newly introduced errors. An RTS algorithm is considered safe if and only if all deselected tests would have unchanged results. In this paper, we present a formal proof of safety of an RTS algorithm based on that used by Ekstazi [Gligoric, M., L. Eloussi and D. Marinov, <em>Practical regression test selection with dynamic file dependencies</em>, in: <em>Proceedings of the 2015 International Symposium on Software Testing and Analysis</em>, ISSTA 2015 (2015), p. 211–222. URL <span>https://doi.org/10.1145/2771783.2771784</span><svg><path></path></svg>], a Java library for regression testing. Ekstazi's algorithm adds print statements to JVM code in order to collect the names of classes used by a test during its execution on a program. When the program is changed, tests are only rerun if a class they used changed. The main insight in their algorithm is that not all uses of classes must be noted, as many necessarily require previous uses, such as when using an object previously created. The algorithm we formally define and prove safe here uses an instrumented semantics to collect touched classes in an even smaller set of locations. We identify problems with Ekstazi's current collection location set that make it not safe, then present a modified set that will make it equivalent to our safe set. The theorems given in this paper have been formalized in the theorem prover Isabelle over JinjaDCI [Mansky, S. and E. L. Gunter, <em>Dynamic class initialization semantics: A jinja extension</em>, in: <em>Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and Proofs</em>, CPP 2019 (2019), p. 209–221. URL <span>https://doi.org/10.1145/3293880.3294104</span><svg><path></path></svg>], a semantics for a subset of Java and JVM including dynamic class initialization and static field and methods. We instrumented JinjaDCI's JVM semantics by giving a general definition for Collection Semantics, small-step semantics instrumented to collect information during execution. We also give a formal general definition of RTS algorithms, including a definition of safety.</p></div>\",\"PeriodicalId\":38770,\"journal\":{\"name\":\"Electronic Notes in Theoretical Computer Science\",\"volume\":\"351 \",\"pages\":\"Pages 51-73\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2020-09-15\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://sci-hub-pdf.com/10.1016/j.entcs.2020.08.004\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Electronic Notes in Theoretical Computer Science\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S1571066120300402\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"Computer Science\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Electronic Notes in Theoretical Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1571066120300402","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 3
摘要
回归测试选择(RTS)算法选择在修改后的代码上重新运行哪些测试,从而减少检查新引入的错误所需的时间。当且仅当所有取消选择的测试结果不变时,RTS算法被认为是安全的。在本文中,我们提出了基于Ekstazi [Gligoric, M., L. Eloussi和D. Marinov]使用的RTS算法的安全性的正式证明,动态文件依赖性的实际回归测试选择,见:2015年软件测试与分析国际研讨会论文集,ISSTA 2015(2015),第211-222页。URL https://doi.org/10.1145/2771783.2771784],一个用于回归测试的Java库。Ekstazi的算法将print语句添加到JVM代码中,以便收集测试在程序上执行期间使用的类的名称。当程序发生更改时,只有当测试使用的类发生更改时,测试才会重新运行。他们的算法的主要观点是,并不是所有类的使用都必须被记录,因为许多类必须需要以前的使用,比如使用以前创建的对象。我们在这里正式定义并证明安全的算法使用工具化语义在更小的位置集合中收集触摸类。我们找出Ekstazi当前的收集位置集存在的问题,使其不安全,然后提出一个修改后的集合,使其等同于我们的安全集。本文所给出的定理在定理证明者Isabelle over JinjaDCI中得到了形式化[Mansky, S. and E. L. Gunter,动态类初始化语义:一个jinja扩展,第8届ACM SIGPLAN国际认证程序与证明会议论文集,CPP 2019 (2019), p. 209-221]。URL https://doi.org/10.1145/3293880.3294104], Java和JVM子集的语义,包括动态类初始化和静态字段和方法。我们通过给出集合语义(Collection semantics)的通用定义来检测JinjaDCI的JVM语义,小步骤语义用于在执行期间收集信息。我们还给出了RTS算法的正式一般定义,包括安全性的定义。
Safety of a Smart Classes-Used Regression Test Selection Algorithm
Regression Test Selection (RTS) algorithms select which tests to rerun on revised code, reducing the time required to check for newly introduced errors. An RTS algorithm is considered safe if and only if all deselected tests would have unchanged results. In this paper, we present a formal proof of safety of an RTS algorithm based on that used by Ekstazi [Gligoric, M., L. Eloussi and D. Marinov, Practical regression test selection with dynamic file dependencies, in: Proceedings of the 2015 International Symposium on Software Testing and Analysis, ISSTA 2015 (2015), p. 211–222. URL https://doi.org/10.1145/2771783.2771784], a Java library for regression testing. Ekstazi's algorithm adds print statements to JVM code in order to collect the names of classes used by a test during its execution on a program. When the program is changed, tests are only rerun if a class they used changed. The main insight in their algorithm is that not all uses of classes must be noted, as many necessarily require previous uses, such as when using an object previously created. The algorithm we formally define and prove safe here uses an instrumented semantics to collect touched classes in an even smaller set of locations. We identify problems with Ekstazi's current collection location set that make it not safe, then present a modified set that will make it equivalent to our safe set. The theorems given in this paper have been formalized in the theorem prover Isabelle over JinjaDCI [Mansky, S. and E. L. Gunter, Dynamic class initialization semantics: A jinja extension, in: Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2019 (2019), p. 209–221. URL https://doi.org/10.1145/3293880.3294104], a semantics for a subset of Java and JVM including dynamic class initialization and static field and methods. We instrumented JinjaDCI's JVM semantics by giving a general definition for Collection Semantics, small-step semantics instrumented to collect information during execution. We also give a formal general definition of RTS algorithms, including a definition of safety.
期刊介绍:
ENTCS is a venue for the rapid electronic publication of the proceedings of conferences, of lecture notes, monographs and other similar material for which quick publication and the availability on the electronic media is appropriate. Organizers of conferences whose proceedings appear in ENTCS, and authors of other material appearing as a volume in the series are allowed to make hard copies of the relevant volume for limited distribution. For example, conference proceedings may be distributed to participants at the meeting, and lecture notes can be distributed to those taking a course based on the material in the volume.