visual studio team system with agile tech days 2010

21
Visual Studio Team System with Agile 엄준일 공성의

Upload: -

Post on 07-Jul-2015

182 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Visual studio team system with agile tech days 2010

Visual Studio Team System with Agile

엄준일 공성의

Page 2: Visual studio team system with agile tech days 2010

향상된 테스팅 방법

엄준일

Page 3: Visual studio team system with agile tech days 2010

• 비주얼 스튜디오의 테스트 기술

– 단위 테스트

– PEX 를 이용한 화이트박스 테스팅

– Code Contract 를 통한 명확한 코드 계약

목차

Page 4: Visual studio team system with agile tech days 2010

단위 테스트

작은

버그

작은

버그

증식

큰 버그

버그의

증식

재앙

• 최소한의 기능이 동작하는 것을 보장

• 오류로 인한 오류증식 감지

• 로직, 플랫폼, 통합 문제를 식별 가능

Page 5: Visual studio team system with agile tech days 2010

단위 테스트의 어려움

데이터 중심 단위 테스트 사용자 중심 단위 테스트

•사용자 동작 시 오류 최소화

•런타임 오류 최소화

Dummy

Stub

Spy

Fake

•테스트 복잡도 증가

•테스트 코드 양의 증가

BDD + Mock

•테스트의 정확도 증가

•소프트웨어 품질 향상

테스트 교육 및

테스트 전문가/팀 필요테스트의 복잡성을 단순화

•최소한의 런타임 동작을 보장

•관련 있는 컴포넌트간의 연관된 오류 최소화

•컴포넌트간에 자연스럽게 결합도 감소

•데이터의 트랜잭션을 보장 향상

•데이터의 통일성 보장 향상

•데이터의 품질 향상

•데이터베이스의 부하 증가

•더미(Dummy) 데이터의 증가

•테스트 실행 성능 저하

•테스트를 위하여 추상화된 패턴을 강제화

•패턴을 통한 리팩토링 양의 증가로 생산성 저하

Page 6: Visual studio team system with agile tech days 2010

단위 테스트를 할 수록…

소프트웨어 품질 향상

시간, 리소스, 비용 증가

Page 7: Visual studio team system with agile tech days 2010

PEX

• Microsoft Research 팀에서 진행중인 프로

젝트

• WhiteBox Unit Test

• Parameterized Unit Test

• Code Contract 와의 통합

Page 8: Visual studio team system with agile tech days 2010

• 코드 계약을 통해 명시적인 조건을 선언

• 코드 계약을 통해 할 수 있는 것들

– 테스트의 간소화

– 컴파일 시에 코드 정적 검사

– 문서화

Code Contract

Page 9: Visual studio team system with agile tech days 2010

• 단위 테스트

• PEXhttp://research.microsoft.com/en-us/projects/pex/documentation.aspx

• Code Contracthttp://msdn.microsoft.com/en-us/devlabs/dd491992.aspx

참고 자료

Page 10: Visual studio team system with agile tech days 2010

Code Review

공성의

Page 11: Visual studio team system with agile tech days 2010

• Code Review개요, 장점

• VSTS 2010에서 향상된 Code Review

– 규칙 세트

– 8개의 새로운 Data Flow 규칙

목차

Page 12: Visual studio team system with agile tech days 2010

• Code Review는 적은 비용으로, 개발자가

흔히 저지를 수 있는 실수로 인한 버그들을

줄일 수 있는 가장 쉬운 방법 중에 하나입니

다.

Code Review

Page 15: Visual studio team system with agile tech days 2010

• Visual Studio Team System 2010에서 코드

리뷰 기능 향상

– 규칙 세트

– 8개의 새로운 Data Flow 규칙

출처: http://blogs.msdn.com/fxcop/archive/2008/10/30/new-code-analysis-

features-in-visual-studio-2010-september-08-ctp.aspx

Code review of VSTS 2010

Page 16: Visual studio team system with agile tech days 2010

• 코드 분석 규칙들을 미리 정해진 Set으로 관리할 수 있는 기능입니다.

• 프로젝트에 규칙 세트를 지정하는 것으로 코드 분석을 커스터마이징

할 수 있게 되었습니다.

• Team Foundation Server의 Check-In Policy에도 이 규칙 세트를 적용

가능합니다.

규칙 세트 (Rule Set)

Page 17: Visual studio team system with agile tech days 2010

• VSTS2010의 기본 규칙 세트

– Minimum Recommended Rule Set

– Basic Correctness Rule Set

– Basic Design Guideline Rule Set

– Extended Correctness Rule Set

– Extended Design Guideline Rule Set

– Globalization Rule Set

– Security Rule Set

– All Rule Set

규칙 세트 (Rule Set)

Page 18: Visual studio team system with agile tech days 2010

• 새롭게 추가된 Data Flow Rules– CA1062 ValidateArgumentsOfPublicMethods : 함수의 인자 유효성검사 여부

– CA1303 DoNotPassLiteralsAsLocalizedParameters : 문자열 인자의 Globalization

– CA2100 ReviewSqlQueriesForSecurityVulnerabilities : SQL Injection 취약점

– CA2202 DoNotDisposeObjectsMultipleTimes : Dispose를 여러 번 호출하는지

– CA2204 LiteralsShouldBeSpelledCorrectly : 스펠링

– CA2215 DisposeMethodsShouldCallBaseClassDispose : Base 클래스의 Dispose

를 호출하는지

– CA2241 ProvideCorrectArgumentsToFormattingMethods : Format 함수 인자

– CA2000 DisposeObjectsBeforeLosingScope : Dispose를 호출하는지

• 위에서 보는 것처럼, 복잡한 코드 상의 결함을 탐지하는

것이 많기 때문에, 아주 유용한 규칙들입니다.

New Data Flow Rules

Page 19: Visual studio team system with agile tech days 2010

• 새롭게 추가된 8개의 Data Flow 규칙들은 실제로

는 예전 VS 2005 에서 존재했던 규칙들입니다.

• 하지만, VS 2008에서는 성능 등의 문제가 발생하

면서 Data Flow 분석 엔진이 빠지면서, 같이 빠지

게 되었습니다.

• 이번 VSTS 2010에서는 새롭게 Data Flow 분석

엔진으로 Phoenix 프레임워크를 탑재하게 되면

서 다시 복귀하게 되었습니다.

New Data Flow Rules

Page 20: Visual studio team system with agile tech days 2010

• Phoenix Framework– 피닉스 프레임워크는 향후 마이크로소프트 컴파일러

기술을 위한 새로운 코드 최적화/분석 프레임워크입니

다.

• https://connect.microsoft.com/Phoenix

• http://research.microsoft.com/en-

us/collaboration/focus/cs/phoenix.aspx

– 피닉스 프레임워크의 탑재로, SQL Injection 취약점과

같은 파악하기 힘든 취약점들의 Review가 더 강화되었

습니다.

New Data Flow Rules

Page 21: Visual studio team system with agile tech days 2010

• Phoenix Framework

– 피닉스 프레임워크는 C++/CLI 기반으로 만들

어졌습니다.

– 피닉스 프레임워크를 통해서 할 수 있는 것들

• 컴파일러

• Code Generator, Code Optimizer

• 코드 리뷰와 같은 분석 툴

New Data Flow Rules