[논문 리뷰] Early Career Developers' Perceptions of Code Understandability. A Study of Complexity Metrics
이 경험적 연구는 순환 복잡도 또는 인지 복잡도 중 어느 것이 개발자들이 느끼는 코드 이해 가능성보다 더 잘 예측하는지 평가한다. 216명의 초급 개발자 중에서 인지 복잡도는 순환 복잡도보다 약간 더 강한 상관관계를 보였지만, 전반적으로 어느 지표도 강력한 예측력이 없었다.
Context. Code understandability is fundamental. Developers need to understand the code they are modifying clearly. A low understandability can increase the amount of coding effort, and misinterpreting code impacts the entire development process. Ideally, developers should write clear and understandable code with the least effort. Aim. Our work investigates whether the McCabe Cyclomatic Complexity or the Cognitive Complexity can be a good predictor for the developers' perceived code understandability to understand which of the two complexities can be used as criteria to evaluate if a piece of code is understandable. Method. We designed and conducted an empirical study among 216 early career developers with professional experience ranging from one to four years. We asked them to manually inspect and rate the understandability of 12 Java classes that exhibit different levels of Cyclomatic and Cognitive Complexity. Results. Our findings showed that while the old-fashioned McCabe Cyclomatic Complexity and the most recent Cognitive Complexity are modest predictors for code understandability when considering the complexity perceived by early-career developers, they are not for problem severity. Conclusions. Based on our results, early-career developers should not be left alone when performing code-reviewing tasks due to their scarce experience. Moreover, low complexity measures indicate good understandability, but having either CoC or CyC high makes understandability unpredictable. Nevertheless, there is no evidence that CyC or CoC are indicators of early-career perceived severity.Future research efforts will focus on expanding the population to experienced developers to confront whether seniority influences the predictive power of the chosen metrics.
연구 동기 및 목표
- 순환 복잡도 또는 인지 복잡도 중 어느 것이 개발자들이 느끼는 코드 이해 가능성보다 더 잘 예측하는지 조사하기.
- 높은 복잡도 수준이 소프트웨어 클래스의 코드 문제의 심각도를 어떻게 인지하는지 평가하기.
- 최근 도입된 지만 경험적 근거가 제한된 인지 복잡도가 코드 이해 가능성 측정 지표로서의 효과성을 검증하기.
- 정적 분석 도구와 소프트웨어 개발 관행에 있어 복잡도 지표에 대한 근거 기반 통찰을 제공하기.
- 초년 경력 소프트웨어 개발자들에서 이론적 복잡도 지표와 실제 개발자 인식 간 격차를 탐색하기.
제안 방법
- 1~4년의 전문 경력이 있는 학사 및 석사 수준의 초급 개발자 216명을 모집하였다.
- SonarQube로 측정된 순환 복잡도와 인지 복잡도 수준이 다양한 12개의 자바 클래스를 선정하였다.
- 개발자들이 표준화된 척도를 사용해 각 클래스의 이해 가능성에 대해 평가하는 수작업 점검 작업을 수행하였다.
- 각 클래스의 코드 문제의 심각도에 대한 추가 평가를 수집하여 복잡도 지표와의 상관관계를 평가하였다.
- 통계 분석을 통해 순환 복잡도와 인지 복잡도가 개발자들이 느끼는 이해 가능성에 대해 어느 정도 예측력을 지니는지 비교하였다.
- 모든 참가자와 코드 샘플 간 일관된 평가 조건을 확보하기 위해 통제된 내부 설계(within-subjects design)를 사용하였다.

실험 결과
연구 질문
- RQ1인지 복잡도가 순환 복잡도보다 개발자들이 느끼는 코드 이해 가능성과 더 강한 상관관계를 보이는가?
- RQ2높은 순환 복잡도 또는 인지 복잡도를 가진 클래스는 더 심각한 코드 문제를 가진 것으로 인식되는가?
- RQ3다양한 수준의 복잡도 지표를 가진 클래스 간에 이해 가능성에 대한 인식에 유의미한 차이가 있는가?
- RQ4초급 개발자들이 복잡도 지표에 따라 일관되게 코드 이해 가능성에 평가를 내리는가, 아니면 다른 요소가 더 영향을 미치는가?
- RQ5최근 도입된 인지 복잡도가 실무에서 코드 이해 가능성의 신뢰할 수 있는 대체 지표가 될 수 있는가?
주요 결과
- 인지 복잡도는 순환 복잡도보다 개발자들이 느끼는 코드 이해 가능성과 약간 더 강한 상관관계를 보였다.
- 어느 복잡도 지표이든 개발자들이 느끼는 이해 가능성과의 전반적인 상관관계는 약했으며, 이는 예측력이 제한됨을 시사한다.
- 복잡도 수준(순환 복잡도 또는 인지 복잡도)과 코드 문제의 심각도 인식 간 유의미한 상관관계는 발견되지 않았다.
- 높은 복잡도를 가진 클래스가 일관되게 더 심각한 문제를 야기한다고 평가된 것은 아니며, 이는 복잡도와 유지보수성 간의 가정에 도전한다.
- 결과적으로, 순환 복잡도 또는 인지 복잡도 중 어느 것이나 초급 개발자들 사이에서 개발자들이 느끼는 코드 이해 가능성의 강력한 예측 지표가 되지 못한다.
- 본 연구는 코드 이해 가능성 평가를 위한 보다 다른 또는 보완적인 지표에 대한 향후 연구의 필요성을 강조한다.

이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.