Falcons — Testing Essay (Alpha Sprint)

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

Falcons — Testing Essay (Alpha Sprint)

ItemContent
CourseEE308FZ Software Engineering — CSDN community 2601_FZU-MU_SE
Assignment RequirementFifth Assignment — Alpha Sprint
Team NameFalcons (Group 12)
Project NameSports Buddy — a sports matchmaking platform for university students
Sprint2026-11-21 to 2026-11-28
RoleTester — Wang Shaojie (060725)
Assignment GoalGet the main journey running against the real backend, and back every acceptance criterion with reproducible test evidence — a command, a log, and where it matters a screenshot.
Other ReferencesThe team's SRS V3.1; the team repository; the Assignment 4 prototype deck (assignment4/slides/)

Contents

  1. Testing Arrangement
  2. Tool Selection
  3. Automated Testing Practice
  4. Test Cases
  5. Test Results
  6. Defects
  7. Experience and Comments

1. Testing Arrangement

Testing ran throughout the sprint rather than at the end, and was organised in three layers so that a failure could be located quickly:

LayerScopeWhen
Backend API / integration80 pytest cases covering auth, activities, sign-up, check-in, attendance, reviews, reminders and the credit-score matrixContinuous; re-run before every merge
Frontend self-check178 assertions in tools/verify.mjs (page rendering, routing, credit-rule constants, responsive guards)After every frontend change
Real-backend UI E2E9-step journey login → list → detail → join → check-in → finish → review in headless Edge; attendance is triggered through the API, not the UI2026-11-28, after integration

The division of labour followed the three layers: developers owned the backend acceptance files, the frontend owner kept verify.mjs in step with each page, and I owned the end-to-end journey, the regression rounds and the defect log. Every round produced artefacts instead of verbal claims — docs/test-logs-2026-11-28/ for command output and docs/e2e/ for the browser run — so a claim such as "80 tests pass" can be checked by anyone who opens the log.

Environment: Python 3.13 + FastAPI + SQLAlchemy + SQLite; a dependency-free Node ES-module frontend; headless Microsoft Edge driven over the DevTools Protocol at 390 × 844, the mobile size the product targets.

2. Tool Selection

ToolPurposeWhy chosen
pytestBackend unit / integration testsStandard Python runner; fixtures make one-file-per-issue acceptance tests cheap to write
ruffCode-standard checkFast, zero-config; enforces the 100-character line rule and import order
Node verify.mjsFrontend self-checkNo dependencies at all; asserts page rendering, routes, constants and layout guards
CDP + headless EdgeReal-browser E2E and screenshotsRuns the real ES modules and real CSS; catches what programmatic checks cannot
race probeConcurrency test for sign-upFires 12 simultaneous requests at a capacity-2 activity against a live server
seed scriptsReproducible demo dataOne command creates demo accounts and activities, idempotently

The important choice was not the runner but the level. verify.mjs is deliberately mock-based and instant, which makes it a good guard for layout and constants — and, as section 6 shows, a bad guard for integration. The E2E is slow (about three and a half minutes, because it waits for an activity to finish naturally) and therefore runs once per integration, not on every save.

3. Automated Testing Practice

All suites are reproducible with one command each:

# backend
cd src/backend
python -m pytest              # 80 passed
python -m ruff check .        # All checks passed
python tools/race_probe.py    # exit 0 = capacity held

# frontend
cd src/frontend
node tools/verify.mjs         # 178 assertions

# end-to-end (real backend, throwaway database so reruns stay reproducible)
SPORTMATE_DATABASE_URL=sqlite:///./e2e.db python -m uvicorn main:app --port 8000
node tools/server.mjs         # in another terminal
node src/frontend/tools/e2e.mjs --out=docs/e2e

On Windows, set the variable with $env:SPORTMATE_DATABASE_URL="sqlite:///./e2e.db" instead of the inline prefix.

The backend needs its Python requirements installed once; every other suite runs on a bare Python and Node installation. Backend tests use an in-memory database, so none of them touch a developer's local data.

tools/e2e.mjs is dependency-free: it launches Edge, talks to it over CDP, creates its own data through the real HTTP API, and writes step-by-step screenshots plus a console log and a JSON summary. It does not seed the database and it does not stub the network, so a pass means the browser and the server actually agreed.

The probe is the one suite that cannot live inside pytest. The in-process TestClient serialises everything through a single SQLite connection, so a concurrency bug simply never appears there; race_probe.py therefore starts a real uvicorn server on a temporary file-backed database before firing its requests. Its docstring states this contract explicitly.

4. Test Cases

4.1 Backend (80 cases)

