click to edit title stylelogo click to add text to your presentation software engineering expert...

21
Click To Edit Title Style LOGO Click to add text to your presentation SEEG Software Engineering Expert Group Copyright 2010 by SEEG, All Rights Reserved 유유유유 유유 : 유유유 2010. 05 Software Engineering Expert Group SEEG Software Engineering Expert Group Copyright 2010 by SEEG, All Rights Reserved

Upload: kelly-ellis

Post on 30-Dec-2015

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

유지보수 기술 : 재공학

2010. 05

Software Engineering Expert Group

SEEGSoftware Engineering

Expert Group

Copyright 2010 by ⓒ SEEG, All Rights Reserved

Page 2: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

일반적인 SW 개발 현상

An intrinsic property of software in a real-world environ-ment

Evolution

Enhanced

Modified

Adapted

More complex

Drift away 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

2

Page 3: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

유지보수에서 대부분의 비용발생

the major part of the total software development cost is devoted to …

Maintenance

3

Page 4: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

구조의 개선 없는 요구사항 구현

Most software products are developed from legacy code with small modifications.

Legacy Code Product 3

productization

Product 1

Product 2

update

4

Page 5: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging

Better software development methods and tools do not solve this problem.

R.L. Glass, “Maintenance: Less Is Not More,” IEEE Software, July/Aug. 1998.

Their increased capacity is used to implement more new require-ments within the same time frame

The Spiral of Complex

5

Page 6: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Aging Symptom

Symptom Description Metrics

Pollutionthe system includes many components not necessary to carry out the business functions

Unused data,Duplicated code

No documentsthe knowledge of the application domain and its evolution is spread over the programs and can no longer be derived from the documentation

Design spec,API doc,References

Poor lexiconsthe names of components have little lexical meaning or are in any case inconsistent with the meaning of the components they identify

Naming convention

Tightly Couplingthe programs and their components are linked by an ex-tensive network of data or control flows

Call graph,Fan-in,Fan-out

Architecture Erosion

the system’s architecture consists of several different so-lutions that can no longer be distinguished; even though the software started out with a high quality basic archi-tecture, the superimposition of these other hacked solu-tions during maintenance has damaged its quality

Dependency

6

Page 7: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• 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]

7

Page 8: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• Bad smell code Not maintainable

스파게티 코드 다수 존재

Feature enhance, bug fixing 으로인한 코드 수정 어려움

미흡한 영향평가로 new bug 등장

코드 수정 비용 증가

8

Page 9: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• Bad smell code duplicated code

일반적인 재사용

기능 A 기능 A’

함수 A1

함수 A2

함수 A3

함수 A4

함수 A1

함수 A2

함수 A3

함수 A4’

a.c a’.c

코드복사

동일한 코드 A1, A2, A3 존재파일단위 재사용이 아닌 함수단위 재사용의 문제

미사용 변수 다수 존재 유발 : 메모리 낭비추후 코드수정의 대상 설정 불명확

소스사이즈의 15% 이상 code clone 발생 (S 사 )

9

Page 10: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• 관리되지 않는 코드

YOUR COMPANYDomain Aver-

age(Multimedia)

# of Functions / Source File ? 18.5

Build LOC / Function ? 30.2

Average Function Com-plexity ? 6.0

Ratio of function com-plexity > 20 ? 5.4%

Ratio of function com-plexity > 50 ? 0.9%

10

Page 11: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• 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;

}

11

Page 12: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• Negative Returns

void basic_negative() {int buff[1024];int x = some_function(); // some_function() might return -1buff[x] = 0; // ERROR: buffer underrun at buff[-1]

}

12

Page 13: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• Overrun static

void overrun() {struct some_struct vmax_mtd[2]; // vmax_mtd has 2 elements,// index 0 and 1if (!vmax_mtd[1] && !vmax_mtd[2]) { // incorrectly access-

ing

// vmax_mtd[2]iounmap((void *)iomapadr);return -ENXIO;

}}

13

Page 14: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Software aging 현상의 예

