{"id":13250,"date":"2025-01-30T22:39:59","date_gmt":"2025-01-31T05:39:59","guid":{"rendered":"https:\/\/mattfife.com\/?p=13250"},"modified":"2025-01-17T22:53:38","modified_gmt":"2025-01-18T05:53:38","slug":"google-report-on-using-ai-for-internal-code-migrations","status":"publish","type":"post","link":"https:\/\/mattfife.com\/?p=13250","title":{"rendered":"Google report on using AI for internal code migrations"},"content":{"rendered":"\n<p>Google published a report on it&#8217;s effort to migrate code to the latest dependencies &#8211; an often thankless task fraught with risk. Google&#8217;s code migrations involved: changing 32-bit IDs in the 500-plus-million-line codebase for Google Ads to 64-bit IDs; converting its old JUnit3 testing library to\u00a0JUnit4; and replacing the Joda time library with Java&#8217;s standard java.time package. The 32-bit ID&#8217;s were particularly rough because they were often generically defined types that were not easily searchable.<\/p>\n\n\n\n<p>They used a collection of AI tools as well as manual code reviews and touch-ups to achieve their goal. They emphasize that LLMs should be viewed as complementary to traditional migration techniques that rely on Abstract Syntax Trees (ASTs), grep-like searches, <a href=\"https:\/\/kythe.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kythe<\/a>, and custom scripts because LLMs can be very expensive.<\/p>\n\n\n\n<p>The results?<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>With LLM assistance, it took just three months to migrate 5,359 files and modify 149,000 lines of code to complete the JUnit3-JUnit4 transition. Approximately 87 percent of the code generated by AI ended up being committed with no changes. For the Joda-Java time framework switch, the authors estimate a time saving of 89 percent compared to the projected manual change time.<\/p>\n<\/blockquote>\n\n\n\n<p>Links:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Paper: <a href=\"https:\/\/arxiv.org\/abs\/2501.06972\">https:\/\/arxiv.org\/abs\/2501.06972<\/a><\/li>\n\n\n\n<li>Article: <a href=\"https:\/\/www.theregister.com\/AMP\/2025\/01\/16\/google_ai_code_migration\/\">https:\/\/www.theregister.com\/AMP\/2025\/01\/16\/google_ai_code_migration\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Google published a report on it&#8217;s effort to migrate code to the latest dependencies &#8211; an often thankless task fraught with risk. Google&#8217;s code migrations involved: changing 32-bit IDs in the 500-plus-million-line codebase for Google Ads to 64-bit IDs; converting its old JUnit3 testing library to\u00a0JUnit4; and replacing the Joda time library with Java&#8217;s standard java.time package. The 32-bit ID&#8217;s were particularly rough because they were often generically defined types that were not easily searchable. They used a collection of&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/mattfife.com\/?p=13250\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[28,9,7,5],"tags":[],"class_list":["post-13250","post","type-post","status-publish","format-standard","hentry","category-ai","category-cool","category-technicalprogramming","category-technical"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4WECr-3rI","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/13250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13250"}],"version-history":[{"count":2,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/13250\/revisions"}],"predecessor-version":[{"id":13317,"href":"https:\/\/mattfife.com\/index.php?rest_route=\/wp\/v2\/posts\/13250\/revisions\/13317"}],"wp:attachment":[{"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattfife.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}