Code Standards, Sprint Tasks, and Plans

本文介绍了项目中关于代码规范(命名约定、缩进格式、注释、版本控制等)、前端界面设计与后端架构、冲刺任务分解以及安全性和性能优化的详细规划。强调了团队协作和代码管理的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Code Standards, Sprint Tasks, and Plans

Which course does this assignment belong to2301-MUSE Community
Assignment RequirementTeamwork——Alpha Sprint
Team nameOutOfTheOrdinary
The goal of this assignmentDevelop code specifications, sprint tasks and plans.
Other referencesNone

1.Code Standard

I.Naming convention

  • Variable naming: Use meaningful and descriptive names. Avoid using single letters or abbreviations as variable names.

  • Function and method naming: Use verbs and nouns to clearly describe the function of a function or method. For example, getUserInfo().

  • Class naming: Use Camel Case to name a class, starting with a capital letter. For example, UserInfoManager.

  • File naming: Use meaningful names and use appropriate file extensions. For example, user_info.py.

II. Indent and format

  • Use a uniform indent style, commonly using tabs or Spaces for indentation. It is usually recommended to indent with four Spaces.

  • Maintain a consistent alignment style in your code, such as for multiple line arguments or dictionary declarations.

  • Use appropriate Spaces and line breaks to improve the readability of your code.

III.Annotation specification

  • Add comments to key sections that explain the intent, implementation details, and considerations of the code.

  • For complex algorithms or logic, provide detailed comments to help other developers understand the code.

  • For public interfaces or functions, provide documented comments describing the parameters, return values, and usage.

IV.Version control

  • Use a version control system, such as Git, to manage the code and establish appropriate branching policies, such as master, development, and feature branches.

  • When you commit code, add meaningful commit information that describes the purpose and content of the code change.

  • Code Merge (Merge) or Rebase (Rebase) on a regular basis to ensure cleanliness and consistency of the code base.

V.Test specification

  • Develop unit test specifications to test core functions, boundary conditions, and exceptions.

  • Create integration tests to ensure proper collaboration between individual components or modules.

  • Design system tests to verify the behavior and performance of the entire system in a real-world environment.

VI.Safety specifications

  • For sensitive data, encryption algorithms are used for storage and transmission to protect data security.

  • Protect against SQL injection attacks and use parameterized queries or ORM tools to build secure database queries.

  • Prevent XSS attacks by escaping or filtering user input appropriately.

VII.Performance specification

  • Avoid unnecessary loops or recursions and try to use efficient algorithms and data structures.

  • Use a cache to store frequently used data to reduce double calculations or queries.

  • Compress and merge static resources (such as images, script files, etc.) to improve loading speed.

2.Sprint Tasks

2.1 About the front-end plan

  • The team should complete the prototype of the app interface, and make at least 1/2 of the interface given by the ui into front-end code.

  • In the process of completing the interface prototype, improve the shortcomings of the ui.

  • Improve interface documents so that back-end personnel can clearly understand interface tasks and enhance the connection between back-end and back-end technical personnel.

2.2 About the back-end plan

  • Complete the back-end architecture.

  • Complete the existing interfaces in the interface document, and ensure the stability of the interfaces while deploying them to the server.

  • The face recognition algorithm is coarsely trained and embedded in the back-end interface. At the same time, the docking and stability test with the front end are completed.

  • Prepare to learn high concurrency related high-pressure environment handling methods to solve extreme testing, and find a way to solve the face recognition algorithm can not capture biometric confusion problems.

3.Specific division of plan

3.1 About the front-end plan

Day1-2:

Learn compose to complete the basic understanding of compose.

Day3-4:

Complete the first home screen and start my compose journey.

Day5-6:

Complete three or four screens.

Day7-8:

Update some interfaces required by the interface to the back-end.

Day9-10:

Interconnect with the back-end to use the interface.

3.2 About the back-end plan

Day1-2:

Construct the data table model and implement the login and registration interface. Collect face data sets.

Day3-4:

The image receiving interface is realized, and the face detection is trained.

Day5-6:

To realize the interface related to team management, face recognition training began.

