Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementation.

Similar presentations


Presentation on theme: "Implementation."— Presentation transcript:

1 Implementation

2 소프트웨어 구현 구현단계의 작업 구현단계에서 결정해야 할 사항 설계 문서 => 구현 단계의 출발선
각 모듈에 대한 원시코드의 작성 및 문서화 단위 모듈에 대한 테스트 작업을 포함 구현단계에서 결정해야 할 사항 프로그래밍 언어의 선택 Coding 지침 작성 Coding Style에 대한 표준 확립 모듈 구현 순서의 결정

3 프로그래밍 언어 프로그래밍 언어의 역할 High Level 프로그래밍 언어의 특징 기계 제어 소프트웨어 구현 및 저장
의사소통 수단 (Logic의 표현, 소프트웨어의 문서화) High Level 프로그래밍 언어의 특징 이해하기 쉽다 =>읽기 쉬움, 디버깅 용이, 오류 가능성 감소 풍부한 표현력 => 응용 분야에 가깝고, 프로그램 작성 용이 높은 이식성 =>낮은 기계 종속성 높은 생산성 프로그래머의 시간 vs. 기계 시간 프로그래밍 언어에 관계없이 코딩 속도가 일정

4 프로그래밍 언어의 선택(1) 프로그래밍 언어 선택의 중요성 프로그래밍 언어 선택시 고려 사항 코딩 및 테스팅이 수월
유지 보수 용이 ==> 유지보수 비용의 절감 프로그래밍 언어 선택시 고려 사항 프로젝트의 특성 프로그래밍 언어 자체의 특성

5 프로그래밍 언어의 선택(2) 프로젝트의 특성 사용자의 요구: 특정 언어를 지정 프로그래머의 지식
완료/진행중인 프로젝트에서 사용한 언어 컴파일러의 가용성 및 품질 Target 하드웨어 및 O/S에서 사용 가능 소프트웨어 개발 도구의 지원 editor, debugger, linker cross-reference table, ... 호환성: 다양한 H/W 및 O/S

6 프로그래밍 언어의 선택(3) 프로그래밍 언어 자체의 특성 표현력에 따른 적합성: 문제 영역에 따라 상이
단순성, 명확성, 직교성(orthogonality) 사용하기 쉬운 문법 Control Mechanism Data Types Constants Procedure & Function Encapsulation, Template, …

7 Coding 지침 표현 방법: 분명하게 읽기 쉽도록 코드 작성 제어 구조, 자료 구조의 선택에 신중 시스템 장해 대책 수립
예외 상황에 대해 충분히 고려할 것 품질 향상 이해 용이성: 적절한 기호와 주석, 구별하기 쉬운 변수 명 간결성 이식성: 하드웨어나 OS 종속 부분을 명시 유지보수성 테스트 용이성 신뢰성: 정확한 동작, robustness 효율성

8 Coding Style 좋은 프로그래밍 스타일에 대한 기준 좋은 프로그래밍 스타일을 위한 원칙 Simplicity
Readability 좋은 프로그래밍 스타일을 위한 원칙 스타일1 : 명확하게 작성하라 스타일2: 수식의 의미를 간결하고 직접적으로 표현 스타일3: 임시 변수의 사용을 피하라 스타일4: 혼돈을 초래할 수 있는 변수명은 피하라 스타일5: 일관성 있는 변수명을 사용하라 스타일6: 문장 그룹이 명확하도록 {}와 들여쓰기 사용 스타일7: if 다음에 if가 따라오는 구조나 null else는 피하라 스타일8: 문장의 반복은 최소화하라 스타일9: 모듈화하라

9 구조적 프로그래밍(1) 구조화 프로그램(Structured Program) 프로그램을 기술하기 위한 단계적 세분화
프로그램의 제어 흐름을 sequence, selection, iteration만으로 표현되는 프로그램. 단계적 세분화를 통해 하나의 function node로 부터 유도 가능 프로그램을 기술하기 위한 단계적 세분화 하나의 function node를 기본적인 제어 구조를 갖는 프로그램으로 대치. 프로그램 내부의 function nodes에 대해서도 다시 기본적인 제어 구조를 갖는 프로그램으로 대치 반복.

10 구조적 프로그래밍(2) c d a b p q s t h g k k h g p k

11 Make(1) Make Utility that maintains programming projects involving many modules Guarantee the equivalence of source and object modules Create the executable file using a specification of the interdependencies (placed in a Makefile) of the various modules of a program Detect files that are inconsistent and need to be rebuilt using timestamps

12 Make(2) Example of Makefile Project files :
Three C language source files : main.c, iodat.c, dorun.c Assembly language code : lo.s A set of library routines in /hskim/lib/crtn.a If you built program by hand % cc -c main.c % cc -c iodat.c % cc -c dorun.c % as -o lo.o lo.s % cc -o program main.o iodat.o dorun.o lo.o /hskim/lib/crtn.a

13 Make(3) Description file : Makefile
program : main.o iodat.o dorun.o lo.o /hskim/lib/crtn.a cc -o program main.o iodat.o dorun.o lo.o /hskim/lib/crtn.a main.o : main.c cc -c main.c iodat.o : iodat.c <=== dependency line cc -c iodat.c <=== command line dorun.o : dorun.c cc -c dorun.c lo.o : lo.s as -o lo.o lo.s

14 Make(4) Dependency checking
Minimizing rebuilds : minimal set of commands library main.c iodat.c iodat.o dorun.c lo.s main.o dorun.o lo.o program assembler loader compiler

15 Make(5) Basic rules of syntax tab : 모든 command 앞에 (특히 주의)
backslash(\) - continuation mark: at the end of a line pound sign(#) - comment: from it to the end of a line single target can appear on multiple dependency lines file.o : /usr/src/file.c cc -c /usr/src/file.c ..... file.o : global.h defs.h * 단 하나의 dependency line과 command가 결합 targets without prerequisites clean : /bin/rm -f core *.o ==> % make clean

16 Make(6) Macros macro definitions : name = text string
macro references : $(name) or ${name} example LIBES = -lX11 OBJS = draw.o plot_points.o data.o DEBUG_FLAG = -g BINDIR = /usr/local/bin plot : ${OBJS} cc -o plot ${DEBUG_FLAG} ${OBJS} ${LIBES} mv plot ${BINDIR} % make plot cc -o plot -g draw.o plot_points.o data.o -lX11 mv plot /usr/local/bin

17 Make(7) Make uses five Internal Macros
$< : expands to the name of the file that is out of date with respect to the target .c.o : cc -g -c $< $* : expands to the file name without suffix cc -g -c $*.c : expands to the name of target file program : ${OBJS} ${LIB} ${CC} -o ${OBJS} ${LIB} $? : expands to the list of files that are out of date $% : evaluated only when the target file is an archive library member lib(file1.o) $% = file1.o = lib

18 Source Code 문서화 문서화 ==> 유지보수에 필수 문서화의 형태
Comments for Program header Comments for Module header In-line comments Comment for Program header에 포함 사항 프로그램의 제목, 저작자, 작성일, Version no. 프로그램의 목적 구조 설계 공유변수 및 사용하는 파일 외부 참조: 사용하는 외부 모듈을 나열


Download ppt "Implementation."

Similar presentations


Ads by Google