• 기존 사용되는 Base Code 로는 새로운 기능 보강 혹은 HW 변경에 대응 하기에 많은 시간과 수작업이 들어간다

• 새로운 기능을 추가할 때에 기존 코드를 많이 수정해야 한다

• 누적된 버전 업과 사양 변경으로 인한 SW 품질을 만족하기 어렵다

• 개발자 교체 및 문서화 부족으로 인한 SW 코드 이해력이 떨어진다

• 버그를 수정하면 예상치 않은 다른 버그가 발견된다

• 우리 제품의 전체적인 아키텍처가 명확하지 않다

• 어느 모듈을 집중적으로 테스트해야 할지 객관적인 판단 기준이 필요하다

• 릴리즈 후 보고되는 버그가 이젠 당연스럽다

14

Page 15: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Reengineering is …

*E.J. Chikofsky and J.H. Cross, “Reverse Engineering and Design Recovery: A Taxonomy,” IEEE Software, vol. 7, no. 1, pp. 13-17,1990.

the transformation from one representa-tion form to another at the same relative abstraction level, while preserving the sub-ject system’s external behavior*

15

Page 16: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Why Reengineering

There is an urgent need for techniques that reduce software com-plexity byincrementally improving the 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.

Reengineering

16

Page 17: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

SW Re-Engineering 을 통한 품질 및 생산성 확보

• 급변하는 사업화에 대응할 수 있는 효과적인 대응 체계

기 검증된 코드 최대한 재사용

개발 기간 짧고 , 확장성및 품질 개선 시급

아키텍처 변경에 대한위험 부담 최소화

아키텍처 구조 개선

프로그램 모듈화

SW 설계 문서 재 구축

SW Re-Engineering

방법 적용이 문제 해결의 Key

17

Page 18: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

Base Code 정비를 통한 품질 및 생산성 증대 효과

• SW 품질 및 생산성은 개발 환경 구축에 따라 크게 10 배 정도 차이가 나타남 -> 재사용 가능한 Base Code 확보를 통한 제품 융복합화 , 다양한 제품 개발 요구 대응

[DTV 개발 사례 ]

개발 일정 및 투입인력 50% 단축

재사용 컴포넌트 기반 소프트웨어 아키텍처 운영

재사용

재사용

재사용

A 제품

B 제품

C 제품

18

Page 19: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

효과적인 SW Re-Engineering 단계

Legacy System 코드 및

아키텍처 분석

現 제품 군 내 공용으로사용할 수 있는

Reference Architecture 설계

재사용 가능 영역 선정( 재사용 과 신규 개발

부문 구분 )

System 빌드 및품질 기준에 따라검증 활동 수행

재사용 가능한컴포넌트 생성

Reference

Architecture

구조에 맞추어 구조화

19

Page 20: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

SW Re-Engineering 의 핵심 기술

코드 품질 측정

아키텍처 품질 분석

기존 SW 시스템에 대한품질 및 재사용성 분석

재구조화(Restructuring)

재분할 (Refactoring)

아키텍처 및 코드 재구성

현 SW 수준 분석을 통해 재사용 수준 파악

아키텍처 및 모듈화를 통한 SW 시스템 재 구축

20

Page 21: Click To Edit Title StyleLOGO Click to add text to your presentation Software Engineering Expert Group Copyright ⓒ 2010 by SEEG, All Rights Reserved 유지보수

Click To Edit Title Style LOGO

Click to add text to your presentation

SEEGSoftware Engineering

Expert GroupCopyright 2010 by ⓒ SEEG, All Rights Reserved

SW Re-Eng’ 을 통한 SW Quality 확보• 아키텍처 및 컴포넌트의 품질 확보를 위해서는 정량적으로 측정 가능한 목표 기준을 가지고 개선 활동을 수행해야 함

Code Quality

함수 복잡도

함수간 호출 관계

전역 변수 수

함수 및 모듈 (File) 수

사용되지 않는 변수 및 함수

Architecture Quality

요구 사양 및 설계 문서 상태

모듈간 호출 관계

아키텍처 스타일

모듈화 상태

아키텍처 및 모듈 재 사용성

21