호출 그래프, 콜 그래프(call graph), 호출 다중 그래프, 콜 멀티그래프(call multigraph)[1][2]는 컴퓨터 프로그램의 서브루틴 간의 호출 관계를 나타내는 제어 흐름 그래프이다.[3] 각 노드는 프로시저를 나타내고 각 에지(f, g)는 프로시저 f가 프로시저 g를 호출함을 나타낸다. 따라서 그래프의 순환은 재귀 프로시저 호출을 나타낸다.

파이썬의 간단한 컴퓨터 프로그램에 대해 생성된 호출 그래프이다.

용도 편집

호출 그래프는 다양한 방식으로 사용될 수 있다. 호출 그래프의 간단한 응용 중 하나는 호출되지 않은 프로시저를 찾는 것이다. 호출 그래프는 인간이 프로그램을 이해하는 데 도움이 되는 문서 역할을 할 수 있다.[4] 호출 그래프는 프로그램 실행이나 코드 주입 공격의 이상 징후를 탐지하는 데에도 사용할 수 있다.[5]

각주 편집

  1. Callahan, D.; Carle, A.; Hall, M. W.; Kennedy, K. (April 1990). “Constructing the procedure call multigraph”. 《IEEE Transactions on Software Engineering》 16 (4): 483–487. doi:10.1109/32.54302. 
  2. Uday Khedker; Amitabha Sanyal; Bageshri Sathe (2009). 《Data Flow Analysis: Theory and Practice》. CRC Press. 234쪽. ISBN 978-0-8493-3251-7. 
  3. Pankaj Jalote (1997). 《An Integrated Approach to Software Engineering》. Springer Science & Business Media. 372쪽. ISBN 978-0-387-94899-7. 
  4. Eisenbarth, T.; Koschke, R.; Simon, D. (2001). 〈Aiding program comprehension by static and dynamic feature analysis〉. 《Proceedings IEEE International Conference on Software Maintenance. ICSM 2001》. 602–611쪽. doi:10.1109/icsm.2001.972777. ISBN 0-7695-1189-9. S2CID 5934718. 
  5. Gao, Debin; Reiter, Michael K.; Song, Dawn (2004년 10월 25일). 〈Gray-box extraction of execution graphs for anomaly detection〉. 《Proceedings of the 11th ACM conference on Computer and communications security - CCS '04》. ACM. 318–329쪽. doi:10.1145/1030083.1030126. ISBN 1581139616. S2CID 1189805.