双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

EE308_Extreme Programming Assignment_Zhengyang Wu (FZU ID: 832402223 / MU ID: 24127167)

832402223吴正杨 832402223吴正杨 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

EE308 Extreme Programming: Development, Validation and Testing of PairBook's Multiple Contact Methods Module

Assignment Information

ItemDescription
Course for This AssignmentSoftware Engineering (FZU–MU)
Team NamePairBook
Assignment RequirementsExtreme Programming Assignment
Objectives of This AssignmentDevelop a contact management application through collaboration, focusing on reusable components, multiple contact methods, input validation, automated testing, and GitHub integration.
Other ReferencesProject Repository, Component Contract, Coding Standards

Student Name: Zhengyang Wu

MU ID: 24127167

FZU ID: 832402223

Pair Partner: Quanyan Tan

Partner MU ID: 24125563

Partner FZU ID: 832402218

My Contribution: 40%

目录

  • EE308 Extreme Programming: Development, Validation and Testing of PairBook's Multiple Contact Methods Module
  • Assignment Information
  • 1. Project Introduction
  • 1.1 Background
  • 1.2 My Responsibilities
  • 1.3 Final Application
  • 2. Requirement Analysis and Component Design
  • 2.1 Multiple Contact Methods
  • 2.2 Shared Component Contract
  • 2.3 Design Objectives
  • 3. Component Implementation
  • 3.1 Adding Contact Methods
  • 3.2 Editing Existing Entries
  • 3.3 Deleting a Method
  • 3.4 Managing Unsaved Changes
  • 4. Contact Method Validation
  • 4.1 Independent Validation Utility
  • 4.2 Validation Rules
  • 4.3 Invalid Input Handling
  • 5. Automated Testing
  • 5.1 Test Framework
  • 5.2 Validation Tests
  • 5.3 Component Interaction Tests
  • 5.4 Integration Test Results
  • 6. Responsive Design
  • 7. GitHub Collaboration
  • 7.1 Branch-Based Workflow
  • 7.2 My Git Commits
  • 7.3 Pull Request
  • 8. Collaboration Challenges and Solutions
  • 8.1 Interface Compatibility
  • 8.2 Avoiding Direct Data Mutation
  • 8.3 Form Submission Conflicts
  • 8.4 Visual Consistency
  • 9. Final Application Features
  • 9.1 Bookmark Contacts
  • 9.2 Excel Export
  • 9.3 Excel Import
  • 10. Release and Cloud Deployment
  • 11. Complete Running Video
  • 12. Team Contribution and PSP
  • 12.1 Contribution Assessment
  • 12.2 My PSP
  • 12.3 Partner's PSP
  • 13. Personal Reflection
  • References

1. Project Introduction

1.1 Background

For our EE308 Extreme Programming assignment, the PairBook team developed a responsive contact management web application.

The required features included contact bookmarking, multiple contact methods for the same person, and Excel import/export.

Our final application also supports contact creation, editing, deletion, search, browser persistence, and cloud deployment.

GitHub Repository: https://github.com/quanyantan-svg/ee308-xp-contactbook

Online Application: http://129.204.51.149:18088/

GitHub Release: https://github.com/quanyantan-svg/ee308-xp-contactbook/releases/tag/v1.0.0

1.2 My Responsibilities

My main contribution was the design, implementation, and testing of the Multiple Contact Methods module.

The module allows each contact to have several phone numbers, email addresses, social accounts, physical addresses, or other contact methods.

I was responsible for the following files:

FileResponsibility
ContactMethodsEditor.vueMultiple contact-method editing component
contactValidation.tsInput validation utilities
contactValidation.test.tsValidation unit tests
ContactMethodsEditor.test.tsComponent interaction tests
package.jsonTest command configuration

The main developer implemented the contact management workflow, favorites, local storage, Excel features, integration, and deployment.

By separating responsibilities, we were able to develop dependent modules using a shared interface without editing the same source files simultaneously.

