Group8_GOAT_666 — Alpha Sprint Testing Blog (ShanHai-Travel Ver 4.0)
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;a550c1fis 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:
- Persistence — user-created data is a row in MySQL, survives refresh and is visible to a second client.
- Atomicity — an order is never half written;
ordersandorder_itemscommit together,order_nois unique, andpaidalways carriespaid_at. - One source of identity truth — every page derives login state from the JWT, never from a
localStoragerole flag. - 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.
| Layer | What it tests | Method | Artefact |
|---|---|---|---|
| L1 — API contract | Status codes, {ok, message, data} envelope, field presence, paging, filters, negative paths | PowerShell runner, 44 assertions | scripts/smoke-api.ps1 |
| L2 — Integration / invariants | Transaction rollback, paid_at on paid, idempotent toggle, server-side pricing, request replay | Hand-run transcript + SQL assertions | §4.1 replay table, §4.4 refund tiers |
| L3 — System / acceptance | 13 pages: element counts, visible values, redirects, network calls | 20 given/when/then cases + browser sweeps | docs/screenshots/ |
| L4 — Boundary & negative | Wrong password, anonymous/non-admin access, XSS payload, empty state, long content, 375/768/1280 viewports, bad config | Constructed inputs and a from-scratch reinstall | §4.2, §4.5 |
| L5 — Release / operations | Clean extraction, launcher failures, port conflicts, HTTPS reachability, restart persistence, backup restore | Windows + public ECS acceptance | launcher-verification.md, ECS report |
| Cross-cutting — data consistency | Orphan rows, DECIMAL totals, state machine, analytics input volume | information_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.mdwas 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
| Item | Local acceptance | Public deployment |
|---|---|---|
| Host | LAPTOP-E5P9C0Q0, Windows 11, 16 GB | Alibaba Cloud ECS, Hangzhou, shared Ubuntu instance |
| Runtime | Node.js v26.13.1, npm 11.20.0, PowerShell 5.1 | Node.js 22.21.1 + Express under systemd, HTTPS :8003 |
| Database | MySQL 8.0.46, service MySQL80, schema shanhai_travel, 17 tables | MySQL 8.0.46 on 127.0.0.1:3307, app account with CRUD on its own schema |
| Browser | Chrome 141 for the 20 manual acceptance cases; Edge for the final 13-page / three-width sweep and the interrupted-checkout run | Edge at 375 / 1280 CSS pixels; TLS 1.3 and IP SAN verified |
| Data baseline | 9 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 views | Fresh schema with project seed; stock accounts disabled and hashes replaced; stock orders/favourites omitted |
| Entry points | GET /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:
| # | Module | Request / input | Expected | Actual | Verdict |
|---|---|---|---|---|---|
| 1 | Health | GET /api/health | 200, db:"up" | 200 {"db":"up"} | Pass |
| 3 | Catalogue | GET /api/destinations?page=1&pageSize=4&sort=rating | 200, items.length=4, total=9 | 200, 4 items | Pass |
| 5 | Detail | GET /api/destinations/1 | gallery 4, tickets 2, experiences 2, comments 3, related 3 | as expected | Pass |
| 9 | AI planner | POST /api/ai/plan {"message":"想去看海,四天,预算三千"} | 200, non-empty plans, days:4 | 200, 1 plan (厦门) | Pass |
| 12 | Auth (negative) | wrong password | 401 | 401 | Pass |
| 16–17 | Favourites | toggle {destination,3} twice | true then false, one row | same state, no duplicate | Pass |
| 18 | Auth (negative) | favourites with no token | 401 | 401 | Pass |
| 21 | Comments | POST /api/posts/{id}/comments | 200, comment with real id | 200 (root cause of B-02) | Fixed |
| 27 | Mock payment | POST /api/orders/{id}/pay | 200, paid, mock:true | 200 | Pass |
| 29 | Money | recompute Σ unitPrice × qty | equals orders.amount | equal (2 680.00) | Pass |
| 36 | Admin (negative) | overview with normal-user token | 403 | 403 | Pass |
| 38 | Analytics | GET /api/insights/overview?range=30 | series.length=30 | 200 | Pass |
Failure-injection cases (final block):
| Operation | Expected | Observed |
|---|---|---|
| Drop the create reply after commit, retry in same tab | recover the original pending order, continue to success | recovered and continued |
| Drop the payment reply after commit, retry | recover the original paid order | recovered, success dialog opened |
| Concurrent identical keyed bookings, then same key with changed data | one order; changed request 409; different account may reuse key | one order, 409, second account OK |
| Two mock payments on one order | one 200, one 409, saved method is the successful one | as 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:
| # | Page | Input / operation | Expected | Result |
|---|---|---|---|---|
| U1 | home | load page | 8 recommendation cards, one spanning 2 columns | Pass |
| U3 | home | "想去看海,四天,预算三千" | reply + linked destination card | Pass |
| U5 | destinations | keyword with no match | empty state + reset button | Pass |
| U8 | detail | post 5-star review | comment on top, review_count +1, rating recalculated | Pass |
| U9 | detail | favourite as anonymous | redirect to login.html?next=… | Pass |
| U11 | booking | ¥1 280 × 2 + 120 addon − 200 early-bird | ¥2 480, identical to stored value | Pass |
| U12 | booking | confirm payment | real SH2026… number + refund ladder | Pass |
| U14 | guide detail | long body + XSS payload | paragraphs escaped, no markup injected | Pass |
| U13 | guides | type filter + keyword search | 8 → 3 cards, no console error | Pass |
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:
| Check | Result |
|---|---|
| 13 HTML entry points; catalog returns 9 destinations | all loaded |
| Replay the same booking, mock pay, sign out/in | CNY 2,560 simulated refund read back (the CNY 1,280 tier fixture is a separate archived order) |
| Admin overview: anonymous / standard user / operator | 401 / 403 / 200, including across a web-service restart |
| First six destination links at 375 and 1280 px | no horizontal document overflow, no page script errors |

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.

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
| # | Claim | Check | Result |
|---|---|---|---|
| 1 | Schema complete | information_schema.TABLES | 17 tables; 9 destinations, 8 users, 17 comments, 11 favourites, 4 posts, 7 orders |
| 2 | No orphans | LEFT JOIN … WHERE parent.id IS NULL on 5 child tables | 0 / 0 / 0 / 0 / 0 |
| 3 | Money exact | count DECIMAL columns; Σ orders.amount − Σ order_items.subtotal | 13 decimal columns; difference 0.00 |
| 4 | State machine holds | GROUP BY status; paid without paid_at | 0 paid without timestamp |
| 5 | Analytics has input | COUNT(*) and day range of page_views | 1,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) |
| 6 | Room query valid | SELECT 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-in | Expected simulated refund | Readback |
|---|---|---|
| Same day | 0% | CNY 0 |
| 1–2 days | 50% | CNY 640 |
| ≥ 3 days | 100% | 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
| Operation | Observed result |
|---|---|
| Launch from a path with spaces, then relaunch | MySQL up; second run reused the application process |
| Another service occupies the configured port | conflict reported; other service untouched |
| Invalid JWT setting / out-of-range app port / wrong MySQL port | distinct error for each cause |
| Fresh directory + lockfile + empty DB + migration | started ready: 17 tables, 9 destinations |
Unsupported user status (B-06 regression) | 400, fixture remained active |
| Ban / reactivate fixture | existing session and password login blocked, then new login allowed |
| Five admin table panels at 375 / 768 / 1280 px | no 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.
| ID | Symptom | Root cause | Fix | Regression |
|---|---|---|---|---|
| B-01 | Page 2 repeated page 1 | LIMIT ? rejected by prepared statement | interpolate cast integers; convention documented | #3 + suite |
| B-02 | New comment fetched by wrong id | LAST_INSERT_ID() read on another pooled connection | use insertId from the insert | #19–24 |
| B-03 | Insights all zeros | page_views empty | init-db.js synthesises 30 days; API zero-fills | #37–38 |
| B-04 | Three room types, one price | hotel_rooms.city does not exist | join hotel_rooms → hotels, order by price | U10–U12 |
| B-05 | admin.html read localStorage.sh_role | last page not migrated | SH.site.guard('admin'); backend remains authoritative | normal + admin account, page and API |
| B-06 | status:'disabled' wrote nothing | backend enumerates active/banned | align UI and backend validation | change → reload → readback |
| B-07 | Correct password → "请输入用户名和密码" | helper called with object, password never sent | helper normalises both call shapes | #10–12 |
| B-08 | Launcher printed "Server stopped." | %~dp0 pointed at …\scripts\ | pushd "%~dp0..", reuse healthy port, keep CRLF | clean-machine run |
| B-09 | "创建账号" did nothing | required checkbox blocked submit before handler | novalidate + own validation + toast | hand-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
| Risk | Why it matters | Next step |
|---|---|---|
| No line coverage / no CI | 44 assertions are run by hand; branch coverage is unknown | jest + supertest on every push with a coverage report |
| Strict TDD not recorded | Claims were defined first, but no red–green–refactor log | Require the failing assertion in each issue's commit |
| Single-host recovery only | Backup drill ran on the same ECS disk; full DB restart duration, off-host recovery and cross-device readback unverified | Restore onto a second host and measure recovery time |
| Short performance sample | 80 catalog requests describe one local route | Benchmark full checkout under realistic concurrency |
| Mobile evidence is one Edge viewport | 375/1280 captures came from one workstation | Test real devices and additional browsers |
| Self-signed certificate | Team cert expires 2027-02-26; must verify fingerprint and IP SAN before credentials | Replace with a trusted CA certificate for public use |
| Branch not merged | sprint-log-4-acceptance was unmerged; main remained at 5e0af48 | Merge after review; keep a550c1f as the release identifier |
| Rule-based AI planner | POST /api/ai/plan is a keyword engine, not a model | Decide whether a model-backed planner is in scope |
guides.tags missing / hero rail static | Two visible gaps in the UI | Add column and wire real route data |
| Out of release scope | Email verification, self-service email recovery, real payment gateway | Scope 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-256bb9c1b302f865406fca9a3a3ff6670c5da9196be2872ffeba858874ec5dbe096 - 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工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。
地方发改委在评审成果孵化转化载体资质时,主要依据哪些核心指标体系?.docx
科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。


