软件工程Basics
软件工程 is 一门研究such as何system地Development and maintenance软件 学科, 它将工程原理application于Software Development过程, 以improving软件quality, 降 low Development成本, 缩 short Development周期. 本章将介绍软件工程 basicconcepts, 发展history and coreprinciples, for after 续Learning打 under Basics.
1. 软件工程 定义
软件工程 定义 has many 种表述, 以 under is 一些权威机构 and 学者 定义:
- IEEE (电气电子工程师协会) : 软件工程 is 将system化, 规范化, 可量化 methodapplication于软件 Development, run and maintenance, 即将工程application于软件.
- ACM (计算机协会) : 软件工程 is for 了经济地获得 reliable and 能 in practical机器 on has 效run 软件, 而建立 and using完善 工程原理.
- ISO/IEC (国际标准化组织/国际电工委员会) : 软件工程 is applicationsystem化, 规范化, 可量化 method来Development, run and maintenance软件, 以及 for 这些method 研究.
软件工程 core要素
软件工程 core要素including:
- system化 method: 遵循一定 流程 and 规范
- 规范化 过程: 建立标准 Development流程
- 可量化 度量: using度量指标assessment软件quality
- 工程化 management: application工程managementmethod
2. 软件工程 发展history
软件工程 发展history可以分 for 以 under 几个阶段:
2.1 软件危机阶段 (1960s-1970s)
20世纪60年代, 随着计算机硬件 fast 速发展, 软件规模 and complexity急剧增加, 出现了所谓 "软件危机". 主要表现 for :
- Software Development成本 and 进度失控
- 软件quality low under , reliability差
- 软件maintenance difficult , maintenance成本 high
- 软件documentation不完善
2.2 软件工程concepts形成阶段 (1970s)
1968年, NATO (北 big 西洋公约组织) in 德国召开了第一次软件工程会议, 正式提出了"软件工程" concepts, 标志着软件工程学科 诞生. 此 after , 软件工程 basic原理 and method开始形成.
2.3 structure化method阶段 (1980s)
20世纪80年代, structure化method成 for 软件工程 主流method, includingstructure化analysis, structure化design and structure化programming. 这一阶段 主要特点 is :
- 强调自顶向 under , 逐步分解 designmethod
- usingdata流graph, structure化流程graphetc.tool
- 注重软件documentation 规范化
2.4 面向objectmethod阶段 (1990s)
20世纪90年代, 面向objectmethod逐渐取代structure化method, 成 for 软件工程 主流method. 这一阶段 主要特点 is :
- 强调以object for in心 designmethod
- usingUML (统一建模language) for建模
- 注重软件 reusability and 可maintenance性
2.5 agilemethod阶段 (2000s至今)
21世纪初, agilemethod开始兴起, 强调iterationDevelopment, fast 速response变化, 客户协作etc.value观. 这一阶段 主要特点 is :
- 强调iteration and 增量Development
- 注重客户反馈 and requirements变化
- 提倡团队协作 and communication
- 关注软件 practicalvalue and 交付速度
3. 软件工程 basicconcepts
3.1 软件
软件 is 计算机systemin and 硬件相互依存 另一部分, 它including:
- 程序: 按照一定 algorithms and 逻辑writing 指令序列
- data: 程序run所需 data and information
- documentation: and 程序相关 documentation and 说明
3.2 软件 classification
软件可以按照不同 标准forclassification:
| classification标准 | class型 | 例子 |
|---|---|---|
| functions | system软件 | operationsystem, 编译器, datalibrarymanagementsystem |
| functions | application软件 | 办公软件, 游戏, 网站 |
| functions | 支撑软件 | in间件, Developmenttool, testtool |
| 规模 | small 型软件 | 个人tool, small 程序 |
| 规模 | in型软件 | 企业managementsystem, 电商网站 |
| 规模 | big 型软件 | operationsystem, big 型企业application |
3.3 Software Development生命周期
Software Development生命周期 (Software Development Life Cycle, SDLC) is 指软件 from requirementsanalysis to 最终退役 整个过程, 通常including以 under 阶段:
- requirementsanalysis: 确定软件 functions, performance and otherrequirements
- design: design软件 architecture and 详细structure
- 编码: 根据designwritingcode
- test: test软件 functions and performance
- deployment: 将软件交付给userusing
- maintenance: for 软件formodify and update
3.4 软件工程 目标
软件工程 目标 is in 给定 时间, 成本 and quality约束 under , Development出满足userrequirements 软件产品. 具体including:
- high quality: 软件应具 has 正确性, reliability, security性, 可maintenance性etc.features
- Low Cost: 降 low Software Development and maintenance 成本
- 按时交付: 按照预定 时间交付软件
- 满足requirements: 满足user functions and 非functionsrequirements
- 可scale性: 软件应易于scale and modify
4. 软件工程 coreprinciples
软件工程 coreprinciples is 指导Software Development and maintenance basic准则, including:
4.1 abstraction
abstraction is 指 from 具体issuesin提取本质特征, ignore次要细节, from 而简化issues complexity. in 软件工程in, abstraction可以helpingDevelopment者更 good 地understanding and design软件system.
4.2 module化
module化 is 指将软件system分解 for 相互独立, functions单一 module, 每个module可以独立Development and test. module化可以improving软件 可maintenance性 and reusability.
4.3 information隐藏
information隐藏 is 指将module in 部implementation细节隐藏起来, 只暴露必要 interface. 这样可以reducingmodule之间 耦合, improving软件 可maintenance性.
4.4 关注点分离
关注点分离 is 指将软件systemin不同 关注点 (such as业务逻辑, data访问, user界面) 分开processing, 每个关注点由专门 module负责. 这样可以improving软件 可maintenance性 and 可test性.
4.5 consistency
consistency is 指 in Software Development过程in保持风格, 命名, design模式etc.方面 一致. 这样可以improvingcode readable 性 and 可maintenance性.
4.6 可追溯性
可追溯性 is 指软件 各个部分之间可以相互追溯, such asrequirements可以追溯 to design and code, test可以追溯 to requirements. 这样可以improving软件 quality and 可maintenance性.
软件工程 important 性
软件工程 important 性体现 in 以 under 几个方面:
- improving软件quality: throughsystem化 method and 规范 流程, improving软件 正确性, reliability and security性
- 降 low Development成本: through合理 planning and management, 降 low Software Development and maintenance 成本
- 缩 short Development周期: throughoptimizationDevelopment流程, 缩 short 软件 Development周期
- improving可maintenance性: through良 good design and documentation, improving软件 可maintenance性
- promoting团队协作: through标准化 method and tool, promotingDevelopment团队 协作
实践case: 软件工程 in 企业in application
case背景
某电商企业需要Development一个 new 电商平台, 该平台需要support商品展示, 购物车, 订单management, 支付etc.functions, 同时需要保证system reliability, security性 and performance.
软件工程method application
1. requirementsanalysis阶段
- and 业务部门communication, 收集userrequirements
- analysisrequirements 可行性 and priority
- writingrequirements规约documentation
2. design阶段
- designsystemarchitecture, including before 端, after 端, datalibraryetc.
- designdatalibrarystructure and APIinterface
- writingdesigndocumentation
3. 编码阶段
- 按照designdocumentationwritingcode
- 遵循编码规范 and best practices
- forcode审查
4. test阶段
- for单元test, 集成test and systemtest
- forperformancetest and securitytest
- 修复testin发现 issues
5. deployment阶段
- 准备deploymentenvironment
- deploymentsystem to produceenvironment
- for on 线test
6. maintenance阶段
- monitorsystemrunstatus
- 修复systemrunin发现 issues
- 根据业务requirementsforfunctionsupdate
case效果
throughapplication软件工程method, 该电商平台成功Development并 on 线, 具 has 以 under 特点:
- functions完整, 满足业务requirements
- system stable , run reliable
- performance良 good , response速度 fast
- security reliable , 保护userdata
- 易于maintenance and scale
互动练习
练习1: 软件工程conceptsunderstanding
请解释以 under concepts:
- 软件工程
- 软件危机
- Software Development生命周期
- module化
- information隐藏
练习2: 软件工程发展history
请简述软件工程 发展history, including各个阶段 主要特点 and 代表性method.
练习3: 软件工程principlesapplication
请举例说明such as何 in Software Developmentinapplication以 under 软件工程principles:
- abstraction
- module化
- 关注点分离
- consistency