Work

Automating the Analysis and Generation of Code Changes with Foundation Models

Year: 2025
Type: dissertation
Abstract: Code changes drive software evolution, yet their growing volume and complexity-with maintenance consuming 70% of development costs-demand sophisticated automated analysis.While existing approaches range from token-based sequences to AST-based structures and pre-trained language models, they fail to capture the multi-faceted nature of code changes: their intent, semantic context, and structural transformations.This dissertation presents a comprehensive framework leveraging Foundation Models to represent, analyze, and generate code changes across the software development lifecycle.We begin with Patcherizer, a novel representation learning framework that unifies sequential and structural aspects of code changes.Unlike prior approaches that treat changes as either token diffs or tree transformations, Patcherizer introduces dual encoders: a SeqIntention module capturing semantic differences in token sequences, and a GraphIntention module representing structural modifications in ASTs.Through pre-training on 90K parsable Java patches, Patcherizer achieves state-of-the-art performance on commit message generation, defect prediction, and our novel task of code change intention detection-moving beyond syntactic operations to uncover semantic intent.Building on this foundation, we develop specialized systems addressing critical software engineering challenges:LLMDA tackles the security-critical problem of silent security patches-vulnerability fixes released without documentation, enabling n-day attacks.By augmenting patches with LLM-generated explanations, LLMDA bridges the gap between code semantics and missing commit context.Its PT-Former architecture aligns multi-modal inputs (code changes, descriptions, LLM explanations, and task instructions) while Stochastic Batch Contrastive Learning refines classification boundaries.LLMDA achieves 42% improvement over GraphSPD on PatchDB and SPI-DB benchmarks, effectively identifying undocumented vulnerabilities that traditional approaches miss.CodeAgent revolutionizes code review through multi-agent collaboration, recognizing that review is inherently interactive rather than single-pass.Our framework simulates team dynamics with specialized agents for vulnerability detection, format consistency, and code revision.Critically, we introduce QA-Checker to combat prompt drifting-a fundamental challenge in multi-agent systems where conversations stray from objectives.CodeAgent achieves 41% improvement in vulnerability detection over GPT-4, 14% better recall in format inconsistency detection over ReAct, and 30% improvement in Edit Progress metrics for code revision.SynFix addresses repository-level program repair through CallGraph-driven analysis, overcoming the limitations of agent-based approaches that suffer from cascading errors and exploration inefficiencies.By modeling structural dependencies across files, classes, and functions, SynFix ensures fixes propagate correctly through interconnected components.Its four-phase pipeline-CallGraph construction, hierarchical localization, cross-component synchronization, and paired patch validation-achieves state-of-the-art results on SWEbench benchmarks while maintaining deterministic, cost-effective operation.constant support, encouragement, and presence -whether physical or virtual -provided the emotional foundation I needed to persist.To my friends near and far, thank you for your prayers, your check-ins, and for understanding when I disappeared into the depths of research for months at a time.Finally, to myself -thank you for not giving up.This PhD is not an ending but a beginning.With gratitude for all who have brought me to this moment, hope for what lies ahead, and determination to use this knowledge for the betterment of my family and society, I step forward into the next chapter.
Author: TANG, Xunzhu
Language: English
Open Access status: green
OpenAlex ID: W7110661679
Cites: 94
Cited by:
Related to: 10