{"title":"代码重构后单元测试的自动恢复","authors":"Alaa Jaradat, A. Qusef","doi":"10.1109/ACIT47987.2019.8990974","DOIUrl":null,"url":null,"abstract":"Unit testing allows developers to refactor their code confidently, these tests act as a safety net against producing bugs and provide immediate feedback during the refactoring process and furthermore help developers overcome the fear of change. When performing refactoring, the design of code is changed or restructured according to a predefined plan, after refactoring is applied, the alignment between source code and its corresponding unit tests could be broken which creates a problem that needs to be solved.This paper introduces an approach in which code refactoring can maintain the integrity of the previous unit tests; the tool called GreenRef demonstrates this work. This tool supports an automatic recovery for the unit tests after performing of three particular refactoring types for Java programming language: Rename Method, Add Parameter and Remove Parameter.The achieved results indicate that GreenRef facilitates consistent use of refactoring and unit tests, and save about 43% of the time required to recover broken unit tests manually.","PeriodicalId":314091,"journal":{"name":"2019 International Arab Conference on Information Technology (ACIT)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Automatic Recovery of Unit Tests after Code Refactoring\",\"authors\":\"Alaa Jaradat, A. Qusef\",\"doi\":\"10.1109/ACIT47987.2019.8990974\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Unit testing allows developers to refactor their code confidently, these tests act as a safety net against producing bugs and provide immediate feedback during the refactoring process and furthermore help developers overcome the fear of change. When performing refactoring, the design of code is changed or restructured according to a predefined plan, after refactoring is applied, the alignment between source code and its corresponding unit tests could be broken which creates a problem that needs to be solved.This paper introduces an approach in which code refactoring can maintain the integrity of the previous unit tests; the tool called GreenRef demonstrates this work. This tool supports an automatic recovery for the unit tests after performing of three particular refactoring types for Java programming language: Rename Method, Add Parameter and Remove Parameter.The achieved results indicate that GreenRef facilitates consistent use of refactoring and unit tests, and save about 43% of the time required to recover broken unit tests manually.\",\"PeriodicalId\":314091,\"journal\":{\"name\":\"2019 International Arab Conference on Information Technology (ACIT)\",\"volume\":\"1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-12-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2019 International Arab Conference on Information Technology (ACIT)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/ACIT47987.2019.8990974\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 International Arab Conference on Information Technology (ACIT)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ACIT47987.2019.8990974","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Automatic Recovery of Unit Tests after Code Refactoring
Unit testing allows developers to refactor their code confidently, these tests act as a safety net against producing bugs and provide immediate feedback during the refactoring process and furthermore help developers overcome the fear of change. When performing refactoring, the design of code is changed or restructured according to a predefined plan, after refactoring is applied, the alignment between source code and its corresponding unit tests could be broken which creates a problem that needs to be solved.This paper introduces an approach in which code refactoring can maintain the integrity of the previous unit tests; the tool called GreenRef demonstrates this work. This tool supports an automatic recovery for the unit tests after performing of three particular refactoring types for Java programming language: Rename Method, Add Parameter and Remove Parameter.The achieved results indicate that GreenRef facilitates consistent use of refactoring and unit tests, and save about 43% of the time required to recover broken unit tests manually.