🗺️ Project Planning & Dependencies项目规划与依赖管理

Build realistic delivery schedules, communicate blockers early, and visualise dependencies so multi-file codebases, npm libraries, and testing pipelines stay on track. 制定切实可行的交付时间表,提前沟通阻碍,并可视化依赖关系,确保多文件代码库、npm 依赖与测试流始终在线。

2. Project Planning and Dependencies 2. 项目规划与依赖关系

GANTT Charts Benefits 甘特图(GANTT Charts)

Visual Task Scheduling 可视化任务调度

Display iterations, milestones, and buffer so no deliverable sneaks up on the team. 清晰呈现迭代、里程碑与缓冲区,避免交付节点“偷袭”。

Dependency Communication 沟通依赖关系

Map out which stories unblock others and plan branch coordination. 标明哪个故事解锁其他任务,提前规划分支协作。

Progress Tracking 进度跟踪

Compare planned versus actual velocity and trigger scope trims when needed. 对比计划与实际速度,在需要时及时缩减范围。

Colour Coding 颜色编码

Use tones to differentiate design, implementation, testing, and review windows. 用颜色区分设计、实现、测试与评审时段。

Dependency Planning Strategy 依赖关系规划

  • Identify prerequisites: break the spec into atomic endpoints or modules (e.g. adminAuthRegister before adminUserDetails).识别前置条件:将规格拆为原子端点或模块,例如 adminAuthRegister 先于 adminUserDetails
  • Draw dependency graphs: convert lecture examples into arrows so circular chains surface early.画出依赖图:把讲义中的示例转为箭头关系,尽早识别循环依赖。
  • Parallelise safely: isolate work on separate branches with mocked data to avoid blocking tests.安全并行:使用独立分支与模拟数据并行开发,防止相互阻塞测试。
  • Integrate frequently: merge after small increments so conflicts stay manageable.频繁集成:每完成小增量就合并,保持冲突可控。

From Spec to Timeline 从规格到时间线

Start with the course-supplied iteration checklist, then apply the lecture’s “plan for dependencies” mantra. Group endpoints that share infrastructure (e.g. authentication, quiz lifecycle) and colour the GANTT chart by responsibility so ownership is obvious. 先使用课程提供的迭代清单,再落实“规划依赖”的理念。把共享基础设施的端点归类(如认证、测验流程),在甘特图中按负责人上色,让所有权一目了然。

Workflow 工作流

  • Translate user stories into deliverables with clear “definition of done”.将用户故事转化为具有明确“完成定义”的交付物。
  • Estimate effort in hours, not days, to highlight imbalances sooner.用小时而非天估算工作量,更快发现负载不均。
  • Reserve buffer before demos or mentor check-ins for integration/testing.在演示或导师检查前预留缓冲时间,用于集成与测试。

Artefacts to Produce 需产出的资料

  • Iteration plan document referencing your dependency graph.引用依赖图的迭代计划文档。
  • Shared calendar with milestone reminders and stand-up cadence.包含里程碑与站会节奏的共享日历。
  • Risk register noting package upgrades, API changes, or testing gaps.记录依赖升级、API 变更或测试缺口的风险清单。

Technical Dependencies: Code, Packages, Tests 技术依赖:代码、包与测试

Lecture 2.2 (Multi-file & Importing) reminds us that modern features rarely live in a single file. When planning, capture which modules export shared utilities and which tests need mocks. Link these notes directly into your meeting minutes and task board. 《多文件与导入》讲座指出现代功能很少存在于单一文件里。规划时要记录哪些模块导出通用函数、哪些测试需要 mock,并把这些说明连接到会议记录与任务板中。

  • Document import relationships so reviewers know when renaming a function impacts other files.记录 import 关系,帮助评审了解重命名函数会影响哪些文件。
  • Schedule npm tasks (Lecture 2.3) such as npm init, dependency installation, and script authoring early in Iteration 0.在第 0 次迭代早期安排 npm 相关工作(如 npm init、安装依赖、编写脚本)。
  • Pair plan testing milestones with dynamic verification (Lecture 3.3) so new features include Jest suites before release.将测试里程碑与《动态验证》讲座结合,在发布新功能前写好 Jest 用例。

Explicitly noting library versions, module boundaries, and test coverage in your plan prevents “hidden” dependencies from derailing delivery when teammates merge work late in the cycle. 在计划中明确记录库版本、模块边界与测试覆盖度,避免同伴在周期末合并代码时,被“隐形”依赖拖慢进度。

Module Architecture & Import Strategy (Lecture 2.2) 模块架构与导入策略(讲座 2.2)

Document multi-file design decisions so teammates know how modules interact before implementation. Note which files export utilities, which rely on named imports, and where aliases are required to avoid collisions. 在实现前写下多文件设计决定,帮助团队了解模块如何协同。记录每个文件导出的工具、哪些地方需要命名导入,以及为了避免冲突必须使用别名的场景。

Default vs Named Exports 默认导出与命名导出

Lecture 2.2 shows how default exports differ from named exports. Capture the contract in planning docs so consumers know whether to write import util from './file.js' or import { util }. 讲座 2.2 展示了默认导出与命名导出的差异。把约定写进规划文档,让调用方明确是写 import util from './file.js' 还是 import { util }

// lib.js
function addBrackets(string) {
  return `(${string})`;
}
function manyString(repeat, str) {
  let out = '';
  for (let i = 0; i < repeat; i++) {
    out += str;
  }
  return out;
}
export { addBrackets, manyString };

Alias & Re-export Decisions 别名与再导出决策

If two modules expose similar names, plan the aliasing strategy (e.g. import { sum as simpleSum }) and assign an owner to maintain the shared import registry. 若多个模块导出的名称相似,提前规划别名策略(如 import { sum as simpleSum }),并指定负责人维护共享导入登记。

  • Flag files that re-export helpers for tests to avoid circular dependencies.标记会为测试重新导出工具的文件,防止循环依赖。
  • Budget integration time when refactors change export signatures.重构导致导出签名变化时,在计划中预留集成缓冲。
  • Track module owners so questions about import chains have a clear contact.记录模块负责人,导入链有问题时能快速找到联系人。

Risk & Communication Cadence 风险与沟通节奏

A plan only works when coupled with regular communication. Combine weekly status meetings with twice-weekly stand-ups to keep the GANTT chart honest. Use the “always set deadlines” mindset to attach dates to every dependency hand-off. 只有配合规律沟通,计划才能落地。把每周状态会与每周两次站会结合,确保甘特图真实可信;用“总是设定截止时间”的思路,为每一次依赖交接附上日期。

  • Log schedule risks in your minutes and escalate early to tutors when slippage exceeds one stand-up cycle.在会议纪要中记录进度风险,若延误超过一个站会周期,就及时向导师升级。
  • Sync task board lanes with planned stages (Design → Build → Test → Review) so visual cues match the roadmap.让任务板的泳道与计划阶段(设计→开发→测试→评审)同步,保证视觉线索与路线图一致。
  • Celebrate completed milestones to reinforce motivation and continuous improvement.庆祝完成的里程碑,强化团队动力与持续改进意识。