敏捷软件开发
字数: 0
Agile Software Development

敏捷方法

人为核心、迭代、增量的开发方法。每个增量一般都比较小,通常每两三个星期就会创建系统的新版本并提供给用户使用。
notion image
notion image
《敏捷宣言》官方共有 4 个核心价值观与 12 条原则 (http://agilemanifesto.org/)
《敏捷宣言》官方共有 4 个核心价值观与 12 条原则 (http://agilemanifesto.org/)

敏捷价值观

  • 个体和互动 高于 流程和工具
  • 工作的软件 高于 详尽的文档
  • 客户合作 高于 合同谈判
  • 响应变化 高于 遵循计划
notion image

敏捷原则

  • 客户合作:业务人员应该和开发人员紧密合作,提供对系统的需求和改进建议
  • 拥抱改变:欣然面对需求变化,并对计划作出迅速调整
  • 持续交付:及早交付有价值的软件使客户满意
  • 保持简洁:减少不必要工作量
  • (注重)人,而不是过程:信任团队成员,要有团队节奏

敏捷方法的实际问题

不适合嵌入式系统工程或大型复杂系统的开发
  • 敏捷方法的非正式性 (informality) 与大型企业中常用的合同问题不相容 。
  • 敏捷方法通常用于新软件系统的开发,而不是软件维护。
  • 敏捷方法是为小型团队设计的。对于具有多个地理分布团队的大型项目,管理和协调复杂性显著增加。

极限编程

eXtreme Programming, XP
notion image
 
右边图示说明了一个 XP 过程,它产生了正在开发的系统的一个增量。
  • 用户故事是敏捷框架中最小的离散工作 (the smallest discrete piece of work)
notion image
Who decides on the velocity?
Tracker tracks the iteration, the testing for acceptance, the code quality, customer management, etc.

XP 价值观

XP Values
  • Courage:成员客观地评估自己的失误造成的后果而不是找借口,并且随时准备应对变化。
  • Communication:团队中的每个人都互通工作。
  • Feedback:团队成员经常交付软件,获取有关软件的反馈,并根据新的需求改进产品。
  • Respect:每个被分配到项目中的人都为一个共同的目标做出贡献。
  • Simplicity:开发人员编写简单的代码,为产品带来更多价值。

XP 原则

XP Principles
  • Accepted Responsibility
    • the commitment made by the team members to take ownership of their work and deliver high-quality software
    • Responsibility cannot be assigned; it can only be accepted
  • Baby Step (把一项艰巨的任务简化成小步骤)
  • Diversity (开发者们应集思广益,work together on the problem)
  • Economics
    • time + money
  • Flow(连续的活动流而不是离散的阶段,small increments and continuous integration)
  • Failure (越挫越勇)
    • If you have 3 ways to implement a user story, but you don’t know which to use, try all of them.
    • “I have not failed. I've just found 10,000 ways that won't work.” —— Edison
  • Humanity(平衡团队和个体之间的需求)
  • Improvement (Refine the activity results over time)
  • Mutual Benefit
    • Every activity should benefit all concerned
  • Opportunity (Seeing problems as opportunities for changes (personal growth, deepening relationships, and improved software))
  • Quality
  • Reflection
  • Redundancy (多角度解决问题;Difficult problems in software development should be solved in several different ways.)
  • Self-Similarity (复用;Use the structure of one solution into a new context, even at different scales)
    • notion image
      Done is better than perfect ✔️ (It’s a good place to start)

XP 工作流程

以及对应的实践 (XP Practices)
notion image
notion image
notion image
 
  • Continuous Integration 持续集成
    • 提倡集成系统多次,而且随着需求的改变,要不断的进行回归测试。使得团队保持一个较高的开发速度,同时避免了一次系统集成的恶梦。
  • Energized Work
  • Incremental Design
    • Make small safe design improvements every day.
  • Informative Workspace
  • Pair Programming 结对编程
    • 由两个开发人员在同一台电脑上共同编写解决同一问题的代码,通常一个人负责写编码,而另一个负责保证代码的正确性与可读性。
  • Sit Together
  • Slack
    • 在进度落后时可以放弃的任务
    • Some minor / low-priority tasks that can be dropped if you get behind and needed to meet overall commitments.
    • (2021 Final Exam) In eXtreme Programming (XP), what are slack tasks? Explain why we need them.
      • Why: They provide some flexibility and room in the face of unexpected issues or delays, thus promoting a sustainable and healthy work environment for the development team.
  • Stories
    • 程序员如果无法理解 topic,则去 reasearch 然后 initial a Spike
      • a Spike is a exploratory development activity that is used to research the uncertainty in the project.
      • a spike is a skinny, minimal solution in throw-away code. The result of a spike is enough knowledge to attempt an estimate.
      • Spikes are necessary in XP because they help teams deal with complexity.
    • 如果故事太大,产品经理则 split stories into small tasks
  • Ten-Minute Build
    • Automatically build the whole system and run all of the tests in ten minutes
  • Test-First Programming
    • Write a failing automated test before changing any code.
  • Weekly Cycle
    • the name for an iteration in XP
    • It is a planning and feedback loop that helps to ensure that the project is moving forward at a sustainable pace.
    • 总结上一个周期的进展 ➡️ 为新周期选择新的 stories ➡️ 分配具体任务给团队成员
  • Quarterly Cycle
    • a longer-term planning process
    • keep the detailed work of each weekly cycle in context of the overall product
    • 关注于更大视角 (the big picture),解决瓶颈 (bottlenecks),决定季度周期的大局 (theme)
  • Whole Team

Scrum 框架

XP 注重技术实践和代码质量,Scrum 则注重开发过程中的协调和管理。

Scrum 支柱

Scrum Pillars
notion image
  • 透明度:在软件开发过程的各个环节保持高度的可见性
    • Process must be visible to all team members.
    • Use common language and share a common definition.
  • 检查:开发过程必须做到足够频繁地检验,确保能够及时发现过程中的重大偏差。
    • Scrum artifacts and progress must be inspected frequently without interfering team’s work.
  • 适应性:接受和适应变化,并不断改进
    • If a process or development deviates outside the plan, adjustment must be made in time.

Scrum 角色

  • 产品所有者(Product Owner)
  • 开发团队(Development Team)
  • Scrum 大师(Master)
    • 指导项目组的成员按照 Scrum 的原则做事,组织各种 Scrum 会议
      • Planning Scrum implementations to help the team to understand the project
      • Facilitating events and removing impediments
    • 不是项目经理,没有分配任务的权力

Scrum 价值观

  • Courage
  • Commitment
  • Focus
  • Respect
  • Openness

Scrum 规则

Rules bind all components together
  • Work together as a self-organizing team
  • The quality of the goals can NOT be affected
  • Sprint goal can NOT be changed
    • 💡
      XP 在一个迭代中,如果一个 User Story 还没实现,则可以考虑用另外的需求将其替换,而 Scrum 是不允许这样做的。
    • Only the Product Owner can cancel the Sprint
    • 在下列情况下,一个 Sprint 可以被取消
    • The Sprint goal becomes obsolete (淘汰的,Outdated)
    • In unexpected situations, e.g., an important team member has left
    • A much higher priority task comes in and requested by senior management
  • A Sprint can NOT be shortened
  • A Sprint should NOT be longer than a month

Scrum 事件

Scrum Events
notion image
项目愿景
Vision:它阐明了项目的目标,是项目的灵感,为项目提供重点:
  • 本软件系统面向什么用户?
  • 它解决什么问题?
  • ……
代办事项梳理
Product Backlog Refinement meeting:根据产品需求确定 Product Backlog
notion image

Sprint

在 Scrum 框架中,庞大且复杂的产品将被拆分成一个个小的片段,通过一系列被称为 Sprint 的迭代来完成,即 Scrum 团队完成一定数量工作所需的短暂、固定的周期。它使项目更易于管理,让团队更快、更频繁地交付高质量的工作。
  • The short duration of Sprints limits the risk to small cost.

Sprint 计划

Sprint Planning meeting:计划会议
团队计划下一个 Sprint 要完成的工作

每日 Scrum

Daily Scrum meeting:每日站会,最长十五分钟 (How long: 15 minutes max)
团队成员分享进展和协调下一步的行动
➡️ 会议最后产出 an informal plan for the next day

Sprint 评审

Sprint Review meeting:评审会议
  • (How long: Maximum 4 hours for a one-month Sprint)

当一个 Story 完成,也就是 Sprint Backlog 被完成,也就表示一次 Sprint 完成,这时 (at the end of the Sprint) 要进行评审会议
Scrum 团队在会议中
  • 审查什么是接下来最有价值的事情
  • 展示目前在 Sprint 中完成的工作,并接收反馈和评审
➡️ 会议最后产出 a revised Product Backlog

Sprint 回顾

Sprint Retrospective meeting:回顾会议
也称为总结会议,每个人总结并讨论改进的地方,并放入下一轮 Sprint 的产品需求
  • A new Sprint starts immediately after the retrospective of the previous Sprint.

Scrum 工件

Scrum Artifacts
Product Backlog
Sprint Backlog
详细度
比较详细
非常详细
文档归属
Product Owner
Development Team
持续长度
整个项目周期
一个 Sprint

产品待办事项

Product Backlog
  • 根据初始需求分解出的任务列表,包括功能性和非功能性的所有功能
  • 由 Product Owner 为 Product Backlog 中的任务确定优先级别,后期再由 Development Team 精确评估和分解任务。

冲刺待办事项

Sprint Backlog相当于一组为当前 Sprint 周期选出的 Product Backlog (?
notion image

燃尽图

Burndown Chart:监控和管理 Sprint Backlog 的工具
notion image

DevOps

开发运维一体化:开发(development)和运维(operations)的结合
📎
参考资料https://zhuanlan.zhihu.com/p/91371659
可以看作是敏捷开发的升级版 (?)
  • 敏捷开发强调开发、测试一起搞
  • Devops 强调开发、测试、部署运维一起搞
notion image
notion image
notion image
将 DevOps 用于软件开发的主要驱动因素
  • have fewer requirements changes
  • create a stronger focus on testing and quality assurance
  • achieve a much faster delivery cycle
💡 DevOps 尽可能依赖于自动化工具
2023 - 2026