:: The Journal of the Institute of Internet, Broadcasting and Communication ::, Vol.22 No.4 | (2022) pp.73~79

Python 기반 AI 프로젝트에서 예외 제안을 위한 자동화 접근 방식

Mingu Kang

(준회원, 전북대학교 소프트웨어공학과)

Suntae Kim

(정회원, 전북대학교 소프트웨어공학과)

Duksan Ryu

(정회원, 전북대학교 소프트웨어공학과)

Abstract

Artificial intelligence (AI) 프로젝트에 널리 사용되는 Python 언어는 Interpreter 언어로 Runtime 시에 오류 가 발생한다. 오류로 인한 프로젝트의 실패를 방지하기 위해서는 사전에 예외적인 상황이 발생할 수 있는 코드에 대한 예외 처리가 필요하다. 특히, 많은 리소스를 필요로 하는 AI 프로젝트에서, 오랜 실행 후 발생하는 예외는 큰 리소스 낭비를 초래한다. 하지만, 예외 처리는 개발자의 경험에 의존하기 때문에 개발자들은 잡아야 할 적절한 예외를 결정하는 데 어려움을 가진다. 이러한 필요성을 해결하기 위해 기존 예외 처리문을 학습하여 개발 중에 개발자에게 잡아야 할 예외를 제안해주는 접근 방법을 제안한다. 제안 방법은 try 블록의 소스 코드를 입력으로 받아 except 블록에서 처리되 어야 할 예외들을 제안해준다. 우리는 2개의 프레임워크로 구성된 대규모 프로젝트에 대해 접근 방법을 평가한다. 우리 의 평가 결과에 따르면, 예외 제안을 수행할 때 평균 AUPRC는 0.92 이상을 나타낸다. 연구 결과는 제안된 방법이 비교 모델들을 능가하는 예외 제안 성능으로 개발자의 예외 처리를 지원할 수 있음을 보여준다.
The Python language widely used in artificial intelligence (AI) projects is an interpreter language, and errors occur at runtime. In order to prevent project failure due to errors, it is necessary to handle exceptions in code that can cause exceptional situations in advance. In particular, in AI projects that require a lot of resources, exceptions that occur after long execution lead to a large waste of resources. However, since exception handling depends on the developer's experience, developers have difficulty determining the appropriate exception to catch. To solve this need, we propose an approach that recommends exceptions to catch to developers during development by learning the existing exception handling statements. The proposed method receives the source code of the try block as input and recommends exceptions to be handled in the except block. We evaluate our approach for a large project consisting of two frameworks. According to our evaluation results, the average AUPRC is 0.92 or higher when performing exception recommendation. The study results show that the proposed method can support the developer's exception handling with exception recommendation performance that outperforms the comparative models.
  AI Project,Exception Suggesting,Handling Exception

Download PDF List