Skip to main content
QUICK REVIEW

[논문 리뷰] Learning Quick Fixes from Code Repositories

Reudismam Rolim de Sousa, Gustavo Soares|arXiv (Cornell University)|2018. 03. 10.
Software Engineering Research참고 문헌 22인용 수 17
한 줄 요약

이 논문은 소프트웨어 저장소의 수정 이력에서 자동으로 공통적인 자바 코드 편집 패턴(즉각 수정으로 사용됨)을 발견하는 도구인 Revisar를 제안한다. GitHub의 아홉 개의 인기 프로젝트에서 구체적인 수정 사례를 분석함으로써 Revisar는 89개의 재사용 가능한 패턴을 식별하였으며, 이 중 64%는 기존 코드 분석기에서 누락되어 있었다. 164명의 프로그래머를 대상으로 한 설문 조사에서 89%가 발견된 수정 방식을 선호했고, 제출된 16개의 풀 리퀘스트 중 60%가 수락되어 실제 적용 가능성에 대한 검증이 이루어졌다.

ABSTRACT

Code analyzers such as Error Prone and FindBugs detect code patterns symptomatic of bugs, performance issues, or bad style. These tools express patterns as quick fixes that detect and rewrite unwanted code. However, it is difficult to come up with new quick fixes and decide which ones are useful and frequently appear in real code. We propose to rely on the collective wisdom of programmers and learn quick fixes from revision histories in software repositories. We present REVISAR, a tool for discovering common Java edit patterns in code repositories. Given code repositories and their revision histories, REVISAR (i) identifies code edits from revisions and (ii) clusters edits into sets that can be described using an edit pattern. The designers of code analyzers can then inspect the patterns and add the corresponding quick fixes to their tools. We ran REVISAR on nine popular GitHub projects, and it discovered 89 useful edit patterns that appeared in 3 or more projects. Moreover, 64% of the discovered patterns did not appear in existing tools. We then conducted a survey with 164 programmers from 124 projects and found that programmers significantly preferred eight out of the nine of the discovered patterns. Finally, we submitted 16 pull requests applying our patterns to 9 projects and, at the time of the writing, programmers accepted 6 (60%) of them. The results of this work aid toolsmiths in discovering quick fixes and making informed decisions about which quick fixes to prioritize based on patterns programmers actually apply in practice.

연구 동기 및 목표

  • 정적 분석 도구에 통합하기 위해 유용하고 자주 적용되는 코드 편집 패턴을 식별하는 데 도전하는 것.
  • 도구 제작자들이 경험 기반의 히ュ리스틱이 아닌 실제 개발자 관행에 기반해 즉각 수정을 우선순위 정할 수 있도록 하는 것.
  • 다양한 오픈소스 프로젝트에서의 실제 코드 변경 사례를 분석함으로써 새로운, 경험적으로 검증된 즉각 수정을 발견하는 것.
  • 설문 조사와 실제 풀 리퀘스트 제출을 통해 채굴된 패턴의 실용성과 개발자 선호도를 평가하는 것.

제안 방법

  • Revisar는 버전 관리 이력에서 연속적인 코드 수정 사례를 비교하여 구체적인 코드 수정을 추출한다.
  • 구체적인 수정을 일반화하여 재사용 가능한 편집 패턴으로 만들기 위해 문법적 추상화 기법을 적용한다.
  • 신뢰성 있고 완전한 매칭 알고리즘을 사용하여 유사한 수정 사례를 클러스터링하여 추상 패턴으로 통합한다.
  • 발견된 패턴을 실행 가능한 즉각 수정으로 표현하기 위해 Refaster 유사 문법을 활용한다.
  • 대규모 설문 조사(164명의 개발자)와 실제 프로덕션 저장소에의 풀 리퀘스트 제출을 통해 패턴을 검증한다.

실험 결과

연구 질문

  • RQ1다양한 오픈소스 프로젝트에서 개발자들이 자주 적용하는 코드 편집 패턴은 무엇인가?
  • RQ2실제 수정 이력에서 발견된 즉각 수정의 유용성에 대해 개발자는 어떻게 평가하는가?
  • RQ3채굴된 편집 패턴이 실제 프로덕션 코드베이스에 얼마나 잘 기여될 수 있는가?
  • RQ4발견된 패턴은 기존에 인기 있는 코드 분석 도구에 존재하는 패턴과 어떻게 비교되는가?

주요 결과

  • Revisar는 아홉 개의 인기 GitHub 프로젝트 중 세 개 이상에서 나타난 89개의 고유한 편집 패턴을 발견했다.
  • 발견된 패턴 중 64%는 FindBugs, PMD, Error Prone와 같은 기존 코드 분석 도구에 존재하지 않았다.
  • 164명의 프로그래머를 대상으로 한 설문 조사에서 89%가 테스트한 아홉 가지 즉각 수정의 대부분을 지지했다.
  • 실제 프로젝트에 발견된 수정을 제출한 16개의 풀 리퀘스트 중 60%가 유지보수자에 의해 수락되었다.
  • 이 기법은 Google의 Error Prone에 누락되어 있던 잘 알려진 널 안전성 패턴(예: "str.equals(obj)"를 "obj.equals(str)" 대신 사용하는 것)을 성공적으로 식별했다.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.