※ 공부 내용의 복습 개념으로 정리된 글입니다. - 출처 시나공
모듈(Module)의 개요
모듈은 모듈화를 통해 분리된 시스템의 각 기능들로, 서브루틴, 서브시스템, 소프트웨어 내의 프로그램, 작업 단위 등과 같은 의미로 사용됩니다.
- 모듈은 단독으로 컴파일이 가능하며, 재사용 할 수 있습니다.
- 모듈의 기능적 독립성은 소프트웨어를 구성하는 각 모듈의 기능이 서로 독립됨을 의미하는 것으로, 모듈이 하나의 기능만을 수행하고 다른 모듈과의 과도한 상호작용을 배제함으로써 이루어집니다.
- 독립성이 높은 모듈일수록 모듈을 수정하더라고 다른 모듈들에게는 거의 영향을 미치지 않으며, 오류가 발생하도 쉽게 발견하고 해결할 수 있습니다.
- 모듈의 독립성은 결합도(Coupling)와 응집도(Cohesion)에 의해 측정되며, 독립성을 높이려면 모듈의 결합도는 약하게, 응집도는 강하게, 모듈의 크기는 작게 만들어야 합니다.
※ 모듈화(Moudlarity)
모듈화는 소프트웨어의 성능을 향상시키거나 시스템의 수정 및 재사용, 유지 관리 등이 용이하도록 시스템의 기능들을 모듈 단위로 분해하는 것을 의미합니다.
- 루틴(Routine) : 기능을 가진 명령들의 모임
- 메인 루틴(Main Routine) : 프로그램 실행의 큰 줄기가 되는 것
- 서브 루틴(subroutine) : 메인 루틴에 의해 필요할 때 마다 호출되는 루틴
※ 서브시스템(Subsystem)
서브시스템은 시스템을 구성하는 요소의 하나로, '단위시스템'이라고도 불리며, 서브시스템 자체로도 하나의 시스템에 필요한 요소들을 갖추고 있습니다. 예를 들어 메인 시스템이 '통합 경영정보 시스템'이라면 여기에 속하는 서브시스템으로 '영업관리 시스템', '생산관리 시스템', '인사관리 시스템' 등이 있습니다.
결합도(Coupling)
결합도는 모듈 간에 상호 의존하는 정도 또는 두 모듈 사이의 연관 관계를 의미합니다.
- 다양한 결합으로 모듈을 구성할 수 있으나 결합도가 약할수록 품질이 높고, 강할수록 품질이 낮습니다.
- 결합도가 강하면 시스템 구현 및 유지보수 작업이 어렵습니다.
- 결합도의 종류에는 자료 결합도, 스탬프 결합도, 제어 결합도, 외부 결합도, 공통 결합도, 내용 결합도가 있으며 결합도의 정도는 다음과 같습니다.
응집도(Cohesion)
응집도는 정보 은닉 개념을 확장한 것으로, 명령어나 호출문 등 모듈의 내부 요소들의 서로 관련되어 있는 정도, 즉 모듈의 독립적인 기능으로 정의되어 있는 정도를 의미합니다.
- 다양한 기준으로 모듈을 구성할 수 있으나 응집도가 강할수록 품질이 높고, 약할수록 품질이 낮습니다.
- 응집도의 종류에는 기능적 응집도, 순차적 응집도, 교환(통신)적 응집도, 절차적 응집도, 시간적 응집도, 논리적 응집도, 우연적 응집도의 정도는 다음과 같습니다.
※ 정보 은닉(Information Hiding)
정보 은닉은 한 모듈 내부에 포함된 절차와 자료들의 정보가 감추어져 다른 모듈이 접근하거나 변경하지 못하도록 하는 기법입니다.
팬인(Fan-in) / 팬아웃(Fan-Out)
- 팬인은 어떤 모듈을 제어(호출)하는 모듈의 수를 나타냅니다.
- 팬아웃은 어떤 모듈에 의해 제어(호출)되는 모듈의 수를 나타냅니다.
- 팬인과 팬아웃을 분석하여 시스템의 복잡도를 알 수 있습니다.
- 팬인이 높다는 것은 재사용 측면에서 설계가 잘 되어있다고 볼 수 있으나, 단일 장애점이 발생할 수 있으므로 중점적인 관리 및 테스트가 필요합니다.
- 팬아웃이 높은 경우 불필요하게 다른 모듈을 호출하고 있는지 검토하고, 단순화시킬 수 있는지 여부에 대한 컴토가 필요합니다.
- 시스템의 복잡도를 최적화하려면 팬인은 높게, 팬아웃은 낮게 설계해야 합니다.
예제
다음은 시스템 구조도에서 각 모듈의 팬인(Fan-in)과 팬아웃(Fan-out)을 구하시오.
해설
- 팬인(Fan-in) : A는 0, B · C · D · E · G는 1, F · H · I는 2
- 팬아웃(Fan-out) : H · I는 0, C · E · F · G는 1, B · D는 2, A는 3
N-S 차트(Nassi-Schneiderman Chart)
N-S 차트는 논리의 기술에 중점을 둔 도형을 이용한 표현 방법으로 박스 다이어그램, Chapin Chart라고도 합니다.
- 연속, 선택 및 다중 선택, 반복 등의 제어 논리 구조를 표현합니다.
- GOTO나 화살표를 사용하지 않습니다.
- 조건이 복합되어 있는 곳의 처리를 시각적으로 명확히 식별하는 데 적합합니다.
- 선택과 반복 구조를 시각저그올 표현합니다.
- 이해하기 쉽고, 코드 변환이 용이합니다.
- 읽기는 쉽지만 작성하기가 어려우며, 임의로 제어를 전이하는 것이 불가능합니다.
- 총체적인 구조 표현과 인터페이스를 나타내기가 어렵습니다.
- 단일 입구와 단일 출구로 표현합니다.
※ 단일 장애점(SPDF, Single Point Of Failure)
단일 장애점은 시스템의 구성 요소 중 동작하지 않으면 전체 시스템이 중단되어 버리느 요소를 의미하며, 단일 실패점이라고도 합니다.
'정보처리산업기사' 카테고리의 다른 글
정보처리산업기사 - 프로그래램 구현 - 보안 및 API (2) | 2024.09.03 |
---|---|
정보처리산업기사 - 프로그래램 구현 - 공통 모듈 (2) | 2024.09.02 |
정보처리산업기사 - 프로그래램 구현 - 서버 개발 (0) | 2024.08.31 |
정보처리산업기사 - 프로그래램 구현 - 개발 환경 구축 (2) | 2024.08.30 |
정보처리산업기사 - 프로그래밍 언어 활용 - 프로토타입 (0) | 2024.08.29 |