Group8_GOAT_666 — Alpha Sprint Testing Blog (ShanHai-Travel Ver 4.0)

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

Testing Blog — ShanHai-Travel Ver 4.0

Team: GOAT_666 · Course: MIEC EE308FZ Software Engineering (FZU–MU) · Assignment: Fifth Assignment — Alpha Sprint
Sprint: 8 days, 2026-11-21 → 2026-11-28 · Scope: 120 story points, 35 issues
Test owners: 张泽新 (automation + acceptance sheet, Days 1–6), 何智铧 (browser sweep + evidence, Days 1–6), 彭启航 (final release acceptance + deployment recovery, Days 7–8). Sprint Log 4's contribution table lists only its own checkpoint contributor, 彭启航; it does not replace the sprint-wide test assignments recorded in Sprint Essays 1–2.
Version note: the working folder carries a Ver 4.1 label while the repository README calls the product Ver 4.0; a550c1f is the build identifier used here, so the two labels refer to the same build.
Repository: https://github.com/ZZH666-A11Y/shanhai-travel · Release candidate: a550c1f
Evidence: docs/sprint/test-report.md, docs/sprint/log-4-candidate-verification.md, docs/screenshots/ (18 acceptance captures), Sprint Log 4 (17 embedded figures)


1. Overview

ShanHai-Travel Ver 3.0 was a thirteen-page prototype whose "login", "favourite", "publish" and "book" states lived in localStorage; a refresh destroyed all of them. Over eight days it became a system whose accounts, content, favourites and orders are served by an Express API over MySQL 8.0 — without redesigning the approved UI and without moving real money (payment is a mock state machine returning mock: true).

The testing goal was never "does the page look right?" Across the sprint we used four claims, each phrased so it could fail:

  1. Persistence — user-created data is a row in MySQL, survives refresh and is visible to a second client.
  2. Atomicity — an order is never half written; orders and order_items commit together, order_no is unique, and paid always carries paid_at.
  3. One source of identity truth — every page derives login state from the JWT, never from a localStorage role flag.
  4. Release and recovery — the candidate starts from a clean package, survives a lost reply during checkout, and its state can be read back after a restart or a backup restore.

This blog reports how those claims were tested, what broke, how each defect was closed, and what remains untested.


2. Test Strategy

Five layers plus a cross-cutting data check. Each has an owner and a reusable artefact — not a verbal assurance.

LayerWhat it testsMethodArtefact
L1 — API contractStatus codes, {ok, message, data} envelope, field presence, paging, filters, negative pathsPowerShell runner, 44 assertionsscripts/smoke-api.ps1
L2 — Integration / invariantsTransaction rollback, paid_at on paid, idempotent toggle, server-side pricing, request replayHand-run transcript + SQL assertions§4.1 replay table, §4.4 refund tiers
L3 — System / acceptance13 pages: element counts, visible values, redirects, network calls20 given/when/then cases + browser sweepsdocs/screenshots/
L4 — Boundary & negativeWrong password, anonymous/non-admin access, XSS payload, empty state, long content, 375/768/1280 viewports, bad configConstructed inputs and a from-scratch reinstall§4.2, §4.5
L5 — Release / operationsClean extraction, launcher failures, port conflicts, HTTPS reachability, restart persistence, backup restoreWindows + public ECS acceptancelauncher-verification.md, ECS report
Cross-cutting — data consistencyOrphan rows, DECIMAL totals, state machine, analytics input volumeinformation_schema + GROUP BY§4.3

2.1 XP practices we actually used

