Chapter 7: Software Engineering
Chapter 7: Software Engineering 7.1 The Software Engineering Discipline 7.2 The Software Life Cycle 7.3 Software Engineering Methodologies 7.4 Modularity 7.5 Tools of the Trade 7.6 Testing 7.7 Documentation 7.8 Software Ownership and Liability 7-2
The Software Engineering Discipline 대규모의복잡한소프트웨어시스템의개발에지침이되는원리들을모색하는컴퓨터과학의한분야 Distinct from other engineering fields Prefabricated components Metrics ( 정량적기법 ) 7-3
소프트웨어공학 실용연구자 바로응용될수있는기법의개발 이론연구자 보다안정된기법들을구축하는데토대가될기초원리와이론들을모색 전문가단체 : ACM, IEEE 등등 전문가윤리강령 표준 2007 Pearson Addison-Wesley. 0-4All rights reserved
Computer Aided Software Engineering (CASE) tools Project planning Project management Documentation Prototyping and simulation Interface design Programming IDE (Integrated Development Environment) 7-5
Figure 7.1 The software life cycle - 개발단계의약간의추가노력이변경단계의큰도움이될수있다. 7-6
Figure 7.2 The development phase of the software life cycle 요구사항분석설계구현테스트 7-7
Analysis Stage ( 요구사항분석단계 ) 목표 : 서비스의규정, 조건의식별, 외부와의상호작용의정의등 이해관계자들의요구사항조사를포함 Requirements Application oriented Specifications Technically oriented Software requirements document S/W 요구사항명세 개발의방향이될확고한목표의정의 7-8
Design Stage 제안시스템의구축을위한계획의수립단계 문제의정의 /What: 요구사항분석 문제의해답 /How: 설계 방법론과도구 ( 추후논의 ) 휴먼인터페이스 ( 심리학과인간공학 ) 7-9
Implementation Stage Create system from design Write programs Create data files Develop databases 7-10
Implementation Stage Role of software analyst versus programmer 소프트웨어분석가 전체개발과정에관련 요구사항명세, 설계 프로그래머 구현 7-11
Testing Stage Validation ( 검증 ) testing Confirm that system meets specifications Defect ( 결함 ) testing Find bugs 각단계에서테스트는중요한역할 요구사항명세와확인 설계와검증 구현과테스트 오류제거 : 소프트웨어공학의목표중하나 7-12
Software Engineering Methodologies Waterfall Model Incremental Model Prototyping (Evolutionary vs. Throwaway) Open-source Development Extreme Programming 7-13
소프트웨어공학방법론 폭포수 (waterfall) 모델 한쪽방향으로만진행 점진적 (incremental) 모델 시행착오과정을통한모순의극복 진화적프로토타이핑 단순버전 => 테스트와점진적기능추가의반복 반복형 (iterative) 모델 각버전의재구축 폐기형프로토타이핑 (e.g. 단기프로토타이핑 ) 2007 Pearson Addison-Wesley. 0-14All rights reserved
소프트웨어공학방법론 공개소스개발 점진형 / 반복형의비정형적변형 기민성방법 : e.g. XP(eXtreme Programming) 공통의공간을이용하는소수의개발자 비정형적요구사항명세, 설계, 구현, 테스트를반복 폭포수모델과대조적 DevOps 2007 Pearson Addison-Wesley. 0-15All rights reserved
Modularity 소프트웨어를관리하기쉬운모듈이라는단위로분할. 각모듈은전체기능중특정부분만을담당. Functions/Procedure - Imperative paradigm Structure charts Objects - Object-oriented paradigm Collaboration diagrams Components - Component architecture 7-16
Figure 7.3 A simple structure chart 7-17
Figure 7.4 The structure of PlayerClass and its instances 7-18
Figure 7.5 The interaction between objects resulting from PlayerA s serve 7-19
모듈화 모듈사이의독립성의극대화 / 모듈간결합도 (intermodule coupling) ( 모듈사이의연결도 ) 의최소화 2007 Pearson Addison-Wesley. 0-20All rights reserved
정보은닉 (Information Hiding) 정보를소프트웨어의특정부분에서만이용될수있도록제한시키는것 모듈은다른모듈이그내부정보에접근할필요가없도록설계 : 설계목표 응집도의최대화와결합도의최소화 모듈간의경계를확실히지킬수있도록구현 지역변수, 캡슐화, 잘정의된제어구조의사용등 2007 Pearson Addison-Wesley. 0-21All rights reserved
결합과응집 결합 (coupling) 제어결합 : 프로시저호출. 실행제어의전달시발생 데이터결합 : 모듈사이의데이터의공유 ( 매개변수 or 전역변수 ) 2007 Pearson Addison-Wesley. 0-22All rights reserved
Figure 7.6 A structure chart including data coupling 7-23
결합과응집 응집 (cohesion): 각모듈의내부연결성, 내부부분들사이의연관성정도 논리적응집 : 성질상논리적으로비슷한활동. 객체단위의특징 기능적응집 : 한모듈안의모든부분은한가지활동의수행에초점. 객체내의각메쏘드 2007 Pearson Addison-Wesley. 0-24All rights reserved
Figure 7.7 Logical and functional cohesion within an object 7-25
Tools of the Trade Data Flow Diagram 데이터경로, 데이터소스, 데이터저장소 프로시저의식별 고객과소프트웨어엔지니어사이의의사소통개선 Entity-Relationship Diagram One-to-one relation One-to-many relation Many-to-many relation Data Dictionary 소프트웨어시스템에나타나는데이터항목들에관한정보의중앙저장소 소프트웨어엔지니어사이의의사소통의개선 시스템전체에걸쳐일관성을확보 7-26
Figure 7.8 A simple dataflow diagram 7-27
Unified Modeling Language Use Case ( 용례 ) Diagram Use cases ( 용례 ) Actors ( 행위자 ) Class Diagram 7-28
Figure 7.9 A simple use case diagram 7-29
Figure 7.10 A simple class diagram 7-30
Figure 7.11 One-to-one, one-to-many, and many-to-many relationships between entities of types X and Y 7-31
Figure 7.12 A class diagram depicting generalizations 7-32
상호작용다이어그램 (interaction diagram) 클래스다이어그램 : 설계의정적인기능표현 상호작용다이어그램 실행동안발생하는이벤트들의진행순서를포함하는동적기능의표현 진행순서다이어그램 (sequence diagram) 생명선, 프레임, 상호작용구절 (interaction fragment) 등 2007 Pearson Addison-Wesley. 0-33All rights reserved
Figure 7.13 A sequence diagram depicting a generic volley 7-34
Structured Walkthoughs Theatrical experiment Class-responsibility-collaboration cards 각객체마다한장의카드 구조적예행연습에활용 객체지향설계의검증 7-35
Design Patterns Well designed templates for solving recurring problems Examples: Adapter pattern: Used to adapter a module s interface to current needs Decorator pattern: Used to control the complexity involved when many different combinations of the same activities are required Inspired by the work of Christopher Alexander in architecture 7-36
Software Testing Strategies 유리박스테스트 : 내부구성에대한지식전제 Pareto 원리 : 소수의인구가대부분의부를통제 소수의모듈이대부분의모듈보다더많은문제보유 집중된테스트를통하여더많은오류의발견 기초경로테스트 (basis path testing) 모든명령이최소한번씩은수행되는테스트데이터집합의개발 블랙박스테스트 경계값분석 비슷한성능을보이는데이터범위를일컫는동치클래스의식별 범위의가장자리에가까운데이터들에대한테스트 베타테스트 7-37
Documentation User Documentation Printed book for all customers On-line help modules System Documentation Source code Design documents Technical Documentation For installing, customizing, updating, etc. 7-38
Software Ownership Copyright Allow a product to be released while retaining ownership of intellectual property Asserted in all works: Specifications Source code Final product 7-39
Software Ownership (continued) Software License A legal agreement that grants the user certain permissions without transferring ownership Patents Must demonstrate that it is new, usable, and not obvious to others with similar backgrounds Process is expensive and time-consuming 7-40
소프트웨어소유권 저작권 (copyright) 상당한유사성 테스트 필터링기준 : 저작권이인정되지않는것 표준에정해져있는특성 소프트웨어의목적에의해도출되는특성 공적영역의컴포넌트 외관과촉감 (look and feel) 논쟁 2007 Pearson Addison-Wesley. 0-41All rights reserved
소프트웨어소유권 ( 계속 ) 특허 (patent) 자연법칙 은전통적으로특허대상이아님 새롭고, 유용하며, 비슷한배경을가진다른사람들의입장에서단순하고당연한것이아니라는것을증빙 출원일로부터 20 년간보호 영업비밀 (trade secret) 비밀준수서약서는법률적효력이있다 2007 Pearson Addison-Wesley. 0-42All rights reserved
End of Chapter