1.3 Final Application

PairBook presents contact information through a responsive card-based interface.

img

Figure 1. PairBook's main interface displaying three fictional demonstration contacts.

2. Requirement Analysis and Component Design

2.1 Multiple Contact Methods

A contact may have several phone numbers or email addresses.

Using only one fixed phone field and one fixed email field would not satisfy this requirement.

Therefore, our shared data model uses a ContactMethod[] array.

type ContactMethodType =
  | 'phone'
  | 'email'
  | 'social'
  | 'address'
  | 'other'

interface ContactMethod {
  id: string
  type: ContactMethodType
  label: string
  value: string
}

Each method has a stable identifier, a type, a label, and a value.

For example, a contact may have one primary phone, one backup phone, and one personal email.

This approach is flexible and can be extended without changing the overall Contact structure.

2.2 Shared Component Contract

Before independent development, we used a shared component contract to define the editor's public interface.

The editor follows Vue's standard v-model convention.

const props = withDefaults(
  defineProps<{
    modelValue: ContactMethod[]
    disabled?: boolean
  }>(),
  {
    disabled: false,
  },
)

const emit = defineEmits<{
  'update:modelValue': [methods: ContactMethod[]]
}>()

The editor receives the current method list through modelValue and emits an updated list when the user confirms a valid operation.

The optional disabled property prevents modifications when required.

This interface keeps the editor independent of contact storage and Excel processing.

2.3 Design Objectives

The editor was designed to meet the following objectives:

  • Support multiple entries of the same contact-method type.
  • Preserve stable method IDs during editing.
  • Avoid directly mutating input Props.
  • Validate fields before accepting changes.
  • Maintain the order of existing methods.
  • Keep unsaved edits separate from confirmed data.
  • Support narrow-screen layouts.

These objectives guided both implementation and automated testing.

3. Component Implementation

3.1 Adding Contact Methods

The user selects a method type, enters a label, and provides a value.

After validation succeeds, the editor creates a new method with a unique ID and emits an updated array.

For example:

emit('update:modelValue', [...props.modelValue, method])

The spread operation creates a new array rather than directly changing the input list.

img

Figure 2. Adding two phone numbers and one email address through the contact-method editor.

This screenshot demonstrates the required multiple contact methods feature in the integrated application.

3.2 Editing Existing Entries

When editing begins, the component copies the selected method's values into a local draft.

The original method remains unchanged until the edit is confirmed.

After successful validation, the component replaces only the selected method, preserving its ID and position in the list.

img

Figure 3. Editing an existing contact with four stored contact methods.

The screenshot shows the editor reopening an existing contact and correctly displaying its saved methods.

3.3 Deleting a Method

Deletion is based on the method's unique ID.

The editor removes the matching entry while preserving all other methods.

This avoids unintended changes to unrelated phone numbers, email addresses, or social accounts.

3.4 Managing Unsaved Changes

The editor maintains separate drafts for adding and editing methods.

A user may cancel editing without changing the confirmed method list.

This is important because the parent form manages the entire contact, while the child editor is responsible only for local method changes.

4. Contact Method Validation

4.1 Independent Validation Utility

Input validation is implemented in contactValidation.ts.

Separating validation from the Vue component makes the rules reusable and easier to test.

The module defines field-specific validation errors:

interface ContactMethodValidationErrors {
  type?: string
  label?: string
  value?: string
}

An empty error object indicates that a method passed validation.

4.2 Validation Rules

Method TypeValidation Rule
PhoneAt least seven digits and only permitted formatting characters
EmailValid practical email address format
SocialNon-empty label and value
AddressNon-empty label and value
OtherNon-empty label and value

The method type must also be one of the five supported categories.

4.3 Invalid Input Handling

Invalid values do not produce a successful method update.

For example, a malformed email generates an error message, and the user must correct the value before saving.

The validation utility is designed not to mutate the object being checked.

5. Automated Testing