Being precise about the process matters more than naming every XP term:

  • Testable claims before code. We decomposed "the system can write" into claims 1–3 because the phrase was too vague to verify. A claim that cannot fail is not a test. This is the same instinct as TDD's "define the behaviour first", but we did not keep a strict red–green–refactor log — that is a gap, not a claim made here.
  • Regression after every fix. Both suites were re-run after each defect fix; the Day-4 transcript (create post → comment → double toggle → order → pay → cancel → upload) was replayed unchanged.
  • Failure injection. Dropping the create/payment reply after the server had committed it, and sending two payments to one order, tested the recovery path directly rather than assuming the happy path was sufficient.
  • Review and hand-over as test input. The front-end diff was reviewed before integration; docs/API.md was fact-checked field by field and found two mismatched error codes plus six undocumented ones. B-07…B-09 appeared only when a person double-clicked the launcher and typed into the login form instead of a script. No pair-programming session was recorded.
  • Evidence discipline. Captures were taken with server and database up, after init-db.js, with the session token set explicitly. Two early captures were discarded because the header showed an admin identity while the body rendered for a normal user. Public figures came from pinned HTTPS with certificate/IP-SAN verification.
  • Whole-task verification across seams. A page can pass its own check and still disagree with the next: an order may be created correctly while the account centre shows a stale status, or an upload may succeed while the saved draft loses its image URL. We followed the whole task, refreshed, and checked that the stored result still matched what was submitted.

3. Environment and Tools

ItemLocal acceptancePublic deployment
HostLAPTOP-E5P9C0Q0, Windows 11, 16 GBAlibaba Cloud ECS, Hangzhou, shared Ubuntu instance
RuntimeNode.js v26.13.1, npm 11.20.0, PowerShell 5.1Node.js 22.21.1 + Express under systemd, HTTPS :8003
DatabaseMySQL 8.0.46, service MySQL80, schema shanhai_travel, 17 tablesMySQL 8.0.46 on 127.0.0.1:3307, app account with CRUD on its own schema
BrowserChrome 141 for the 20 manual acceptance cases; Edge for the final 13-page / three-width sweep and the interrupted-checkout runEdge at 375 / 1280 CSS pixels; TLS 1.3 and IP SAN verified
Data baseline9 destinations, 18 tickets, 18 experiences, 9 packages, 7 hotels / 14 rooms, 8 guides, 4 posts, 17 comments, 8 users, 7 seeded orders, 1 596 synthetic page viewsFresh schema with project seed; stock accounts disabled and hashes replaced; stock orders/favourites omitted
Entry pointsGET /api/health, scripts/smoke-api.ps1, docs/screenshots/Public health API, 13 HTML entry points, catalog API

Final local integration command (disposable seeded DB on loopback; admin checks need restricted credentials supplied separately):

