Searcharxiv⌕ Search

arXiv subjects

Pavel Gurov

Publications and source records attributed to Pavel Gurov.

2 recordsLinked to original sources

Code Lifespan Survival Analysis (CLSA): Predicting the Survival of Source Code Lines Using AST-Aware Mining

Superseded by arXiv:2611.10530. Context: Predicting which source lines will be deleted - and when - matters for maintenance and review prioritization. Existing MSR approaches work at file or method granularity, masking individual-statement risk. Objective: We introduce Code Lifespan Survival Analysis (CLSA), the first framework to model individual-line deletion risk from covariates - where prior line-granularity work estimated lifespans but found no significant predictors. CLSA treats each line as a right-censored subject and estimates deletion risk from structural, contextual, and temporal covariates; its strongest predictors are computable statically from one file (AST structure plus line token count), without version history or bug data. Method: We mine 32.5 million line birth events from 120 open-source TypeScript repositories. A 5-stage matching pipeline separates true deletions from refactoring noise, preventing 8.3 million false deaths. We fit a Cox Proportional Hazards model with 15 covariates and check robustness via Weibull/Log-Logistic AFT, gamma frailty, and time-stratified landmark models. Results: The Kaplan-Meier median survival time is 1,335-1,352 days (about 3.7 years), verified on the full 32.5-million-line population and an independent resample; among deleted lines the median lifespan is 95.7 days. Line token count is a steady protective factor (HR=0.87) that stays essentially flat with age (HR 0.89-0.91 across regimes). Lines in conditional branches show no detectable effect at birth (HR=0.98, 0-90 days, not significant) but become a risk factor after 90 days (HR=1.23). Repository identity is the largest factor: a gamma frailty model (variance theta=1.451) raises concordance from 0.587 to 0.676. Conclusion: Line-level survival modeling is tractable, yielding interpretable risk signals and a calibration recipe for time-conditional scoring in IDEs and code review.

cs.SE↗

Mismeasuring the Life of a Line of Code: Lessons Learned the Hard Way

Studies of how long lines of code live, including lines written by AI agents, rest on choices that look technical: when a line counts as gone, what to do with lines still alive, whether to pool projects, and how to evaluate a model. We studied 32.5 million line births in 120 TypeScript repositories and got several of these choices wrong at first. For ten of them, we compare the result as we first computed it, or as commonly done, with the result after correction. All ten change conclusions, or would have. Six were our own mistakes. Counting moved and rewritten lines as dead shortens a line's median life from 3.0 years to 1.3. Counting any change as a death hides an outcome that can be predicted: within-project concordance falls from 0.71 to 0.56. Regressing observed lifetimes discards three quarters of the lines. Keeping rewritten lines at risk makes protective effects grow with age. Lines are born and removed together, so treating them as independent misleads twice: nine of fifteen effects look significant only under that assumption, and a split by file makes a barely predictable outcome look good (within-project concordance 0.71 instead of 0.61). After the corrections, removal depends on a line's age and project, but our models could barely rank it within a project. Local revision they could rank (0.71). Obvious cases aside, the top 1% of a project's new lines are revised at 2.3 times the base rate. Each pitfall leaves a symptom; we give a checklist.

cs.SE↗