5.1 Test Framework

The project uses Vitest, Vue Test Utils, and jsdom.

My tests focused on validating the component's actual behavior and data updates.

5.2 Validation Tests

contactValidation.test.ts verifies:

  • Supported and unsupported method types.
  • Empty labels and values.
  • Valid and invalid email addresses.
  • Phone-number digit boundaries.
  • Valid formatting characters.
  • Input immutability.

These tests can be executed without mounting the Vue component because the validation functions are independent.

5.3 Component Interaction Tests

ContactMethodsEditor.test.ts verifies the editor's user interactions.

Test ScenarioExpected Result
Display existing methodsPreserve order and field values
Add a valid methodEmit a new method array
Add repeated phone entriesGenerate distinct IDs
Edit an existing methodPreserve its original ID
Cancel an editKeep confirmed data unchanged
Delete one methodPreserve unrelated entries
Submit invalid informationDisplay errors and reject the update
Activate disabled modePrevent modifications
Use frozen input objectsAvoid direct mutation

One important test technique was freezing the input data to detect unexpected mutations.

This helped verify that the component followed Vue's one-way data-flow principles.

5.4 Integration Test Results

After the independently developed module was merged into the main application, the complete project was tested.

The Phase C report recorded:

CheckResult
Test files7 passed
Test cases69 passed
TypeScript checkingPassed
Production buildPassed

These are project-wide results, not only the tests belonging to my module.

The integration tests additionally checked that individual method submissions would not trigger the parent contact form, that cancelled edits would not persist, and that multiple contact methods could survive an Excel export/import round trip.

6. Responsive Design

The component was designed to support both desktop and mobile interfaces.

The method list, form fields, and operation buttons adapt to narrow viewports.

A real browser screenshot was captured at 390 × 844.

img

Figure 4. Multiple contact methods editor displayed on a mobile viewport.

This screenshot helps verify that the independently developed editor is usable within the main application's responsive form.

7. GitHub Collaboration

7.1 Branch-Based Workflow

The project used separate feature branches.

My development branch was:

feature/contact-methods-editor

The main developer worked on:

feature/core-and-excel

We followed the same data model and coding standards while implementing our respective modules.

7.2 My Git Commits

The Git history contains five direct commits associated with my module.

CommitDescription
a0963a8Add contact-method validation utilities
935e81eAdd validation boundary tests
078e8b6Implement multiple contact methods editor
306c6b4Add component interaction tests
bc23172Add a standard Vitest run script

These commits demonstrate separate development steps for implementation, validation, testing, and configuration.

img

Figure 5. PairBook's commit history, including the independently developed contact-method module.

7.3 Pull Request

My work was submitted through:

PR #1 — Contact Method Editor with Validation and Tests

The Pull Request was merged into main.

The main application and integration work were subsequently merged through:

PR #2 — Core Application and Excel

img

Figure 6. GitHub Pull Requests showing the integration of both contributors' work.

The full release history contains 13 commits, including 10 direct development or documentation commits and 3 merge commits.

Commit counts are used to demonstrate participation, but our contribution assessment also considers task scope, complexity, and testing responsibilities.

8. Collaboration Challenges and Solutions

8.1 Interface Compatibility

Problem: The editor and the main contact form were developed separately. Differences in data structures or update events could prevent integration.

Solution: We agreed on shared TypeScript interfaces and documented the editor's Props and Events before implementation.

Lesson: Stable interfaces help independent modules integrate with fewer changes.

8.2 Avoiding Direct Data Mutation

Problem: Modifying Props directly could cause a cancelled edit to change the original contact unexpectedly.

Solution: The editor uses separate drafts and emits newly created arrays and objects when changes are confirmed.

Lesson: Clear state ownership improves predictability and testability.

8.3 Form Submission Conflicts

Problem: Both the parent contact form and the child editor contained form interactions.

Solution: During integration, the parent and child forms were organized separately, preventing accidental submissions caused by nested HTML forms.