powershell -NoProfile -ExecutionPolicy Bypass -File scripts/smoke-api.ps1 `
  -BaseUrl http://127.0.0.1:33180 -AllowTestWrites -ConfirmDisposableDatabase

The launcher checks its configured port for a valid ShanHai health response before reusing a process, and now stops on a failed database check instead of falling through to initialization.


4. Test Cases

Every case states an input and an observable expected value. "Looks right" was never accepted as a result.

4.1 Automated API suite — final run 44/44

There are two numbers in the record and they describe different runs: the historical course test report ends at 43/43 (2026-11-26), and the final local integration run on 2026-11-28 ends at 44/44. Both are quoted here; neither is inflated. Per-group counts in the old report are internally inconsistent (admin/analytics is headed "12" but lists 9 rows), which is a reminder to reconcile documents before release.

Runner rule: HTTP status must equal the expected status; login-bad, fav-unauth, admin-forbidden are expected rejections, not failures. The old report's per-group headings are internally inconsistent, so only the runner totals are quoted here. Representative cases:

#ModuleRequest / inputExpectedActualVerdict
1HealthGET /api/health200, db:"up"200 {"db":"up"}Pass
3CatalogueGET /api/destinations?page=1&pageSize=4&sort=rating200, items.length=4, total=9200, 4 itemsPass
5DetailGET /api/destinations/1gallery 4, tickets 2, experiences 2, comments 3, related 3as expectedPass
9AI plannerPOST /api/ai/plan {"message":"想去看海,四天,预算三千"}200, non-empty plans, days:4200, 1 plan (厦门)Pass
12Auth (negative)wrong password401401Pass
16–17Favouritestoggle {destination,3} twicetrue then false, one rowsame state, no duplicatePass
18Auth (negative)favourites with no token401401Pass
21CommentsPOST /api/posts/{id}/comments200, comment with real id200 (root cause of B-02)Fixed
27Mock paymentPOST /api/orders/{id}/pay200, paid, mock:true200Pass
29Moneyrecompute Σ unitPrice × qtyequals orders.amountequal (2 680.00)Pass
36Admin (negative)overview with normal-user token403403Pass
38AnalyticsGET /api/insights/overview?range=30series.length=30200Pass

Failure-injection cases (final block):

OperationExpectedObserved
Drop the create reply after commit, retry in same tabrecover the original pending order, continue to successrecovered and continued
Drop the payment reply after commit, retryrecover the original paid orderrecovered, success dialog opened
Concurrent identical keyed bookings, then same key with changed dataone order; changed request 409; different account may reuse keyone order, 409, second account OK
Two mock payments on one orderone 200, one 409, saved method is the successful oneas expected

Evidence: test-evidence/ui/checkout-retry.json and local API smoke.

4.2 Manual UI acceptance — 20 cases

The 20 manual acceptance cases were executed in Chrome 141; each asserts an element count, visible value or network call. The later 13-page sweep across three widths was an Edge run (39 initial HTTP 200 responses are page-response counts, not functional cases), recorded in docs/sprint/ui-verification.md. Selected cases:

#PageInput / operationExpectedResult
U1homeload page8 recommendation cards, one spanning 2 columnsPass
U3home"想去看海,四天,预算三千"reply + linked destination cardPass
U5destinationskeyword with no matchempty state + reset buttonPass
U8detailpost 5-star reviewcomment on top, review_count +1, rating recalculatedPass
U9detailfavourite as anonymousredirect to login.html?next=…Pass
U11booking¥1 280 × 2 + 120 addon − 200 early-bird¥2 480, identical to stored valuePass
U12bookingconfirm paymentreal SH2026… number + refund ladderPass
U14guide detaillong body + XSS payloadparagraphs escaped, no markup injectedPass
U13guidestype filter + keyword search8 → 3 cards, no console errorPass

Cross-page workflow checks (Sprint Essay 3; not counted as separate U-numbers): booking three-step back-navigation preserves selections; create → mock pay → cancel/refund shows the API row in the account centre; upload images → save draft → reopen posts keeps the URLs; normal user gets 403; deleting a destination with orders gets 409; 7/30/90-day switch changes the series.

Public acceptance on ECS used a synthetic user, not seed accounts:

CheckResult
13 HTML entry points; catalog returns 9 destinationsall loaded
Replay the same booking, mock pay, sign out/inCNY 2,560 simulated refund read back (the CNY 1,280 tier fixture is a separate archived order)
Admin overview: anonymous / standard user / operator401 / 403 / 200, including across a web-service restart
First six destination links at 375 and 1280 pxno horizontal document overflow, no page script errors

img

Figure 1 — refunded status and the saved CNY 2,560 simulated refund after a new public login (Sprint Log 4, Fig. 9). This is a different, larger booking from the CNY 1,280 tier fixture in §4.4, not a conflicting figure.

img

Figure 2 — {"ok":false,"code":"FORBIDDEN"} from the admin overview for a signed-in standard account; the anonymous call returned 401.

4.3 Data-layer verification — six queries that can fail

#ClaimCheckResult
1Schema completeinformation_schema.TABLES17 tables; 9 destinations, 8 users, 17 comments, 11 favourites, 4 posts, 7 orders
2No orphansLEFT JOIN … WHERE parent.id IS NULL on 5 child tables0 / 0 / 0 / 0 / 0
3Money exactcount DECIMAL columns; Σ orders.amount − Σ order_items.subtotal13 decimal columns; difference 0.00
4State machine holdsGROUP BY status; paid without paid_at0 paid without timestamp
5Analytics has inputCOUNT(*) and day range of page_views1,617 rows over 31 days — exposed B-03 before the fix (some parts of the report round this to 1,596 over 30 days; both describe the same seeded series)
6Room query validSELECT hr.* FROM hotel_rooms hr WHERE hr.city='大理'ER_BAD_FIELD_ERROR — exposed B-04

4.4 Refund tiers and recovery drill

Refund amounts are now computed from the Shanghai date boundary on the server and persisted with the state change. Readback across sessions from CNY 1,280 fixtures:

Days before check-inExpected simulated refundReadback
Same day0%CNY 0
1–2 days50%CNY 640
≥ 3 days100%CNY 1 280

Backup/recovery drill (same ECS host): compressed SQL dump + upload archive + SHA-256 manifest; both archives passed checksum verification; SQL loaded into a disposable schema with all 17 tables readable; upload archive extracted and matched the clean directory; restore schema and extracted copy then removed. Daily timer set for 03:20 Asia/Shanghai with seven snapshots retained.

4.5 Startup, packaging and access-control checks

OperationObserved result
Launch from a path with spaces, then relaunchMySQL up; second run reused the application process
Another service occupies the configured portconflict reported; other service untouched
Invalid JWT setting / out-of-range app port / wrong MySQL portdistinct error for each cause
Fresh directory + lockfile + empty DB + migrationstarted ready: 17 tables, 9 destinations
Unsupported user status (B-06 regression)400, fixture remained active
Ban / reactivate fixtureexisting session and password login blocked, then new login allowed
Five admin table panels at 375 / 768 / 1280 pxno overflow after moving horizontal scrolling inside tables

5. Automation and Coverage — what the numbers mean

The harness grew from 12 cases on Day 2 to 43 assertions on Day 6, then to 44 in the final local integration run. Both totals are reproducible from the commands in the evidence files; the 12-case version was deliberately not counted at the Day-4 checkpoint. A separate loopback timing check sent 80 catalog requests at concurrency 8: 0 errors, 12.6 ms mean, 8.6 ms median, 38.9 ms P95 — one local route, not a whole-system benchmark.

Coverage honesty. We did not run a line-coverage tool, so there is no percentage to quote and none is invented. The 44 assertions cover the API contract, money/state invariants, replay behaviour and page delivery; they do not cover every branch in 53 handlers, the full CSS matrix, long-duration behaviour, or a real payment gateway. The backlog item is explicit: jest + supertest in CI with coverage measured on every push.


6. Defects and Closure

Nine sprint defects were recorded and closed. Every one sat in a seam between two pieces that each worked on their own.

IDSymptomRoot causeFixRegression
B-01Page 2 repeated page 1LIMIT ? rejected by prepared statementinterpolate cast integers; convention documented#3 + suite
B-02New comment fetched by wrong idLAST_INSERT_ID() read on another pooled connectionuse insertId from the insert#19–24
B-03Insights all zerospage_views emptyinit-db.js synthesises 30 days; API zero-fills#37–38
B-04Three room types, one pricehotel_rooms.city does not existjoin hotel_rooms → hotels, order by priceU10–U12
B-05admin.html read localStorage.sh_rolelast page not migratedSH.site.guard('admin'); backend remains authoritativenormal + admin account, page and API
B-06status:'disabled' wrote nothingbackend enumerates active/bannedalign UI and backend validationchange → reload → readback
B-07Correct password → "请输入用户名和密码"helper called with object, password never senthelper normalises both call shapes#10–12
B-08Launcher printed "Server stopped."%~dp0 pointed at …\scripts\pushd "%~dp0..", reuse healthy port, keep CRLFclean-machine run
B-09"创建账号" did nothingrequired checkbox blocked submit before handlernovalidate + own validation + toasthand-over retry

Detailed closure — B-04 (data assumption, not logic). Three room types were listed but the panel priced one default room. Reproduce: booking.html step 1 with a destination that has hotels. Root cause: city lives on hotels, not hotel_rooms, so MySQL returned Unknown column 'hr.city' and the page fell back silently. Fix: join hotel_rooms → hotels on hotel_id, filter hotels.city, order by price so the upgrade delta cannot be negative. Regression: U10–U12, the full suite and the six SQL checks.

Detailed closure — interrupted checkout (final block). Dropping the response after a committed write could create a second order. Fix: a stable requestKey from the booking page, server lookup scoped to the signed-in account, booking data compared, and a database uniqueness constraint on account + key. An unchanged replay returns the original order; changed data under the same key returns 409. Regression: dropped-reply retries in Edge (checkout-retry.json), concurrent keyed requests in API smoke, double payment → one 200 + one 409, and a fresh public checkout ending in a paid confirmation.

Final-block fixes without new B-numbers (the source log does not assign them): booking dates now derive from the Shanghai calendar and prices are resolved server-side from item IDs; refund amounts are persisted with the state change; story links use type + ID; upload validation adds MIME and file-signature checks plus generated filenames; analytics records real HTML visits with a source tag and exposes a demo-data note. Upload was verified by uploading a PNG and comparing downloaded bytes, then rejecting a text fixture.

Two findings were investigated and confirmed not to be defects: the browser-local "rooms left" counter is a documented demo affordance, and /api/insights/overview is intentionally public because the dashboard is a platform-activity page.


7. Residual Risks and Next Steps

RiskWhy it mattersNext step
No line coverage / no CI44 assertions are run by hand; branch coverage is unknownjest + supertest on every push with a coverage report
Strict TDD not recordedClaims were defined first, but no red–green–refactor logRequire the failing assertion in each issue's commit
Single-host recovery onlyBackup drill ran on the same ECS disk; full DB restart duration, off-host recovery and cross-device readback unverifiedRestore onto a second host and measure recovery time
Short performance sample80 catalog requests describe one local routeBenchmark full checkout under realistic concurrency
Mobile evidence is one Edge viewport375/1280 captures came from one workstationTest real devices and additional browsers
Self-signed certificateTeam cert expires 2027-02-26; must verify fingerprint and IP SAN before credentialsReplace with a trusted CA certificate for public use
Branch not mergedsprint-log-4-acceptance was unmerged; main remained at 5e0af48Merge after review; keep a550c1f as the release identifier
Rule-based AI plannerPOST /api/ai/plan is a keyword engine, not a modelDecide whether a model-backed planner is in scope
guides.tags missing / hero rail staticTwo visible gaps in the UIAdd column and wire real route data
Out of release scopeEmail verification, self-service email recovery, real payment gatewayScope explicitly in the next release, not silently assumed

Conclusion. The value of this sprint's testing is not that every case is green; it is that the green is backed by reproducible commands, database queries, failure injection and a closed defect log. The most expensive defects were false assumptions about data — an empty table, a column on the wrong table, a helper called with the wrong shape, a reply lost after commit — none of which could be found by looking at a page that rendered.


Evidence index

  • Runner and final integration command: scripts/smoke-api.ps1
  • Historical 43-case report: docs/sprint/test-report.md
  • Clean package: ShanHai-acceptance-a550c1f-2026-11-28.zip, SHA-256 bb9c1b302f865406fca9a3a3ff6670c5da9196be2872ffeba858874ec5dbe096
  • Launcher checks: launcher-verification.md, test-evidence/package-a550c1f.txt
  • Failure injection: test-evidence/ui/checkout-retry.json
  • Refund readback: refund-tiers.json, prior-session-orders.json
  • Browser acceptance: docs/sprint/ui-verification.md
  • Candidate verification: docs/sprint/log-4-candidate-verification.md
  • Issue traceability and API contract: docs/sprint/issues.md, docs/API.md
  • Local screenshots in this folder: evidence/figure*.png
...全文

相关推荐

复现基于李雅普诺夫的模型预测控制MPC水下机器人AUV方法路径跟踪(Matlab代码实现)

内容概要:本文系统介绍了基于李雅普诺夫稳定理论的模型预测控制(MPC)方法在水下机器人(AUV)路径跟踪中的应用,并提供了完整的Matlab代码实现。该方法融合MPC的多步预测与滚动优化优势,通过构造李雅普诺夫函数严格证明闭环系统的渐近稳定性,有效提升了AUV在复杂海洋环境下的轨迹跟踪精度、抗干扰能力与控制鲁棒性。文档不仅详述了控制系统建模、约束处理与稳定性分析的关键步骤,还配套列举了大量相关科研资源,涵盖路径规划、运动控制、智能算法等多个方向,突出其在顶刊算法复现、科研验证与工程仿真中的高参考价值。; 适合人群:具备自动控制理论、机器人学或海洋工程等相关专业背景,熟悉Matlab/Simulink仿真工具,且具有一定控制算法基础的研究生、科研人员及自动化领域工程技术人员。; 使用场景及目标:①开展水下机器人高精度路径跟踪控制算法的研究与仿真验证;②深入学习李雅普诺夫稳定性理论与MPC控制策略的有机结合方法;③作为高水平期刊论文复现的技术支撑,服务于科研项目推进、学术论文撰写与算法创新设计; 阅读建议:建议结合文档中提及的反步法、滑模控制、非线性MPC等先进控制技术进行对比分析,重点研读代码中的动力学建模、优化问题构建、约束处理机制与稳定性证明逻辑,根据具体研究需求灵活调整系统参数与仿真场景,以实现最优控制性能并深化理论理解。

程序辅导帮

风光火储多源协同参与电网一次调频与二次 AGC 调频控制策略研究(Simulink仿真实现)

内容概要:本文聚焦于风光火储多源协同参与电网一次调频与二次AGC调频控制策略的研究,基于Simulink平台构建完整的多能源系统仿真模型,深入探讨风力发电、光伏发电、火力发电与储能系统在电网频率调节中的协同工作机制。研究系统分析了一次调频的快速响应特性与二次自动发电控制(AGC)的动态调节能力,重点设计并验证了多源协调控制算法,通过仿真评估不同电源间的出力互补性与动态响应性能,有效提升了含高比例新能源电网的频率稳定性和运行可靠性,具有突出的理论深度与工程应用价值。; 适合人群:适用于具备电力系统分析、自动控制理论及新能源并网技术背景的研究生、科研人员以及从事电网调度、新能源集成与储能系统设计的工程技术人员。; 使用场景及目标:①研究多能源系统协同参与电网频率调节的动态机制;②设计与优化面向复杂电网环境的一次调频与AGC协调控制策略;③开展新能源大规模接入背景下电网稳定性仿真分析;④支撑高水平学术论文撰写、科研项目申报或实际工程方案的技术验证与原型开发。; 阅读建议:建议结合Simulink仿真环境动手复现文中控制模型,对照控制逻辑与时序响应曲线深入理解多源协同控制的设计原理,同时可参考文中关联的MATLAB/Simulink案例进行拓展性研究与算法改进。

荔枝科研社

厂外外包管制作业规范.doc

制造技术

可小已

科技型中小企业申请政府资助时,孵化器管理系统需要提供哪些关键数据支撑材料?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN

地方发改委在评审成果孵化转化载体资质时,主要依据哪些核心指标体系?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN
评论
收藏 已收藏
分享
返回顶部
GOAT_666
2601_FZU-MU_SE 176 成员 322 内容