Skip to main content
QUICK REVIEW

[논문 리뷰] Automated Unit Test Improvement using Large Language Models at Meta

Nadia Alshahwan, Jubin Chheda|arXiv (Cornell University)|2024. 02. 14.
Software Testing and Debugging Techniques인용 수 5
한 줄 요약

메타의 TestGen-LLM은 LLM을 사용하여 기존의 사람이 작성한 Kotlin 테스트 클래스를 개선하고 개선 및 비회귀에 대한 검증 가능한 보장을 제공하며 Instagram과 Facebook 테스트-thon에 배포됩니다.

ABSTRACT

This paper describes Meta's TestGen-LLM tool, which uses LLMs to automatically improve existing human-written tests. TestGen-LLM verifies that its generated test classes successfully clear a set of filters that assure measurable improvement over the original test suite, thereby eliminating problems due to LLM hallucination. We describe the deployment of TestGen-LLM at Meta test-a-thons for the Instagram and Facebook platforms. In an evaluation on Reels and Stories products for Instagram, 75% of TestGen-LLM's test cases built correctly, 57% passed reliably, and 25% increased coverage. During Meta's Instagram and Facebook test-a-thons, it improved 11.5% of all classes to which it was applied, with 73% of its recommendations being accepted for production deployment by Meta software engineers. We believe this is the first report on industrial scale deployment of LLM-generated code backed by such assurances of code improvement.

연구 동기 및 목표

  • 미MISS 오브 코너 케이스를 포착하고 테스트 커버리지를 높이는 동시에 기존 동작을 유지하도록 단위 테스트 개선 자동화를 동기화합니다.
  • 검증 가능한 개선을 위한 가이드 프레임워크로 Assured Offline LLM-Based Software Engineering (Assured LLMSE)를 도입합니다.
  • TestGen-LLM 시스템 아키텍처, 필터링 파이프라인 및 LLM과 프롬프트를 평가하기 위한 텔레메트리 구성을 설명합니다.
  • 메타에서의 TestGen-LLM의 산업 규모 배포 사례를 보고하고, 평가 결과와 교훈을 공유합니다.

제안 방법

  • 두 개의 메타 개발 LLM의 앙상블을 사용하여 기존 Kotlin 테스트 클래스에 추가 테스트를 확장합니다.
  • 다중 필터 파이프라인을 적용합니다: (i) 생성된 테스트가 컴파일되는지 확인하는 빌드 가능성 필터, (ii) 테스트가 일관되게 통과하도록 요구하여 비회귀 필터, (iii) 추가된 테스트가 커버리지를 향상시키는지 확인하는 커버리지 필터.
  • CI 통합을 지원하기 위한 보증 및 측정 가능한 차이(diff)를 테스트별로 제공합니다.
  • 전체 배포 전에 LLM 프롬프트, 온도, 프롬프트 전략을 연구하기 위한 텔레메트리 및 평가 모드를 도입합니다.
  • 관련성과 엔지니어 채택을 극대화하기 위한 대상-완전 배포 경로(diff-시간 배포)를 채택합니다.
  • 고유 테스트 추가를 최대화하기 위해 프롬팅 전략(extend_coverage, corner_cases, extend_test, statement_to_complete)과 LLM 앙상블 접근 방식을 employed합니다.
Figure 1. TestGen-LLM top level architecture (an instance of Assured Offline LLMSE (Alshahwan et al . , 2024 ) ).
Figure 1. TestGen-LLM top level architecture (an instance of Assured Offline LLMSE (Alshahwan et al . , 2024 ) ).

실험 결과

연구 질문

  • RQ1LLM이 기존 테스트 스위트를 구성하고, 신뢰성 있게 통과하며, 코드 커버리지를 증가시키는 새로운 단위 테스트를 생성할 수 있는가?
  • RQ2AI가 생성한 테스트 개선이 대규모 산업 현장에서 엔지니어가 다수의 권고를 받아들여 생산에 반영되는가?
  • RQ3신뢰할 수 있는 테스트 생성 개선을 위한 효과적인 프롬프트 전략 및 구성(LLM 선택, 온도, 프롬프트)은 무엇인가?
  • RQ4테스트 케이스별 보증이 대규모 코드베이스의 자동화된 테스트 개선에 대한 신뢰와 채택에 어떤 영향을 미치는가?
  • RQ5Assured LLMSE를 생산 테스트 워크플로우에 적용하기 위한 실제 배포 고려사항과 교훈은 무엇인가?

주요 결과

  • Instagram 평가에서 TestGen-LLM 테스트 케이스의 75%가 올바르게 구축되었습니다.
  • 테스트 클래스의 57%가 최소 하나의 테스트 케이스를 올바르게 구축하고 안정적으로 통과했습니다.
  • 테스트 클래스의 25%가 최소 하나의 테스트 케이스를 올바르게 구축하고, 안정적으로 통과하며 코드 커버리지를 증가시켰습니다.
  • Instagram 테스트-athon 기간 동안 TestGen-LLM은 적용된 모든 클래스의 11.5%를 개선했습니다.
  • TestGen-LLM의 테스트 개선 중 73%가 메타 엔지니어들에 의해 생산 배포에 수용되었습니다.
  • 세 차례의 테스트-athon에서 TestGen-LLM은 1,979개 중 196개 테스트 클래스를 개선했으며(약 10%).
  • Facebook과 Instagram 배포를 통해 차이점 280개 중 144개가 수용되고 64개는 거부되었으며 61개는 검토되지 않았고 11개는 철회되었습니다.
  • 이 접근법은 회귀에 대한 검증 가능한 보장을 제공하는 확장 가능하고 자동화된 테스트 개선을 성공적으로 도입했습니다.
Figure 2. Sankey diagram showing the filtration process outcomes (as percentages of all test cases) from the Experimental Study on Instagram components for Reels and Stories products, using the four prompt strategies from Table 2 and the two language models, LLM1 and LLM2.
Figure 2. Sankey diagram showing the filtration process outcomes (as percentages of all test cases) from the Experimental Study on Instagram components for Reels and Stories products, using the four prompt strategies from Table 2 and the two language models, LLM1 and LLM2.

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

연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.

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

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