Lesson: Component tests must be supplemented with end-to-end workflow and integration tests.

8.4 Visual Consistency

Problem: The independently developed editor used CSS variable names that differed from those in the main application.

Solution: A compatibility mapping was added during integration to align the component's appearance with the overall PairBook interface.

Lesson: Shared coding standards should also address design tokens and UI conventions.

9. Final Application Features

Although my primary responsibility was the contact-method editor, the final product includes all the required assignment features.

9.1 Bookmark Contacts

Users can bookmark important contacts and filter the list to show favorites only.

img

Figure 7. Favorites-only filtering in the integrated PairBook application.

9.2 Excel Export

The main developer implemented Excel export using ExcelJS.

The exported workbook preserves one contact per row and dynamically expands multiple contact methods into separate column groups.

img

Figure 8. Exporting the address book to an Excel workbook.

9.3 Excel Import

The application validates imported records, previews conflicts, and applies confirmed changes.

img

Figure 9. Excel import preview showing valid records and existing ID conflicts.

img

Figure 10. Restoring three demonstration contacts in a separate browser environment.

These screenshots show the integrated application rather than only my independently developed module.

10. Release and Cloud Deployment

The team published the final version as:

PairBook v1.0.0 — Initial Release

The application is available through the Tencent Cloud deployment:

http://129.204.51.149:18088/

The server hosts the frontend application. Each browser maintains its own contact collection in local storage.

There is no backend account system or cross-device synchronization in this version.

11. Complete Running Video

The complete demonstration video has been attached to the GitHub Release.

Video filename: PairBook_v1.0.0_Full_Demo.mp4

Download the Full Demonstration Video (MP4)

View the Video in the v1.0.0 Release Assets

The video is shared by both team members as evidence of the final integrated application.

It is hosted as a GitHub Release attachment and may be downloaded rather than streamed directly in the browser.

12. Team Contribution and PSP

12.1 Contribution Assessment

MemberMain ResponsibilitiesContribution
Main developerRequirements, core application, favorites, Excel, integration, deployment, and delivery60%
MyselfContact-method editor, validation utilities, component testing, and GitHub feature PR40%
Total100%

12.2 My PSP

These values are provisional reconstructed estimates and should be checked against actual work records before submission.

PSP ActivityEstimated (min)Reconstructed Actual (min)
Planning2025
Requirements and Contract Review2530
Component Design3035
Validation Utility Development4555
Contact Methods Editor Development85100
Unit and Component Testing5060
GitHub PR and Integration Coordination2530
Documentation and Reflection2025
Total300360

12.3 Partner's PSP

PSP ActivityEstimated (min)Reconstructed Actual (min)
Planning2025
Requirements and Coding Standards4045
Architecture and Data Model4050
Core Features and User Interface95110
Excel Import and Export90105
Integration and Code Review5055
Testing and Debugging5055
Release and Cloud Deployment4555
Evidence Collection and Report Preparation4040
Total470540

The combined reconstructed effort is 900 minutes and corresponds to the team's agreed 60%/40% contribution allocation. These estimates are not independently measured timesheet records.

13. Personal Reflection

This assignment helped me understand how reusable components, data validation, and automated testing contribute to collaborative software development.

The first lesson was the importance of interface design. By following the shared contact-method contract, I could develop my module independently while keeping it compatible with the main contact form.

The second lesson concerned reliable state updates. A successful form component must do more than display data. It must validate user input, preserve identifiers, avoid unintended mutations, and distinguish between confirmed changes and temporary drafts.

The third lesson was the importance of testing. Unit tests and component tests made the expected behavior explicit, while integration testing helped identify problems that could not be detected by testing the editor alone.

Finally, working through Git branches and Pull Requests gave us a traceable collaboration process. The final release and online deployment demonstrated how separately developed modules could become part of one complete application.

In future projects, I would improve the early alignment of component interfaces, styling conventions, and integration-test scenarios.

