728x90
- Thomas J. McCabe 가 만든 SW 복잡도 측정 metric.
- 측정 대상 프로그램의 control flow graph 를 이용해 계산한다. 즉, control flow graph 를 먼저 그려야 한다.
- 계산식: M = E - N + 2P
- M: Cyclomatic complexity
- E: graph 에서 edge 갯수
- N: graph에서 node 갯수
- P: Connected component 의 갯수. 그래프를 그렸을 때 서로 연결되지 않은 path 들의 갯수를 말함.
- 예를 들어보면,
위 식은 다음의 flow graph 로 표현할 수 있음.
위 flow graph로 다음을 추출.
- E: graph 에서 edge 갯수 = 연결선 갯수 = 8
- N: graph에서 node 갯수 = 7
- P: Connected component 의 갯수. = 1
그러므로, Cyclomatic complexity M = 8 - 7 + (2 * 1) = 3 이다!!!
[참고]
https://www.tutorialspoint.com/software_testing_dictionary/cyclomatic_complexity.htm
https://en.wikipedia.org/wiki/Component_(graph_theory)
반응형
'공돌이' 카테고리의 다른 글
[Software process] Software process 의 효과성을 측정하는 측정기법 중 헷갈리는 것들, 'Responsiveness', 'Adaptability', 'Dependability' (Feat. ChatGPT) (1) | 2023.06.07 |
---|---|
[CMMI] 'Capability Level' 과 'Maturity Level' 간의 차이는? (0) | 2023.06.02 |
[pyQt5]pyqt 시작하기, Hello World (0) | 2019.03.09 |
무료 마인드맵 프로그램 - freemind (0) | 2018.03.02 |
라즈베리파이 3 드디어 내손에 도착! (0) | 2018.02.27 |