FileCasesFocus
test_flow.py26End-to-end business loop
test_issue4_auth_acceptance.py2Register / login / token persistence
test_issue6_create_activity_acceptance.py2Create activity
test_issue7_activity_list_acceptance.py2Activity list + filters
test_issue8_activity_detail_acceptance.py4Activity detail states
test_issue9_join_leave_acceptance.py5Join / cancel + credit threshold
test_issue10_persistence_acceptance.py2Persistence across restart
test_issue11_checkin_acceptance.py4Check-in code / location
test_issue12_attendance_acceptance.py4Attendance / no-show, incl. the DEF-04 regression case
test_issue13_my_activities_acceptance.py3My activities
test_issue14_reviews_acceptance.py3Reviews
test_issue15_credit_matrix.py12Credit-score rule matrix
test_issue16_reminders_acceptance.py3Upcoming-activity reminders
test_startup.py8Startup / health / seed
Total80

The 11-28 regression report recorded 76 cases. The last four arrived with the reminders endpoint (#16) and the DEF-04 regression case, so 76 and 80 are both correct — for their own dates.

4.2 UI end-to-end (9 assertions)

#StepExpectedResult
1Login page rendersInputs and button visiblePASS
2UI loginToken stored, redirect to discovery, credit shownPASS
3Activity listCreated activity renderedPASS
4List → detailDetail opens by idPASS
5UI join1/2 → 2/2, status registeredPASS
6UI check-inStatus checked_in, method codePASS
7Review entry appears after finishButton visiblePASS
8Detail → review pageForm rendersPASS
9Submit reviewPartner receives one reviewPASS

Exit code 0. The run produced 12 PNG files: 11 step screenshots plus one "before the fix" frame kept for the DEF-03 comparison in section 6.

5. Test Results

CheckResult
Backend pytest80 / 80 passed
ruff check .All checks passed (0 errors)
Concurrency probe (capacity 2, 12 threads)4 / 4 runs: 201 × 2, joined = 2, exit 0
Frontend verify178 / 178 passed (sections A–I; section I alone adds 17 detail-page assertions)
UI E2E9 / 9 passed, exit 0, 12 screenshots
Capacity-state check (manual, 11-28)full → cancel → open → join again, no stuck state; a one-off check, not a fixed test case

The raw counts carry the point: twelve requests hit a two-slot activity, exactly two received 201 and the other ten 409, and joined_count never exceeded 2 across four consecutive runs. A manual check on 11-28 covered the adjacent path that a fix like this tends to break — a full activity freed by a cancellation must return to open with slots_left = 1, accept the next person, and let the user who cancelled rejoin.

6. Defects

IDSeverityDescriptionStatus
DEF-01SevereConcurrent sign-ups over-booked a capacity-2 activity (5–9 joined)Fixed — BEGIN IMMEDIATE + capacity re-check under the lock + unique constraint (939e9f6); probe 4/4 holds
DEF-02Minorruff check failed on two over-long linesFixed — lines split (af5f8b0); 0 errors
DEF-03BlockingLogin did not persist the token, so GET /me returned 401 against the real backendFixed — api/index.js calls tokenStore.set() after login/register (6aa892c); E2E 9/9
DEF-04GeneralAttendance auto-recorded the organiser as attended, producing 3/2 participants and an inflated credit scoreFixed — no organiser attendance record is created (8ce3f13); verified by re-running pytest (80 passed) on main after the fix
DEF-05DisplayActivity card renders the sport icon as an English key (badminton) over the titleOpen — planned for Beta

DEF-03, before and after. The first frame is what the mock-based self-check could never show: login returns 200, the app then calls GET /me, receives a 401 and never leaves the login screen.

img

Before the fix: login succeeds on the server, the page is blocked by the 401 from GET /me.

img

After the fix: the token is stored, the user enters the app and sees the credit score.

img

The sign-up sheet in the real-backend E2E — capacity and remaining slots come from the API, not from mock data.

DEF-04 evidence. The frame below is the E2E capture that first exposed the defect, taken before the fix; the 3/2 count is the symptom, not the current state.

img

DEF-04 as captured by the 11-28 E2E — before the fix (11-28 E2E): a capacity-2 activity shows 3/2 participants because the organiser was auto-marked attended.

img

The review page, reached at the end of the journey — the last link in the chain that DEF-03 had blocked.

DEF-05 stays open: the sport column stores an English key, and sportIconOf returns that key whenever the sport is known — the 🤸 fallback only fires for unknown names — so the card prints badminton in ~40 px type over the title, and the filter chips interpolate the same key (badminton 羽毛球). It breaks nothing functionally, but it is the first thing a reader sees on the list page, so it should be cleared before the defence screenshots.

7. Experience and Comments

  1. Mock mode hides real integration bugs. The frontend self-check ran entirely on mock data, so DEF-03 — a token that was never persisted — was invisible until the E2E ran against a real backend. The lesson is not "mock tests are bad" but "a mock suite cannot be the only gate": from now on every release check includes at least one real-backend E2E.
  2. Concurrency needs a dedicated probe. In-process tests serialise through one SQLite connection, so the over-booking race only appeared when twelve real HTTP requests hit a running server. The probe has since become a regression test, and its docstring was corrected to "Concurrency regression probe (DEF-01)" (ccc6080) so that it no longer describes a defect that is already fixed.
  3. Automated tests are also the sprint evidence. Every defect, fix and acceptance criterion has a command, a log and a screenshot, so the sprint log can cite evidence instead of descriptions. Writing the report became a matter of copying paths rather than remembering what happened.
  4. Boundary cases matter for the credit score. The 12-case matrix covers the 60-point threshold and the 0/100 clamps; without it, the "prevent no-shows" feature — the project's main differentiator — would have been shipped unverified.
  5. A fix is not done until the neighbouring path is tested. DEF-01 was fixed at the join path, so the regression covered full → cancel → open → rejoin; DEF-04 was fixed in attendance, so a case now asserts that attendance leaves a two-person activity at two people and keeps the organiser's credit at 80.
  6. Remaining work. DEF-04 is fixed and verified; DEF-05 (icon rendered as an English key) is a visual issue that should be cleared before the defence screenshots. The other open item is coverage depth: six of the acceptance files are developer-written self-tests that I only re-ran, so the next round should add negative cases around the join and credit paths.
...全文

相关推荐

智慧城市工程施工管理智能体理场景的设计与实施方案.docx

智慧城市工程施工管理智能体理场景的设计与实施方案.docx

公众号:优享智库

数字医院医疗质量智能体理场景的设计与实施方案.docx

数字医院医疗质量智能体理场景的设计与实施方案.docx

公众号:优享智库

【风力涡轮发电机】用于电磁暂态(EMT)研究的第四类(即全变流器)风力发电机系统的通用模型研究(Simulink仿真实现)

内容概要:本文研究了一种用于电磁暂态(EMT)仿真的第四类全变流器型风力发电机系统的通用化建模方法,并基于Simulink平台实现了该模型的仿真。该模型全面涵盖了风力机气动特性、传动系统动力学、发电机电气特性、全功率电力电子变流器及其核心控制策略,包括最大功率点跟踪(MPPT)、有功与无功功率解耦控制、电网同步控制等,旨在为高比例风电接入的现代电力系统提供一个高精度、高效率的动态仿真工具。研究重点在于构建能够准确反映全变流器风机在各类电网扰动下动态响应行为的综合性模型,以支撑复杂电网的暂态稳定性分析、并网适应性评估、保护与控制策略的验证。文中详细阐述了各子系统模块的数学建模原理、参数设计依据及模块间的耦合关系,并通过不同运行工况下的仿真结果,验证了所建模型的动态准确性和工程实用性。; 适合人群:具备电力系统分析、电力电子技术、自动控制理论及Matlab/Simulink仿真基础的研究生、高校科研人员以及从事新能源发电并网仿真、电力系统规划与运行的工程技术人员。; 使用场景及目标:①研究高渗透率风电对电网电磁暂态过程(如短路故障、电压跌落)的影响机制;②开发与验证适用于风电场的新型继电保护、低电压穿越(LVRT)及高电压穿越(HVRT)控制策略;③进行含大规模风电的电力系统小干扰与大干扰稳定性评估;④作为高等院校相关专业进行风力发电系统动态特性教学与科研的先进仿真案例。; 阅读建议:读者应结合Matlab/Simulink环境,亲手搭建并调试文中所述模型,尤其关注变流器双闭环(电流环、电压环)控制器的设计、参数整定及其与电网强度的交互影响,建议深入研读文中引用的经典文献以巩固对风电机组控制理论与实践的理解。

@橘柑橙柠桔柚

西周BC809年世界历史地图矢量文件SHP格式.zip

本资源为《西周BC809年世界历史地图矢量文件SHP格式》压缩包,文件大小约 24.49 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

白水先森

市十五五银发经济产业园与智慧养老服务平台项目建设方案.docx

市十五五银发经济产业园与智慧养老服务平台项目建设方案.docx

公众号:优享智库
评论
收藏 已收藏
分享
返回顶部