Day7-8:

Implement message transmission and release interface, face recognition algorithm interface and data statistics interface.

Day9-10:

Publish to the server, coordinate with the front-end.

<think>我们正在配置Windows下VS Codetasks.json文件,用于编译C/C++程序。根据引用,tasks.json文件用于定义构建任务,通常调用g++编译器。 关键点: 1. 需要安装MinGW-w64,并确保g++.exe在系统PATH中,或者在tasks.json中指定完整路径。 2. tasks.json文件通常放在项目目录下的.vscode文件夹中。 3. 配置任务时,主要指定编译器路径、编译参数(如输入文件、输出文件、调试信息等)和任务标签。 根据引用[2]和[5]提供的示例,我们可以整合一个常用的tasks.json配置。 步骤: 1. 确保已安装MinGW-w64,并将bin目录(包含g++.exe)添加到系统环境变量PATH中(引用[4])。如果不想修改环境变量,也可以在tasks.json中写绝对路径。 2. 在VS Code中打开项目文件夹,按Ctrl+Shift+P打开命令面板,输入“Tasks: Configure Default Build Task”,然后选择“g++.exe build active file”来生成一个默认的tasks.json文件(引用[4])。 3. 如果自动生成的tasks.json不能满足需求,可以手动修改。 下面是一个典型的tasks.json配置,用于编译当前活动文件(C++)并生成可执行文件(带调试信息): ```json { "version": "2.0.0", "tasks": [ { "type": "shell", "label": "g++ build active file", // 任务标签,用于在launch.json中引用 "command": "g++", // 如果g++在PATH中,可以直接写"g++",否则写绝对路径,如"D:\\MinGW\\bin\\g++.exe" "args": [ "-g", // 生成调试信息 "${file}", // 当前活动文件 "-o", // 输出参数 "${fileDirname}\\${fileBasenameNoExtension}.exe" // 输出到当前文件所在目录,文件名与源文件相同(无扩展名) ], "options": { "cwd": "${workspaceFolder}" // 工作目录为当前项目根目录 }, "problemMatcher": ["$gcc"], // 使用gcc问题匹配器捕获错误 "group": { "kind": "build", "isDefault": true // 设置为默认生成任务 } } ] } ``` 变量说明(VS Code预定义变量): - ${file}: 当前打开的文件(绝对路径) - ${fileDirname}: 当前打开文件所在的目录 - ${fileBasenameNoExtension}: 当前打开文件的文件名(不含扩展名) - ${workspaceFolder}: 当前工作空间(项目)根目录 如果需要同时支持编译并运行,可以配置两个任务(引用[2]): 1. 一个用于构建(带调试信息,用于调试) 2. 一个用于构建并运行(不带调试信息,用于快速运行) 但通常调试和运行可以共用一个构建任务(带调试信息也可以运行)。如果希望有两个独立任务,可以这样配置: ```json { "version": "2.0.0", "tasks": [ { "label": "build for debug", "type": "shell", "command": "g++", "args": [ "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "group": "build" }, { "label": "build and run", "type": "shell", "command": "g++", "args": [ "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "group": { "kind": "build", "isDefault": true }, // 在构建后立即运行程序 "dependsOn": "build for debug", // 注意:这里依赖上面的任务,但实际上我们可能希望这个任务独立构建并运行,所以可以去掉依赖,或者改为运行两个命令 // 或者,我们可以在这个任务中先编译再运行,但通常一个任务只做一件事。如果要连续执行,可以写一个脚本,或者使用复合任务(compound tasks)? // 另一种做法:在tasks.json中只定义构建任务,运行任务通过终端手动执行程序,或者通过launch.json来运行(调试)。 } ] } ``` 但是,注意:一个任务通常只做编译。如果要运行,可以在终端中执行,或者通过launch.json配置调试运行。 因此,建议只配置一个默认的构建任务(带调试信息),然后在launch.json中配置调试任务(引用[1])。运行程序可以通过在终端中手动输入可执行文件名。 另外,引用[3]提供了Python的tasks.json配置,但我们需要的是C++,所以参考意义不大。 总结步骤: 1. 安装MinGW-w64,并配置环境变量(或者记下g++.exe的路径)。 2. 在VS Code中打开项目文件夹。 3. 创建.vscode文件夹(如果不存在)。 4. 在.vscode文件夹中创建tasks.json文件,并填入上述配置(根据实际情况修改编译器路径)。 注意:如果使用C语言,将g++改为gcc即可。 配置完成后,按Ctrl+Shift+B即可执行默认构建任务,生成可执行文件。 常见问题: 1. 如果出现“g++不是内部或外部命令”,说明环境变量未配置正确,或者需要在tasks.json中写g++.exe的绝对路径。 2. 如果构建成功但无法运行,可能是生成的exe路径不对,或者需要配置launch.json来调试。 下一步:配置launch.json进行调试(如果需要)。 相关问题: 1. 如何配置VS Code的launch.json文件来调试C++程序? 2. 如何配置VS Code同时支持C和C++的构建任务? 3. 如何在tasks.json中配置多个源文件的编译? 4. 如何配置VS Code使用CMake构建C++项目?</think>在 Windows 环境下配置 VS Code 的 `tasks.json` 文件用于 C/C++ 编译,以下是详细步骤和配置示例: ### 配置步骤 1. **安装必要工具**: - 安装 [MinGW-w64](https://sourceforge.net/projects/mingw-w64/)(选择 `x86_64` 架构) - 将 MinGW 的 `bin` 目录添加到系统 PATH(如 `D:\mingw64\bin`) - VS Code 安装插件:`C/C++` 和 `Code Runner` 2. **生成 tasks.json**: - 打开 C++ 源文件(如 `main.cpp`) - 按 `Ctrl+Shift+P` → 输入 `Tasks: Configure Default Build Task` - 选择 `C/C++: g++.exe build active file` 3. **修改 tasks.json**: ```json { "version": "2.0.0", "tasks": [ { "type": "shell", "label": "g++ build", // 任务名称 "command": "g++", // 编译器路径(PATH已配置时可简写) "args": [ "-g", // 生成调试信息 "${file}", // 当前文件(如 main.cpp) "-o", // 输出参数 "${fileDirname}\\${fileBasenameNoExtension}.exe" // 输出路径 ], "options": { "cwd": "${workspaceFolder}" // 工作目录为项目根目录 }, "problemMatcher": ["$gcc"], "group": { "kind": "build", "isDefault": true // 设为默认构建任务 } } ] } ``` ### 关键配置说明 | **参数** | **作用** | **示例值** | |-------------------|--------------------------------------------------------------------------|--------------------------------------------| | `command` | 编译器路径(可用绝对路径) | `"D:\\mingw64\\bin\\g++.exe"` | | `args` | 编译参数 | `-O2` 优化,`-Wall` 显示所有警告 | | `${file}` | VS Code 变量:当前打开的文件 | `main.cpp` | | `${fileDirname}` | VS Code 变量:文件所在目录 | `C:\project` | | `${fileBasenameNoExtension}` | VS Code 变量:文件名(不含扩展名) | `main` | | `problemMatcher` | 错误解析器 | `"$gcc"`(捕获 GCC 错误) | ### 使用方式 1. **编译**:按 `Ctrl+Shift+B` 执行默认构建任务 2. **运行**:在终端输入 `.\main.exe`(输出文件名) 3. **调试**:需配合 `launch.json`(需配置 `"preLaunchTask": "g++ build"`) ### 多任务配置示例 ```json { "tasks": [ { "label": "build & debug", "command": "g++", "args": ["-g", "${file}", "-o", "${fileBasenameNoExtension}.exe"], "group": "build" }, { "label": "build & run", "command": "g++", "args": ["-O2", "${file}", "-o", "${fileBasenameNoExtension}.exe"], "group": "test" } ] } ``` > **注意**:如果出现 `g++ not found` 错误: > 1. 检查 MinGW 的 `bin` 目录是否在系统 PATH 中 > 2. 在 `tasks.json` 中使用编译器的绝对路径 > 3. 重启 VS Code 使环境变量生效
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值