기존코드를 활용하여 대다수 SW회사는 개발을 합니다.
그런데 기존코드의 구조/품질에 대한 개선없이 새로운 feature를 추가하거나 기존 feature를 삭제하니다.
결과적으로 지저분한 코드가 됩니다.
점점 수정하기도 어려워지고, 추가하기도 힘들어집니다.
본 슬라이드는 이러한 일상적인 개발 현실을 개선하기 위한 방법으로 코드 재공학을 설명하고 있습니다.
본 practice에 더 많은 관심이 있으시면 jtkim@swexpertgroup.com 혹은 canon.kim@gmail.com으로 연락주세요.
1. Click To Edit Title Style LOGO Engineering
Software
Expert Group
Click to add text to your presentation
코드품질 및 구조 개선 제안서
Copyrightⓒ 2013 by SEEG, All Rights Reserved
Copyrightⓒ 2010 by SEEG, All Rights Reserved Software Engineering
Expert Group
2. 일반적인 SW 개발 현상
Click To Edit Title Style LOGO
An intrinsic property of software in a real-world environment
Click to add text to your presentation
Enhanced
More complex
Modified
Drift away
Adapted from its original design
Tom Mens and Tom Tourwe, “A Survey of Software Refactoring”, IEEE Transactions
on Software Engineering, 2004, Vol. 30, Issue 2, pp. 126 - 139
Copyrightⓒ 2013 by SEEG, All Rights Reserved 2 Software Engineering
Expert Group
3. 유지보수에서 대부분의 비용발생
Click To Edit Title Style LOGO
the major part of the total software development cost is devoted to …
Click to add text to your presentation
Copyrightⓒ 2013 by SEEG, All Rights Reserved 3 Software Engineering
Expert Group
4. 구조의Edit Title없는 요구사항 구현
Click To
개선 Style LOGO
Most software products are developed from legacy code with small modifications.
Click to add text to your presentation
productization
Legacy Code
update
Copyrightⓒ 2013 by SEEG, All Rights Reserved 4 Software Engineering
Expert Group
5. Click To Edit Title Style LOGO
Software aging
Better software development methods and tools do not solve this problem.
Their increased text to your used to implement more new requirements within the
Click to add capacity is presentation
same time frame
The Spiral of Complex
R.L. Glass, “Maintenance: Less Is Not More,” IEEE Software, July/Aug. 1998.
Copyrightⓒ 2013 by SEEG, All Rights Reserved 5 Software Engineering
Expert Group
6. AgingEdit Title Style
Click To
Symptom LOGO
Click to add text to your presentation
Symptom Description Metrics
the system includes many components not necessary to carry out Unused data,
Pollution
the business functions Duplicated code
the knowledge of the application domain and its evolution is Design spec,
No documents spread over the programs and can no longer be derived from the API doc,
documentation References
the names of components have little lexical meaning or are in any
Poor lexicons case inconsistent with the meaning of the components they Naming convention
identify
Call graph,
the programs and their components are linked by an extensive
Tightly Coupling Fan-in,
network of data or control flows
Fan-out
the system’s architecture consists of several different solutions
that can no longer be distinguished; even though the software
Architecture Erosion started out with a high quality basic architecture, the Dependency
superimposition of these other hacked solutions during
maintenance has damaged its quality
Copyrightⓒ 2013 by SEEG, All Rights Reserved 6 Software Engineering
Expert Group
7. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• Bad smell code 고수준의 결함밀도
Domain defect density
Small devices 4.787
Wireless capabilities 3.092
Target HW is new or evolving 2.588
Large stationery equipment 2.495
Real time 2.172
Multi-tasking 2.104
DB interface 1.459
Biometrics 1.290
Power systems 1.093
Client Server 0.434
Command, control and communications 0.366
Satellite 0.358
Command and control 0.180
GPS 0.134
Military ground vehicle 0.106
Web based 0.091
[SoftRel, 2007]
Copyrightⓒ 2013 by SEEG, All Rights Reserved 7 Software Engineering
Expert Group
8. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• Bad smell code Not maintainable
스파게티 코드 다수 존재
Feature enhance, bug fixing으로
인한 코드 수정 어려움
미흡한 영향평가로 new bug 등장
코드 수정 비용 증가
Copyrightⓒ 2013 by SEEG, All Rights Reserved 8 Software Engineering
Expert Group
9. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• Bad smell code duplicated code
일반적인 재사용
기능 A 기능 A’
동일한 코드 A1, A2, A3 존재
함수 A1 함수 A1
파일단위 재사용이 아닌 함수단위 재사용의 문제
코 함수 A2
함수 A2
드 미사용 변수 다수 존재 유발: 메모리 낭비
함수 A3 복 함수 A3 추후 코드수정의 대상 설정 불명확
사 함수 A4’
함수 A4
소스사이즈의 15% 이상 code clone 발생(S사)
a.c a’.c
Copyrightⓒ 2013 by SEEG, All Rights Reserved 9 Software Engineering
Expert Group
10. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• 관리되지 않는 코드
Domain Average
YOUR COMPANY
(Multimedia)
# of Functions / Source File ? 18.5
Build LOC / Function ? 30.2
Average Function Complexity ? 6.0
Ratio of function complexity >
20 ? 5.4%
Ratio of function complexity >
50 ? 0.9%
Copyrightⓒ 2013 by SEEG, All Rights Reserved 10 Software Engineering
Expert Group
11. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• Deadcode
int deadcode_example1(int *p) {
if( p == NULL ) {
return -1;
}
use_p( *p );
if( p == NULL ) { // p cannot be null.
handle_error(); // Defect: Dead code.
return -1;
}
return 0;
}
Copyrightⓒ 2013 by SEEG, All Rights Reserved 11 Software Engineering
Expert Group
12. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• Negative Returns
void basic_negative() {
int buff[1024];
int x = some_function(); // some_function() might return -1
buff[x] = 0; // ERROR: buffer underrun at buff[-1]
}
Copyrightⓒ 2013 by SEEG, All Rights Reserved 12 Software Engineering
Expert Group
13. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text to your presentation
• Overrun static
void overrun() {
struct some_struct vmax_mtd[2]; // vmax_mtd has 2 elements,
// index 0 and 1
if (!vmax_mtd[1] && !vmax_mtd[2]) { // incorrectly accessing
// vmax_mtd[2]
iounmap((void *)iomapadr);
return -ENXIO;
}
}
Copyrightⓒ 2013 by SEEG, All Rights Reserved 13 Software Engineering
Expert Group
14. Click To Edit Title Style
Software aging 현상의 예 LOGO
Click to add text Base Code로는 새로운 기능 보강 혹은 HW 변경에 대응 하기에
• 기존 사용되는 to your presentation
많은 시간과 수작업이 들어간다
• 새로운 기능을 추가할 때에 기존 코드를 많이 수정해야 한다
• 누적된 버전 업과 사양 변경으로 인한 SW 품질을 만족하기 어렵다
• 개발자 교체 및 문서화 부족으로 인한 SW 코드 이해력이 떨어진다
• 버그를 수정하면 예상치 않은 다른 버그가 발견된다
• 우리 제품의 전체적인 아키텍처가 명확하지 않다
• 어느 모듈을 집중적으로 테스트해야 할지 객관적인 판단 기준이
필요하다
• 릴리즈 후 보고되는 버그가 이젠 당연스럽다
Copyrightⓒ 2013 by SEEG, All Rights Reserved 14 Software Engineering
Expert Group
15. Click To Edit Title Style LOGO
Reengineering is …
Click to add text to your presentation
*E.J. Chikofsky and J.H. Cross, “Reverse Engineering and Design Recovery:
A Taxonomy,” IEEE Software, vol. 7, no. 1, pp. 13-17,1990.
Copyrightⓒ 2013 by SEEG, All Rights Reserved 15 Software Engineering
Expert Group
16. Why To Edit Title Style
Click
Reengineering LOGO
There is an urgent need for techniques that reduce software complexity by
incrementally improving thepresentation
Click to add text to your internal software quality
W.G. Griswold and D. Notkin, “Automated Assistance for Program Restructuring,”
Trans. Software Eng. and Methodology, vol. 2, no. 3, pp. 228-269, July 1993.
Copyrightⓒ 2013 by SEEG, All Rights Reserved 16 Software Engineering
Expert Group
17. Click
Re-Engineering을 통한 품질 및 생산성 확보
SW To Edit Title Style LOGO
Click급변하는 사업화에 대응할 수 있는 효과적인 대응 체계
• to add text to your presentation
개발 기간 짧고, 확장성 SW Re-Engineering
및 품질 개선 시급
방법 적용이 문제 해결의 Key
기 검증된 코드 최대한
아키텍처 구조 개선
재사용
프로그램 모듈화
아키텍처 변경에 대한
SW 설계 문서 재 구축
위험 부담 최소화
Copyrightⓒ 2013 by SEEG, All Rights Reserved 17 Software Engineering
Expert Group
18. BaseTo Edit Title Style 통한 품질 및 생산성 증대 효과LOGO
Click Code 정비를
• Click to add text to your presentation 따라 크게 10배 정도 차이가 나타남
SW 품질 및 생산성은 개발 환경 구축에
-> 재사용 가능한 Base Code 확보를 통한 제품 융복합화, 다양한 제품
개발 요구 대응
A제품
재사용 [DTV 개발 사례]
재사용
B제품
개발 일정 및 투입인력 50% 단축
재사용
재사용 컴포넌트 기반 C제품
소프트웨어 아키텍처 운영
Copyrightⓒ 2013 by SEEG, All Rights Reserved 18 Software Engineering
Expert Group
19. 효과적인 Title Style
Click To Edit
SW Re-Engineering 단계 LOGO
Click to add text to your presentation
Legacy System 現 제품 군 내 공용으로 재사용 가능 영역 선정
코드 및 사용할 수 있는 (재사용 과 신규 개발
아키텍처 분석 Reference
부문 구분)
Architecture 설계
Reference System 빌드 및
재사용 가능한 Architecture 품질 기준에 따라
컴포넌트 생성 구조에 맞추어 구조화 검증 활동 수행
Copyrightⓒ 2013 by SEEG, All Rights Reserved 19 Software Engineering
Expert Group
20. Click
Re-Engineering의 핵심 기술
SW To Edit Title Style LOGO
Click to 기존 text 시스템에presentation
add SW to your 대한
아키텍처 및 코드 재구성
품질 및 재사용성 분석
코드 품질 측정 재구조화
(Restructuring)
재분할
아키텍처 품질 분석
(Refactoring)
현 SW 수준 분석을 통해 아키텍처 및 모듈화를 통한
재사용 수준 파악 SW 시스템 재 구축
Copyrightⓒ 2013 by SEEG, All Rights Reserved 20 Software Engineering
Expert Group
21. SW To Edit Title 을 통한 SW Quality 확보
Click
Re-Eng’ Style LOGO
• 아키텍처 및 컴포넌트의 품질 확보를 위해서는 정량적으로 측정 가능한
Click to add text to your presentation 함
목표 기준을 가지고 개선 활동을 수행해야
Code Quality Architecture Quality
함수 복잡도 요구 사양 및 설계 문서 상태
함수간 호출 관계 모듈간 호출 관계
전역 변수 수 모듈화 상태
함수 및 모듈(File) 수 아키텍처 스타일
사용되지 않는 변수 및 함수 아키텍처 및 모듈 재 사용성
Copyrightⓒ 2013 by SEEG, All Rights Reserved 21 Software Engineering
Expert Group
22. SEEG SW Re-Engineering 방법론
Click To Edit Title Style LOGO
• 데이터 기반 개선활동presentation
Click to add text to your
Copyrightⓒ 2013 by SEEG, All Rights Reserved 24 Software Engineering
Expert Group
23. Click To
SW Re-Engineering 방법론
SEEG Edit Title Style LOGO
Click to add text to your presentation
• 실무 Practice 기술 이전
• 코드버전관리방법
•성과분석및 운영 • 이슈관리방법
•재구조화방법
•개선방법수립 및 개선 •Refactoring 방법
•기반코드분석 •기반코드분석방법
•개선목표수립 •지표수립방법
Copyrightⓒ 2013 by SEEG, All Rights Reserved 25 Software Engineering
Expert Group
24. SEEG is …
Click To Edit Title Style LOGO
• 2009년 12월에 설립된 SW Engineering 전문 회사
• Click to add 조직운영, 개발 컨설팅 서비스 수행
SW 기획, text to your presentation
서비스 개요 특징 (효과) 적용도메인
국제 공인 수준의 개발 프로세스 국제 수준 프로세스
SW Process Model 프레임워크 및 SPI 조직 설정 프레임워크 확보 •서비스 영역
SW Process 프로세스 평가 기반 개발 능력 수준 파악, 프로세스 품질 수준 IT, 정보 가전,
SPI 프로세스 개선, 프로세스 구축 가이드 향상
Assessment 산업용 기기 ,
산업용 시스템
SW개발 특수성에 입각한 프로젝트 관리 효율적인 프로젝트 관리 全 SW 개발 영역
SW Project Mgt. 및 조직 운영 프로세스 구축 가이드 능력 확보 (독립 조직 운영)
UML 1.4, 2.0 기반 객체지향 개발 프로세스 Code Modularity & 특히, 전기 전자 제품
객체지향 개발 방법론 및 분석 설계 방법 가이드 Reusability 확보 제조업 기반 적용
경험이 풍부
실시간 시스템 대상 Top down 기능 분할 정교한 Task설계 가이드를
실시간 구조적 방법론 중심 분석/설계 개발 방법 가이드 통한 Reliability확보
제품 군 Roadmap에 따른 SW Platform 구축 제품 군 단위 대단위 *적용 회사
Product Line Eng. 및 Platform기반 재사용 방법 가이드 SW 재사용
개발 삼성 전자
방법 복잡하고 재사용이 어려운 Legacy System을 Base Code 의 Quality LG 전자
론 Software Re-Eng. Re structuring & Re-factoring을 통해 재사용이 용이 및 Reusability 향상 LS 산전
한 SW 구조 및 컴포넌트로 재편 한전 KDN
Telechips
개발 기본 요소인 요구사항의 도출/정립/ 요구사항 기반 품질 Inpion
Requirement Eng. 추적성 확보를 위한 체계적인 프로세스 가이드 관리 능력 향상 Ezcaretech
Attribute Driven 품질 속설 기반 요구사항 도출, 아키텍처 설계 품질 요구사항 적용
Design 및 검증 방법론 가이드 능력 향상
SW 품질 활동 전문화를 위한 품질 검증 및 SW 산출물 품질 수준
SQA Process & Organization 품질 Audit 가이드 향상
Copyrightⓒ 2013 by SEEG, All Rights Reserved 26 Software Engineering
Expert Group
25. Click To Edit Title Style LOGO
Contact us
Click to add text to your presentation
• 김진태
• 사무실: 070-7584-4797
• 모바일: 010-9962-4567
• Email:
jtkim@swexpertgroup.com
Copyrightⓒ 2013 by SEEG, All Rights Reserved 27 Software Engineering
Expert Group