Automatic Approach to Repairing Build Scripts

Automatic Approach to Repairing Build Scripts
Slide Note
Embed
Share

An automatic approach to history-driven repair of build scripts is essential due to the high percentage of code commits that fail to pass successful builds on integration servers. This innovative method helps in identifying and fixing faults in build scripts efficiently, minimizing project delays and manual intervention. Leveraging tools and techniques like build log parsing, fault localization, and patch candidate generation, this approach streamlines the process of identifying and resolving build errors.

  • Automation
  • Build Scripts
  • Fault Localization
  • Repair
  • History-Driven

Uploaded on Apr 13, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. HireBuild HireBuild: An Automatic Approach to History : An Automatic Approach to History Driven Repair of Build Scripts Driven Repair of Build Scripts Foyzul Hassan Foyzul Hassan Xiaoyin Xiaoyin Wang Wang University of Texas at San Antonio University of Texas at San Antonio 1

  2. Why Automatic Repair of Build Script? Why Automatic Repair of Build Script? According to TravisTorrent data- set, 29% of code commits fail to go through successful build on the integration server. Study of Java Build system [McIntosh et al. 2012] shows 27% of source code work items require an change to the build system. accompanying Build Failure Hampers Project Progress and It Takes Time To Fix Those Issues Study on a project of a large software company [Kerzazi et al. 2014] found that a minimum of 900 man-hours were spent on fixing build breakage over a six month period. At Google, 37.4% and 29.7% of C++ and Java builds fail.[Seo et al. 2014] 2

  3. HireBuild History-Driven Repair of Build Scripts 3

  4. HireBuild HireBuild In Action In Action Automatic Build-Fix Pattern Generation Patch Candidate Generation Patch Evaluation Build Patch Candidate Patch List Training Build Logs Fault Build Execution Build-Fix Patterns Build Log Evaluation Localization Repaired Build Script Faulty Build Script(s) Pass Fail Similar Build Failure Logs Patch Evaluation Build-Fix Pattern Generation Patch Candidate Generation 4

  5. Automatic Build Automatic Build- -Fix Pattern Generation Fix Pattern Generation Build Log Parsing Parse error-and-exception part, which typically accounts for only a small portion of the build log. Similar Build Error Log Finding Text Normalization Stop word Removal Stemming TF IDF Similarity Calculation Generation of Build-Fix Patterns Build-Script Differencing Extended GumTree for Gradle Build Script Differencing Hierarchical Build-Fix Patterns Merge and Rank Build-Fix Patterns 5

  6. How How Build Build- -Fix Pattern Generation Works Fix Pattern Generation Works (BuildCraft/BuildCraft: 98f7196) - version = 1.7.2-10.12.1.1079 + version = 1.7.2-10.12.2.1121 (ForgeEssentials/ForgeEssentialsMain:fcbb468) -version = 1.4.0-beta7 +version = 1.4.0-beta8 6

  7. Patch Candidate Generation Patch Candidate Generation Fault Localization Performed File level fault localization based on analysis of build log. Patch List AST Analysis of Build Script Context Check for extracted fix patterns Check Parent Name Check Task Name Patch Candidate Edit Build Script with each Patch 7

  8. An Example of Using Training Project Fix An Example of Using Training Project Fix Evaluation Project Training Project Project: puniverse/quasar, ID: e7dafdc Project: SpongePowered/SpongeForge, ID: df361ba classpath += configurations.provided options { + if(JavaVersion.current().isJava8Compatible()){ + tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet ) + } + } 8 Repaired Script

  9. An Example of Fixing With Template An Example of Fixing With Template Build Log Project: aol/micro-server, ID: 9599be6 * What went wrong: Could not resolve all dependencies for configuration ':micro-boot:compile'. > Could not find com.aol.microservices:microserver-core:0.57 ... Fix Template Generated Fix dependencies { } compile 'org.springframework.boot:spring-boot:1.2.1.RELEASE' compile 'org.springframework.boot:spring-boot-autoconfigure:1.2.1.RELEASE' //compile project(':micro-core') compile group: 'com.aol.microservices', name:'microserver-core', version:'0.56' 9

  10. Patch Evaluation Patch Evaluation Build Execution After applying patch candidate, built the project. Build Evaluation Evaluated build outcome with following criteria: Build process returns 0 and the build log shows build success. All source files that are compiled in the latest successfully built version are compiled if they are not deleted in between. 10

  11. Data Selection Process and Summary Data Selection Process and Summary Data Selection Process TravisTorrent If C5 commit contains only build script change. Data Summary Type Count # Total Number of Projects # Maximum Number of Fix From Single Project # Minimum Number of Fix From Single Project # Average Number of Fix Per Project # Total Number of Fix # Training Fix Size # Testing Fix Size # Reproducible Build Failure Size for Testing Count 54 25 1 3.2 175 135 40 24 11

  12. RQ1: # of Successfully fixed build failures RQ1: # of Successfully fixed build failures 11 of 24 Reproducible Build Failures Can Be Fixed Successfully 45.83% 1 Incompatible Statement Removal 2 Dependency Change 3 Gradle Option Change 2 Manually Checked All The Automatically Generated Fixes Are Semantically Equivalent to Manual Fixes External Tool Option Change 3 Property Change 0 1 2 3 4 Fixed Build Failure Count 12

  13. RQ2: Time Spent on Fixes & RQ3: Actual Fix Size RQ2: Time Spent on Fixes & RQ3: Actual Fix Size 6000 2500 5000 2000 4000 1500 3000 1000 2000 1000 500 0 0 Build Fix Time(Minute) By HireBuild Actual Fix Time (Minute) Fixed Patch List Size Not Fixed Patch List Size Fixed Build Failures: Minimum-68, Maximum-2,245, Median-486 Not Fixed Build Failures: Minimum-8, Maximum- 1,266 , Median- 223 HireBuild Fix Time: Minimum-2, Maximum-305, Median-44 Actual Fix Time: Minimum-<1, Maximum- 5,281 , Median-42 12 10 8 6 Fixed Build Failures Line Size: Minimum-1, Maximum-2, Median-1 Not Fixed Build Failures Line Size: Minimum-1, Maximum- 11, Median-1 4 2 0 Fixed Build Fix Line Size Not Fixed Build Fix Line Size 13

  14. RQ4: What about rest 13 build failures? RQ4: What about rest 13 build failures? Project specific change (Netflix/Hystrix:6600947) + if ( dep.moduleName == servlet-api ) { + it.artifactId[0].text() == dep.moduleName && + asNode().dependencies[0].dependency.find{ + ... + }} + } Fix Type Project specific change adaption No matching patterns Dependency resolution failures Multi-location fixes #of Failures 2(15%) 6(46%) 3(23%) 2(15%) Dependency resolve Issue (BuildCraft/BuildCraft:12f4f06) - mappings = snapshot_20160214 + mappings = stable_22 14

  15. Limitations Limitations Evaluated on Small data-set. Our work only works on build script related fixing. But build fix might also requires source code change. HireBuild applies one patch at a time. But actual fix can combination of multiple patches. 15

  16. Future Work Future Work Enhance Build Fix data set with both build script and source file change. Apply search based technique such as genetic programming for better ranking of generated patches and apply combination of patches. A complete tool suite to fix both build script and source file related build fix. 16

  17. Conclusion Conclusion We propose the first approach for automatic build fix candidate patch generation for Gradle build script. Our technique is featured with following challenges: Build log analysis. Build-fix-pattern templates. Build validation. 17

  18. 18

  19. References References 1. S. McIntosh, B. Adams, and A. E. Hassan, The evolution of java build systems, Empirical Software Engineering, vol. 17, no. 4-5, pp. 578 608, 2012. 2. N. Kerzazi, F. Khomh, and B. Adams, Why do automated builds break? an empirical study. in International Conference on Software Maintenance and Evolution. IEEE, 2014, pp. 41 50. 3. Hyunmin Seo, Caitlin Sadowski, Sebastian Elbaum, Edward Aftandilian, and Robert Bowdidge. 2014. Programmers Build Errors: A Case Study (at Google). In Proceedings of the 36th International Conference on Software Engineering (ICSE 2014). ACM, New York, NY, USA, 724 734. 19

More Related Content