Overall, PairBook strengthened my understanding of reusable component development, automated verification, Git-based collaboration, and systematic software integration.


References

...全文

相关推荐

CPI01 CIMPC下账异常报告.pptx

CPI01 CIMPC下账异常报告.pptx

2601_94999227

工业旅游基于Python与AIGC的内容生成与营销系统设计:园区知识库构建及游客画像推荐模型实现 项目介绍 基于Python和AIGC的工业旅游园区内容生产与营销辅助系统设计与实现(含模型描述及部

内容概要:本文介绍了一个基于Python和AIGC技术的工业旅游园区内容生产与营销辅助系统的设计与实现。系统通过构建数据采集与治理、园区知识库、内容生成、游客画像与推荐、营销评估五大模型,实现对园区文本资源的统一管理、智能化内容生成与多平台适配、游客群体聚类分析与个性化推荐,并建立从内容发布到转化效果评估的运营闭环。项目利用TF-IDF、余弦相似度、K-Means聚类等算法,结合FastAPI后端服务与数据可视化手段,提升内容生产效率与营销精准度,同时提供完整的代码示例,涵盖文本清洗、关键词提取、行为标准化、推荐算法与审核规则等关键环节。; 适合人群:具备一定Python编程基础,熟悉数据分析与机器学习基础算法的研发人员、数据分析师及工业旅游领域数字化转型从业者,尤其适合工作1-3年希望将AI技术应用于实际业务场景的技术人员。; 使用场景及目标:①解决工业旅游园区资料分散、内容产出慢、风格单一等问题,提升多平台内容生成效率;②通过游客行为数据分析实现客群细分与精准推荐,优化营销策略;③构建可量化、可追溯的营销效果评估体系,支持数据驱动的运营决策; 阅读建议:此资源以实际项目为导向,强调模型应用与代码实践,建议读者结合提供的代码示例进行动手演练,深入理解各模块间的数据流转与系统集成逻辑,并可根据自身园区业务特点进行功能扩展与定制化开发。

nantangyuxi

【ADMM、碳排放】基于分布式ADMM算法的考虑碳排放交易的电力系统优化调度研究【IEEE6节点、IEEE30节点、IEEE118节点】(Matlab代码实现)

内容概要:本文系统研究了基于分布式ADMM算法的考虑碳排放交易机制的电力系统优化调度方法,并提供了在IEEE6节点、IEEE30节点和IEEE118节点标准系统上的Matlab代码实现。研究围绕多区域互联电网环境,构建了融合经济调度与碳排放成本的联合优化模型,采用交替方向乘子法(ADMM)实现问题的分布式求解,有效提升了大规模系统计算效率与区域间协调能力。文中详细阐述了模型建立过程、ADMM算法设计、收敛性分析及仿真验证流程,重点展示了碳交易价格、排放配额等因素对机组出力、碳成本及系统低碳运行的影响,体现了该方法在促进清洁能源消纳和降低系统碳足迹方面的优势。; 适合人群:具备电力系统分析、优化理论基础及Matlab编程能力,从事能源互联网、低碳电力调度、综合能源系统优化等方向的高校研究生、科研机构研究人员及电力行业工程技术开发者。; 使用场景及目标:①应用于含碳约束的多区域电力系统经济-低碳协同调度;②学习和复现基于ADMM的分布式优化算法在能源系统中的建模与实现;③为碳市场机制下电网运行优化、跨区域能源协调与政策仿真提供技术支持与参考方案。; 阅读建议:建议读者结合所提供的Matlab代码逐模块分析算法实现逻辑,重点关注目标函数构建、拉格朗日增广项设计及ADMM迭代更新步骤,建议在不同测试系统中调整碳交易参数进行仿真实验,以深入理解其对调度结果的影响机制与分布式求解的收敛特性。

wlz249

悬臂梁的有限元分析,采用多重网格高斯-赛德尔方法求解(Matlab代码实现)

内容概要:本文系统阐述了悬臂梁的有限元分析方法,采用多重网格高斯-赛德尔迭代法高效求解其力学响应,并配套提供了完整的Matlab代码实现。研究首先建立悬臂梁的有限元模型,通过网格离散化将其力学问题转化为大型稀疏线性方程组;为克服传统迭代法收敛缓慢的缺陷,引入多重网格法作为加速策略,结合高斯-赛德尔迭代在不同网格层级上执行光滑操作,显著提升了求解效率。文中详细剖析了刚度矩阵的数值组装过程、位移边界条件的精确施加方法、以及多层网格间关键的限制(Restriction)与插值(Prolongation)算子的实现机制,完整呈现了从模型构建到数值求解的全流程。最终通过数值仿真,清晰展示了悬臂梁在载荷作用下的位移场与应力场分布云图,验证了该联合算法在保证计算精度的同时,具备优异的收敛性能和计算效率。; 适合人群:具备有限元分析、计算力学及数值线性代数基础知识,并熟悉Matlab编程语言的理工科硕士、博士研究生及科研人员,特别适用于从事结构工程、机械设计或计算物理学等相关领域研究的学者。; 使用场景及目标:①深入掌握有限元法在经典弹性力学问题(如悬臂梁)中的具体建模步骤与实现细节;②透彻理解多重网格法的核心思想及其在加速大规模科学计算中的关键作用;③学习高斯-赛德尔迭代法与多尺度数值技术的有机结合方式,掌握提升大型线性系统求解效率的先进策略。; 阅读建议:建议读者务必结合文中的Matlab代码进行逐行调试与跟踪,重点关注刚度矩阵的构建逻辑、边界条件的处理技巧以及多重网格循环(如V-cycle)的实现过程。为进一步深化理解,可尝试修改模型参数(如网格密度、材料属性或外加载荷),观察其对计算结果、收敛速度和内存消耗的影响,从而全面评估该数值方法的鲁棒性与适用范围。

然哥依旧

【心理健康信息化】基于Python的智能测评与预约系统设计:融合量表计分、风险分层及资源调度模型的高校心理服务管理平台 项目介绍 基于Python的学生心理测评预约与结果管理系统设计与实现(含模型描述

内容概要:本文详细介绍了一个基于Python的学生心理测评预约与结果管理系统的设计与实现,旨在通过技术手段提升高校心理服务的规范化、效率化与安全性。系统集成了学生信息管理、在线心理量表测评(如PHQ9、GAD7、PSS10)、自动计分、风险分层识别、智能预约匹配、咨询状态跟踪及数据安全审计等功能。项目采用模块化架构,涵盖表现层、业务服务层、数据存储与安全监控等多个层次,并引入量表版本控制、规则与概率融合的风险模型、基于匈牙利算法的最小成本时段匹配、预约状态机管理以及敏感字段加密等核心技术。配套提供了完整的模型描述与部分Python代码示例,包括答案校验、计分逻辑、风险预测、资源调度和审计摘要等关键环节的实现。; 适合人群:具备一定Python编程基础,熟悉Web开发或数据分析的高校研究人员、软件开发者、心理健康信息化项目参与者,以及心理学与计算机交叉领域的学生或技术人员。; 使用场景及目标:①用于高校心理中心建设数字化服务平台,优化心理测评与咨询服务流程;②支持心理风险的早期识别与闭环跟踪,提升危机干预响应能力;③为教学科研提供可复现的模拟数据生成方法与系统原型参考,推动心理健康领域的智能化管理实践。; 阅读建议:此资源不仅提供系统设计思路与技术实现细节,还强调隐私保护、伦理合规与专业协作的重要性。建议读者结合代码示例深入理解各模型的工作机制,并在实际应用中注重与心理咨询专业流程的衔接,确保技术服务于人的健康发展。

nantangyuxi
评论
收藏 已收藏
分享
返回顶部