qualiow-exploratory-testing 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +177 -0
  2. package/bin/mcli +16 -0
  3. package/bin/mobile-cli.mjs +573 -0
  4. package/bin/wadb +6 -0
  5. package/bin/wk-ios +58 -0
  6. package/bin/wkeval.mjs +44 -0
  7. package/data/domains/_default.md +181 -0
  8. package/data/domains/ecommerce.md +192 -0
  9. package/data/domains/fintech.md +200 -0
  10. package/data/domains/identity.md +88 -0
  11. package/data/domains/identity.yml +138 -0
  12. package/data/domains/marketing.md +194 -0
  13. package/data/domains/saas.md +197 -0
  14. package/data/knowledge/changelog.yml +86 -0
  15. package/data/knowledge/learned-patterns.md +172 -1
  16. package/data/knowledge/manifest.yml +210 -4
  17. package/data/knowledge/releases/v0.2.0/entries/technique-contract-narrowing.yml +150 -0
  18. package/data/knowledge/releases/v0.2.0/entries/technique-test-suite-audit.yml +116 -0
  19. package/data/knowledge/releases/v0.2.0/release.yml +20 -0
  20. package/data/knowledge/releases/v0.3.0/entries/technique-functional-diff-analysis.yml +119 -0
  21. package/data/knowledge/releases/v0.3.0/entries/technique-llm-output-verification.yml +102 -0
  22. package/data/knowledge/releases/v0.3.0/entries/technique-verification-mode-selection.yml +153 -0
  23. package/data/knowledge/releases/v0.3.0/release.yml +25 -0
  24. package/data/knowledge/releases/v0.4.0/entries/technique-authenticated-api-probing.yml +137 -0
  25. package/data/knowledge/releases/v0.4.0/entries/technique-environment-fingerprinting.yml +113 -0
  26. package/data/knowledge/releases/v0.4.0/entries/technique-silent-failure-audit.yml +86 -0
  27. package/data/knowledge/releases/v0.4.0/entries/technique-ui-api-differential.yml +97 -0
  28. package/data/knowledge/releases/v0.4.0/release.yml +28 -0
  29. package/data/knowledge/releases/v0.5.0/entries/technique-config-surface-verification.yml +77 -0
  30. package/data/knowledge/releases/v0.5.0/entries/technique-derived-value-verification.yml +81 -0
  31. package/data/knowledge/releases/v0.5.0/entries/technique-expected-behaviour-specification.yml +97 -0
  32. package/data/knowledge/releases/v0.5.0/entries/technique-presentation-integrity.yml +78 -0
  33. package/data/knowledge/releases/v0.5.0/entries/technique-release-readiness-verification.yml +110 -0
  34. package/data/knowledge/releases/v0.5.0/release.yml +33 -0
  35. package/data/targets/_example-backend.yml +123 -0
  36. package/data/targets/_example-mobile-emulation.yml +52 -0
  37. package/data/targets/_example-native-mobile.yml +61 -0
  38. package/data/targets/_example-sim-android-chrome.yml +81 -0
  39. package/data/targets/_example-sim-ios-safari.yml +80 -0
  40. package/data/templates/api-probe-matrix.md +99 -0
  41. package/data/templates/coverage-map.md +14 -0
  42. package/data/templates/expected-behaviour.md +93 -0
  43. package/dist/cli/index.js +137 -5
  44. package/dist/cli/index.js.map +1 -1
  45. package/dist/index.d.ts +350 -527
  46. package/dist/index.js +144 -5
  47. package/dist/index.js.map +1 -1
  48. package/docs/BACKEND-VERIFICATION.md +277 -0
  49. package/docs/MOBILE-SETUP.md +92 -0
  50. package/package.json +26 -12
  51. package/scripts/doctor-mobile.sh +143 -0
  52. package/scripts/setup-mobile.sh +213 -0
  53. package/skills/qa-explore/phases/00-setup.md +8 -1
  54. package/skills/qa-explore/phases/01-auth.md +4 -0
  55. package/skills/qa-explore-mobile/SKILL.md +146 -0
  56. package/skills/qa-explore-mobile/phases/00-setup.md +203 -0
  57. package/skills/qa-explore-mobile/phases/01-auth.md +127 -0
  58. package/skills/qa-explore-mobile/phases/02-charter.md +70 -0
  59. package/skills/qa-explore-mobile/phases/03-discovery.md +79 -0
  60. package/skills/qa-explore-mobile/phases/04-journeys.md +49 -0
  61. package/skills/qa-explore-mobile/phases/05-features.md +72 -0
  62. package/skills/qa-explore-mobile/phases/06-edge-cases.md +157 -0
  63. package/skills/qa-explore-mobile/phases/07-reporting.md +123 -0
  64. package/skills/qa-explore-mobile/references/mobile-edges.md +117 -0
  65. package/skills/qa-explore-quick/SKILL.md +6 -0
  66. package/skills/qa-verify-backend/SKILL.md +163 -0
  67. package/skills/qa-verify-backend/phases/00-setup.md +97 -0
  68. package/skills/qa-verify-backend/phases/01-ac-decomposition.md +58 -0
  69. package/skills/qa-verify-backend/phases/02-static-review.md +71 -0
  70. package/skills/qa-verify-backend/phases/03-live-verification.md +62 -0
  71. package/skills/qa-verify-backend/phases/03b-api-verification.md +157 -0
  72. package/skills/qa-verify-backend/phases/04-e2e-trigger.md +66 -0
  73. package/skills/qa-verify-backend/phases/05-reporting.md +135 -0
  74. package/skills/qa-verify-backend/references/api-probes.md +141 -0
  75. package/skills/qa-verify-backend/references/aws-readonly-probes.md +156 -0
  76. package/skills/qa-verify-backend/references/environment-fingerprinting.md +104 -0
  77. package/skills/qa-verify-backend/references/payload-verification.md +112 -0
  78. package/skills/qa-verify-backend/references/release-readiness.md +97 -0
  79. package/skills/qa-verify-backend/references/safety-rules.md +90 -0
package/bin/wkeval.mjs ADDED
@@ -0,0 +1,44 @@
1
+ // wkeval.mjs — evaluate JS in iOS Simulator Safari via WebKit Remote Inspector (through iwdp)
2
+ // Modern WebKit uses a Target-wrapped protocol: commands go via Target.sendMessageToTarget,
3
+ // responses come back via Target.dispatchMessageFromTarget.
4
+ // Usage: node wkeval.mjs '<js-expression>'
5
+ const WS_URL = process.env.WK_WS || 'ws://localhost:9222/devtools/page/1';
6
+ const expr = process.argv[2];
7
+ if (!expr) { console.error('need a JS expression arg'); process.exit(2); }
8
+
9
+ const ws = new WebSocket(WS_URL);
10
+ let outerId = 0, innerId = 0, targetId = null;
11
+ const innerPending = new Map();
12
+
13
+ function rawSend(method, params = {}) { ws.send(JSON.stringify({ id: ++outerId, method, params })); }
14
+ function targetSend(method, params = {}) {
15
+ return new Promise((resolve) => {
16
+ const mid = ++innerId;
17
+ innerPending.set(mid, resolve);
18
+ rawSend('Target.sendMessageToTarget', { targetId, message: JSON.stringify({ id: mid, method, params }) });
19
+ });
20
+ }
21
+
22
+ const timeout = setTimeout(() => { console.error('TIMEOUT'); process.exit(3); }, 20000);
23
+
24
+ ws.addEventListener('message', async (ev) => {
25
+ let msg; try { msg = JSON.parse(ev.data); } catch { return; }
26
+ if (msg.method === 'Target.targetCreated' && !targetId) {
27
+ targetId = msg.params.targetInfo.targetId;
28
+ try {
29
+ await targetSend('Runtime.enable');
30
+ const wrapped = `(function(){ try { var __r = (${expr}); return (typeof __r==='undefined')?'undefined':__r; } catch(e){ return 'ERR: '+e.message; } })()`;
31
+ const res = await targetSend('Runtime.evaluate', { expression: wrapped, returnByValue: true, awaitPromise: true });
32
+ clearTimeout(timeout);
33
+ const r = res && res.result && res.result.result ? res.result.result : (res && res.result);
34
+ if (r && 'value' in r) console.log(typeof r.value === 'object' ? JSON.stringify(r.value) : String(r.value));
35
+ else console.log(JSON.stringify(r));
36
+ process.exit(0);
37
+ } catch (e) { console.error('EVAL_FAIL', e.message || e); process.exit(5); }
38
+ }
39
+ if (msg.method === 'Target.dispatchMessageFromTarget') {
40
+ let inner; try { inner = JSON.parse(msg.params.message); } catch { return; }
41
+ if (inner.id && innerPending.has(inner.id)) { innerPending.get(inner.id)(inner); innerPending.delete(inner.id); }
42
+ }
43
+ });
44
+ ws.addEventListener('error', (e) => { console.error('WS_ERROR', e.message || e); process.exit(4); });
@@ -0,0 +1,181 @@
1
+ # Default Domain: Generic Web Application
2
+
3
+ ## Priority Areas
4
+
5
+ 1. **Core Functionality** - Forms, navigation, and primary user flows work correctly
6
+ 2. **Authentication & Authorization** - Login, logout, session management, protected routes
7
+ 3. **Error Handling** - Graceful failures, meaningful error messages, recovery paths
8
+ 4. **Responsive Design** - Layout integrity across viewport sizes
9
+ 5. **Accessibility** - Keyboard navigation, screen reader basics, color contrast
10
+ 6. **Performance** - Page load times, interaction responsiveness
11
+ 7. **SEO Fundamentals** - Meta tags, heading structure, crawlability
12
+
13
+ ## Feature Risk Ranking Guide
14
+
15
+ > Assign a priority tier to every feature before testing. Spend the most time on P0, then P1, and so on. Adjust based on domain-specific risk.
16
+
17
+ | Tier | Meaning | Time Allocation | Criteria |
18
+ |------|--------------------------------|-----------------|--------------------------------------------------------------------------|
19
+ | P0 | Must work perfectly | ~40% of effort | Revenue-generating, security-critical, or legally required. Failure = outage or data loss. |
20
+ | P1 | Must work correctly | ~30% of effort | Core user journeys and frequently used features. Failure = major user frustration. |
21
+ | P2 | Should work correctly | ~20% of effort | Supporting features that enhance the experience. Failure = degraded but usable. |
22
+ | P3 | Nice to have working | ~10% of effort | Informational pages, rarely used settings, cosmetic polish. Failure = minor annoyance. |
23
+
24
+ **How to rank a feature:**
25
+ 1. Ask: "If this feature is broken, does the business lose money or get sued?" -- If yes, P0.
26
+ 2. Ask: "If this feature is broken, do users fail their primary task?" -- If yes, P1.
27
+ 3. Ask: "If this feature is broken, do users notice and complain?" -- If yes, P2.
28
+ 4. Everything else is P3.
29
+
30
+ ## Completeness Checklist
31
+
32
+ > Minimum features and states every web application should have. Test for the *existence* of these before deep-diving into any single feature.
33
+
34
+ ### Navigation & Structure
35
+ - [ ] Logo links to homepage
36
+ - [ ] Primary navigation is present and functional on all pages
37
+ - [ ] Footer is present with expected links (privacy, terms, contact)
38
+ - [ ] Breadcrumbs reflect the current location (if applicable)
39
+ - [ ] 404 page exists and is user-friendly (not a raw server error)
40
+ - [ ] 500 error page exists and is user-friendly
41
+
42
+ ### Authentication Flows (if applicable)
43
+ - [ ] Registration flow completes end to end
44
+ - [ ] Login flow works with valid credentials
45
+ - [ ] Logout clears session and redirects appropriately
46
+ - [ ] Password reset flow sends email and allows reset
47
+ - [ ] Protected pages redirect to login when unauthenticated
48
+
49
+ ### Empty States
50
+ - [ ] Empty list/table shows a helpful message (not a blank page)
51
+ - [ ] Empty search results suggest alternatives or show a clear message
52
+ - [ ] New user with no data sees onboarding or guidance, not emptiness
53
+
54
+ ### Content Essentials
55
+ - [ ] No placeholder text (lorem ipsum, "TODO", "TBD")
56
+ - [ ] No broken images or missing media
57
+ - [ ] Copyright year is current
58
+ - [ ] Legal pages are linked and accessible (privacy policy, terms of service)
59
+
60
+ ### Functional Basics
61
+ - [ ] All forms submit and provide feedback (success or error)
62
+ - [ ] All buttons and links lead somewhere (no dead ends)
63
+ - [ ] Loading states exist for async operations (no frozen UI)
64
+ - [ ] Back button behavior is consistent and does not break state
65
+
66
+ ## Data Integrity Checks
67
+
68
+ > After every state-changing action (create, update, delete, submit), verify these:
69
+
70
+ 1. **Persistence** -- Reload the page. Does the change survive? Is the data still correct?
71
+ 2. **Reflection** -- Does the change appear everywhere it should? (List views, detail views, summaries, exports.)
72
+ 3. **Consistency** -- Do calculated values (totals, counts, timestamps) update correctly?
73
+ 4. **Reversibility** -- If the action can be undone (delete, cancel), does the system return to a clean state?
74
+ 5. **Concurrency** -- If two users (or two tabs) act on the same data, does the system handle it without silent data loss?
75
+ 6. **Cascade** -- If the changed item is referenced elsewhere (e.g., a category that contains products), are related items updated or handled?
76
+
77
+ ## Cross-Feature Journeys
78
+
79
+ > Test these generic end-to-end flows that cross multiple features. Bugs often hide at the seams between features.
80
+
81
+ ### Journey 1: New User Onboarding
82
+ `Register -> Verify Email -> Login -> Complete Profile -> Use Primary Feature -> Logout`
83
+ - Verify: session persists correctly through each step, data entered in earlier steps is visible later, logout clears everything.
84
+
85
+ ### Journey 2: Content Lifecycle
86
+ `Create Item -> View in List -> Edit Item -> Verify Changes -> Delete Item -> Verify Removal`
87
+ - Verify: item appears in all relevant views after creation, edits persist after reload, deletion removes item from all views and does not leave orphaned references.
88
+
89
+ ### Journey 3: Error Recovery
90
+ `Start Action -> Force Error (disconnect network, submit invalid data) -> See Error State -> Retry -> Complete Successfully`
91
+ - Verify: error messages are clear, no data is lost or duplicated on retry, system returns to a consistent state.
92
+
93
+ ## Must-Test Patterns
94
+
95
+ ### Forms
96
+ - Required field validation (submit empty, partial, complete)
97
+ - Input boundary values (min/max length, special characters, Unicode)
98
+ - Email and URL format validation
99
+ - Date and number field constraints
100
+ - Form submission with network interruption
101
+ - Double-submit prevention
102
+ - Tab order through form fields
103
+ - Error message clarity and placement
104
+
105
+ ### Navigation
106
+ - All internal links resolve (no 404s)
107
+ - Browser back/forward behavior is consistent
108
+ - Deep linking and bookmarking work
109
+ - Breadcrumbs reflect actual location
110
+ - Menu states (open, close, hover, focus)
111
+ - Navigation on mobile (hamburger menu, touch targets)
112
+
113
+ ### Authentication
114
+ - Login with valid and invalid credentials
115
+ - Password reset flow end to end
116
+ - Session timeout behavior
117
+ - Concurrent session handling
118
+ - Remember me functionality
119
+ - Logout clears session data
120
+ - Protected pages redirect to login
121
+
122
+ ### Error Handling
123
+ - 404 page for invalid URLs
124
+ - Server error pages (500) are user-friendly
125
+ - Network timeout behavior
126
+ - Invalid input error messages are helpful
127
+ - Form validation errors do not lose user input
128
+ - API failure graceful degradation
129
+
130
+ ### Responsive Design
131
+ - Layout at 320px, 768px, 1024px, 1440px widths
132
+ - Images scale without distortion
133
+ - Text remains readable at all sizes
134
+ - Touch targets are at least 44x44px on mobile
135
+ - No horizontal scrolling on mobile
136
+ - Modals and popups work on small screens
137
+
138
+ ### Accessibility
139
+ - All images have alt text
140
+ - Form fields have associated labels
141
+ - Focus indicators are visible
142
+ - Color is not the only indicator of state
143
+ - Page has a logical heading hierarchy (h1-h6)
144
+ - Skip navigation link is present
145
+ - ARIA roles are used correctly where needed
146
+
147
+ ### Performance
148
+ - Initial page load under 3 seconds
149
+ - Time to interactive is reasonable
150
+ - Large images are optimized
151
+ - No excessive DOM size
152
+ - No memory leaks on repeated interactions
153
+ - Lazy loading for below-the-fold content
154
+
155
+ ### SEO
156
+ - Each page has a unique title tag
157
+ - Meta descriptions are present and descriptive
158
+ - Heading hierarchy is semantic
159
+ - Canonical URLs are set
160
+ - Robots.txt and sitemap.xml are accessible
161
+ - Open Graph and Twitter Card meta tags present
162
+
163
+ ## Common Bugs
164
+
165
+ - Broken links after content updates
166
+ - Form submission succeeds silently without confirmation
167
+ - Session expires during long form entry, losing data
168
+ - Mobile menu overlaps content
169
+ - Inconsistent error message styles
170
+ - Missing loading states causing double clicks
171
+ - Stale cache showing outdated content
172
+ - Z-index issues with overlapping modals and dropdowns
173
+ - Autofill conflicts with custom input components
174
+ - Scroll position not restored on back navigation
175
+
176
+ ## Compliance Requirements
177
+
178
+ - WCAG 2.1 Level AA (baseline accessibility)
179
+ - GDPR cookie consent if applicable
180
+ - HTTPS everywhere
181
+ - Privacy policy and terms of service links accessible
@@ -0,0 +1,192 @@
1
+ # Domain: E-Commerce
2
+
3
+ ## Priority Areas
4
+
5
+ 1. **Checkout Flow** - Cart to payment confirmation must be rock solid
6
+ 2. **Payment Processing** - All payment methods work, edge cases handled
7
+ 3. **Product Catalog** - Search, filter, sort, and display accuracy
8
+ 4. **Pricing & Calculations** - Discounts, coupons, tax, and totals are precise
9
+ 5. **Inventory Management** - Stock levels, availability, and oversell prevention
10
+ 6. **User Accounts** - Registration, profiles, order history, saved addresses
11
+ 7. **Shipping & Returns** - Rate calculation, tracking, return/refund flows
12
+
13
+ ## Feature Risk Ranking
14
+
15
+ | Tier | Features | Rationale |
16
+ |------|-------------------------------------------------------|------------------------------------------------------------------|
17
+ | P0 | Checkout, payment processing, cart, pricing/totals | Direct revenue. A broken checkout = lost sales. A pricing bug = financial loss or legal liability. |
18
+ | P1 | Product catalog, search, authentication | Users cannot buy what they cannot find. Auth gates the account experience. |
19
+ | P2 | Reviews & ratings, wishlist, filters & sort | Enhance discovery and trust but do not block purchase. |
20
+ | P3 | About page, contact page, social media links | Informational. Rarely blocks a transaction. |
21
+
22
+ ## Completeness Checklist
23
+
24
+ > Minimum features an e-commerce site should have. Verify these exist and function before deep-testing.
25
+
26
+ - [ ] Cart displays items with name, image, price, and quantity
27
+ - [ ] Cart quantity can be increased, decreased, and item removed
28
+ - [ ] Empty cart shows a helpful message and a link to continue shopping
29
+ - [ ] Delivery/shipping address form with validation
30
+ - [ ] Payment method selector (at least one method functional)
31
+ - [ ] Order summary visible before final confirmation with itemized totals
32
+ - [ ] Order confirmation page with a unique order ID
33
+ - [ ] Confirmation email or receipt sent after purchase
34
+ - [ ] Order history accessible from user account
35
+ - [ ] Guest checkout option (or clear account creation prompt)
36
+
37
+ ## Data Integrity Checks
38
+
39
+ > After every state-changing action in e-commerce, verify these calculations and data flows.
40
+
41
+ 1. **Item price x quantity = line total** -- Check for every line item in the cart and in the order confirmation. Watch for rounding issues with discounts.
42
+ 2. **All line totals + shipping + tax - discounts = order total** -- Verify on the cart page, checkout summary, confirmation page, and confirmation email. All four should match.
43
+ 3. **Inventory decremented after purchase** -- If stock count is visible, verify it decreases by the purchased quantity. Verify out-of-stock messaging appears when inventory hits zero.
44
+ 4. **Order appears in history** -- After completing checkout, the order should immediately appear in the user's order history with correct items, quantities, totals, and status.
45
+ 5. **Coupon/discount applied correctly** -- Discount shows as a line item, subtotal adjusts, and the discount does not apply to items it should not (e.g., excluded categories).
46
+ 6. **Price consistency** -- The price on the product page, in the cart, at checkout, and on the confirmation must all match (accounting for any discounts applied).
47
+
48
+ ## Cross-Feature Journeys
49
+
50
+ > These end-to-end flows cross multiple features. Bugs hide at the boundaries.
51
+
52
+ ### Journey 1: Browse to Purchase
53
+ `Browse Catalog -> Add to Cart -> Proceed to Checkout -> Enter Shipping -> Select Payment -> Confirm Order -> View Order History`
54
+ - Verify: item details persist from catalog through confirmation, totals are correct at every step, order appears in history with correct status.
55
+
56
+ ### Journey 2: Search to Purchase
57
+ `Search for Product -> Apply Filters -> Open Product Detail -> Select Variant -> Add to Cart -> Checkout`
58
+ - Verify: search results match filters, selected variant (size/color) carries into cart correctly, price reflects variant choice.
59
+
60
+ ### Journey 3: Full Account Lifecycle
61
+ `Register -> Login -> Browse -> Add to Cart -> Purchase -> Logout -> Login Again -> View Order History`
62
+ - Verify: registration completes, cart persists across login, order history is accessible after re-login, all data is consistent.
63
+
64
+ ## Must-Test Patterns
65
+
66
+ ### Product Catalog
67
+ - Search returns relevant results for exact and partial matches
68
+ - Filters narrow results correctly (price range, category, size, color)
69
+ - Sort options work (price low-high, high-low, newest, rating)
70
+ - Product images load and zoom functions work
71
+ - Product variants (size, color) update price and availability
72
+ - Out-of-stock items display clear messaging
73
+ - Pagination or infinite scroll loads correctly
74
+ - Category navigation reflects accurate product counts
75
+ - Recently viewed and related products display correctly
76
+
77
+ ### Search
78
+ - Exact product name search
79
+ - Misspelled search terms (fuzzy matching)
80
+ - Search with special characters
81
+ - Empty search submission
82
+ - Search suggestions and autocomplete
83
+ - No results page with helpful alternatives
84
+ - Search within category or filtered results
85
+
86
+ ### Cart
87
+ - Add single and multiple items
88
+ - Update quantity (increase, decrease, zero, negative, decimal)
89
+ - Remove items from cart
90
+ - Cart persists across sessions (logged in)
91
+ - Cart persists across sessions (guest via cookie)
92
+ - Cart reflects current prices (not stale cached prices)
93
+ - Cart handles out-of-stock items added before stock depletion
94
+ - Maximum quantity limits enforced
95
+ - Cart total updates in real time
96
+ - Empty cart state displays correctly
97
+ - Cart icon badge count updates immediately
98
+
99
+ ### Checkout
100
+ - Guest checkout flow end to end
101
+ - Registered user checkout with saved details
102
+ - Address validation and autocomplete
103
+ - Shipping method selection updates total
104
+ - Order summary accuracy before payment
105
+ - Back button behavior during checkout
106
+ - Checkout with expired session
107
+ - Checkout with empty cart (direct URL access)
108
+ - Order confirmation page with correct details
109
+ - Confirmation email sent with correct content
110
+
111
+ ### Payments
112
+ - Credit/debit card processing (valid card)
113
+ - Credit card with invalid number, expired date, wrong CVV
114
+ - PayPal or third-party payment redirect and return
115
+ - Payment failure and retry flow
116
+ - Insufficient funds handling
117
+ - 3D Secure authentication flow
118
+ - Saved payment methods selection
119
+ - Payment timeout handling (gateway slow response)
120
+ - Refund to original payment method
121
+ - Currency display matches user locale
122
+
123
+ ### Shipping
124
+ - Shipping rate calculation by weight, destination, method
125
+ - Free shipping threshold display and application
126
+ - Multiple shipping addresses (split shipment)
127
+ - International shipping with customs information
128
+ - Estimated delivery date accuracy
129
+ - Shipping to PO boxes and military addresses
130
+ - Express vs standard shipping option differences
131
+ - Shipping cost updates when address changes
132
+
133
+ ### Returns & Refunds
134
+ - Return request initiation within policy window
135
+ - Return request outside policy window (should be denied)
136
+ - Return label generation
137
+ - Refund processing and confirmation
138
+ - Partial returns from multi-item orders
139
+ - Exchange flow for different size or color
140
+ - Return status tracking
141
+
142
+ ### Pricing
143
+ - Regular price display
144
+ - Sale price with original price strikethrough
145
+ - Percentage and fixed amount discount application
146
+ - Coupon code entry (valid, invalid, expired, case sensitivity)
147
+ - Stacking rules for multiple discounts
148
+ - Tax calculation by jurisdiction
149
+ - Bundle pricing accuracy
150
+ - Bulk pricing tiers
151
+ - Currency conversion if multi-currency supported
152
+ - Price updates when variant is changed
153
+
154
+ ### User Accounts
155
+ - Registration with email verification
156
+ - Social login (Google, Facebook, Apple)
157
+ - Profile update (name, email, password)
158
+ - Address book management (add, edit, delete, set default)
159
+ - Order history with status and details
160
+ - Reorder from previous order
161
+ - Wishlist add, remove, move to cart
162
+ - Account deletion and data removal
163
+
164
+ ### Reviews & Ratings
165
+ - Submit a review with star rating and text
166
+ - Review with photo upload
167
+ - Review moderation (pending state)
168
+ - Sort reviews by date, rating, helpfulness
169
+ - Average rating calculation accuracy
170
+ - Review filtering by star count
171
+ - Verified purchase badge display
172
+
173
+ ## Common Bugs
174
+
175
+ - **Cart calculation errors** - Rounding issues with discounts, tax computed on wrong subtotal, quantity multiplier off by one
176
+ - **Checkout flow breaks** - Back button causes duplicate order, session timeout loses cart, address validation rejects valid addresses
177
+ - **Payment gateway timeouts** - Order created but payment status unknown, user charged but order not confirmed, retry creates duplicate charge
178
+ - **Inventory sync issues** - Item shows in stock but fails at checkout, overselling due to race condition, stock not restored on cancelled order
179
+ - **Coupon stacking exploits** - Applying multiple exclusive coupons, coupon applied after order total goes negative, expired coupon still works via direct URL
180
+ - **Price display mismatches** - Cart shows different price than product page, currency rounding differs between pages, tax-inclusive vs exclusive confusion
181
+ - **Search relevance issues** - Exact match not in top results, filters reset after pagination, zero results for valid product names
182
+ - **Account edge cases** - Guest checkout email conflicts with existing account, social login does not merge with email account, order history missing after password reset
183
+ - **Mobile checkout** - Payment form keyboard covers input, autofill breaks card number formatting, touch targets too small on shipping options
184
+
185
+ ## Compliance Requirements
186
+
187
+ - **PCI DSS** - Payment card data handled securely, no card numbers in logs or URLs
188
+ - **GDPR** - Cookie consent, data export, right to deletion, privacy policy
189
+ - **Consumer protection** - Clear return policy, accurate product descriptions, transparent pricing
190
+ - **Accessibility (WCAG 2.1 AA)** - Full checkout flow usable by keyboard and screen reader
191
+ - **Tax compliance** - Correct tax rates by jurisdiction, tax displayed before final purchase
192
+ - **Email compliance** - CAN-SPAM Act for marketing emails, transactional email opt-out separation
@@ -0,0 +1,200 @@
1
+ # Domain: Fintech (Financial Technology)
2
+
3
+ ## Priority Areas
4
+
5
+ 1. **Calculation Accuracy** - Interest, fees, exchange rates, and balances must be exact
6
+ 2. **Transaction Flows** - Transfers, payments, and settlements complete reliably
7
+ 3. **Security** - Authentication, encryption, session management, fraud prevention
8
+ 4. **Regulatory Compliance** - KYC, AML, PCI DSS, and jurisdiction-specific rules
9
+ 5. **Audit Trails** - Every action logged with timestamp, user, and context
10
+ 6. **Data Precision** - Decimal handling, rounding rules, currency formatting
11
+ 7. **Error Handling** - Financial operations fail safely with clear recovery paths
12
+
13
+ ## Feature Risk Ranking
14
+
15
+ | Tier | Features | Rationale |
16
+ |------|-------------------------------------------------------------------|------------------------------------------------------------------|
17
+ | P0 | Transfers, payments, balance calculations, authentication/security | Money movement and security are existential. A bug here = financial loss, fraud, or regulatory action. |
18
+ | P1 | Account management, transaction history, loan/credit features | Core daily workflows. Users depend on accurate history and account control. |
19
+ | P2 | Bill pay, statements, contact/profile info | Important but secondary. Failure is inconvenient, not catastrophic. |
20
+ | P3 | News/market updates, about page, general settings | Informational. Does not impact financial operations or security. |
21
+
22
+ ## Completeness Checklist
23
+
24
+ > Minimum features a fintech application should have. Verify these exist and function before deep-testing.
25
+
26
+ - [ ] Transaction receipt generated for every completed transaction
27
+ - [ ] Unique transaction ID assigned and displayed for every transaction
28
+ - [ ] Audit trail present -- every financial action logged with timestamp, user, amount, and result
29
+ - [ ] Balance reconciliation -- displayed balance matches the sum of all transactions
30
+ - [ ] Two-factor authentication available and enforced for sensitive operations
31
+ - [ ] Session timeout configured (shorter than general web apps -- typically 5-15 minutes of inactivity)
32
+ - [ ] Account lockout after excessive failed login or PIN attempts
33
+ - [ ] PII masking -- account numbers, SSN, and other sensitive data partially masked in UI
34
+ - [ ] Transaction history with search, filter, and date range
35
+ - [ ] Statement generation (monthly or custom date range)
36
+
37
+ ## Data Integrity Checks
38
+
39
+ > Financial data integrity is non-negotiable. After every state-changing action, verify these to the penny.
40
+
41
+ 1. **Source account debited = destination account credited** -- For every transfer, the exact amount debited from the source must equal the exact amount credited to the destination (accounting for any documented fees). Check both accounts. No rounding differences.
42
+ 2. **Transaction appears in BOTH accounts' history** -- After a transfer between two accounts, the transaction must appear in the history of both the sending and receiving account with correct amounts, timestamps, and reference IDs.
43
+ 3. **Running balance matches after every transaction** -- After any transaction (deposit, withdrawal, transfer, fee, interest), recalculate: previous balance +/- transaction amount = new balance. This must hold for every single transaction in the history.
44
+ 4. **Loan terms calculate correctly** -- Monthly payment, total interest, and total cost should match the amortization schedule. Verify with an independent calculator for at least one scenario.
45
+ 5. **Fees applied correctly** -- Any fees (transfer fees, maintenance fees, overdraft fees) should match the published fee schedule and appear as distinct line items in the transaction history.
46
+ 6. **Currency conversions are traceable** -- For cross-currency transactions, the exchange rate used, the source amount, the destination amount, and any conversion fee should all be visible and mathematically consistent.
47
+
48
+ ## Cross-Feature Journeys
49
+
50
+ > End-to-end flows that cross feature boundaries. Financial bugs at the seams can cause real monetary loss.
51
+
52
+ ### Journey 1: Full Banking Workflow
53
+ `Register -> Login -> Open Account -> Transfer Funds -> Verify Both Balances -> Pay Bill -> Check Transaction History`
54
+ - Verify: registration completes identity verification, account shows correct opening balance, transfer debits and credits exact amounts, both account balances are correct, bill payment appears in history with correct payee and amount.
55
+
56
+ ### Journey 2: Transaction Verification and Export
57
+ `Login -> Transfer Funds -> View Transaction History -> Verify Amounts Match -> Export Statement -> Verify Statement Matches History`
58
+ - Verify: transfer completes with confirmation and receipt, transaction history shows the transfer with correct details, amounts in history match the transfer confirmation, exported statement contains the same data as the on-screen history.
59
+
60
+ ### Journey 3: Security and Session Management
61
+ `Login -> Start Transfer -> Session Times Out -> Re-authenticate -> Complete Transfer -> Verify No Duplicate`
62
+ - Verify: session timeout interrupts the flow gracefully, re-authentication does not lose the in-progress transfer (or clearly notifies the user), no duplicate transaction is created, final balance is correct.
63
+
64
+ ## Must-Test Patterns
65
+
66
+ ### Calculations
67
+ - Interest calculation accuracy (simple, compound, daily accrual)
68
+ - Fee computation (flat, percentage, tiered, capped)
69
+ - Exchange rate conversion with correct rounding
70
+ - Loan amortization schedule accuracy
71
+ - APR and APY display correctness
72
+ - Tax withholding calculations
73
+ - Dividend and yield computations
74
+ - Split transactions and partial payments
75
+ - Rounding rules match regulatory requirements (banker's rounding)
76
+ - Calculations with very large amounts (millions, billions)
77
+ - Calculations with very small amounts (fractions of a cent)
78
+ - Multi-currency conversions with intermediary currency
79
+
80
+ ### Transaction Flows
81
+ - Successful money transfer between accounts
82
+ - Transfer with insufficient funds (rejected gracefully)
83
+ - Transfer at exact balance amount (edge case)
84
+ - Scheduled and recurring transaction execution
85
+ - Transaction cancellation before processing
86
+ - Transaction reversal after completion
87
+ - Pending transaction status and timeline
88
+ - Failed transaction with automatic retry
89
+ - Duplicate transaction prevention (idempotency)
90
+ - Concurrent transactions on same account (race conditions)
91
+ - Cross-border transactions with currency conversion
92
+ - Transaction timeout handling (what happens to funds)
93
+ - Batch transaction processing
94
+ - Transaction receipt and confirmation generation
95
+ - Real-time balance update after transaction
96
+
97
+ ### Account Management
98
+ - Account creation with identity verification
99
+ - Multiple account types (checking, savings, investment)
100
+ - Account linking (external bank connections)
101
+ - Account statements (monthly, custom date range)
102
+ - Account closure process and final balance handling
103
+ - Joint account management
104
+ - Beneficiary management (add, edit, remove)
105
+ - Account freeze and unfreeze
106
+ - Balance inquiry accuracy (available vs ledger balance)
107
+ - Account limits (daily, monthly, per-transaction)
108
+
109
+ ### Security
110
+ - Two-factor authentication setup (TOTP, SMS, hardware key)
111
+ - 2FA required for high-value transactions
112
+ - Session timeout appropriate for financial context (shorter than general apps)
113
+ - Session invalidation on password change
114
+ - Device fingerprinting and trusted device management
115
+ - IP-based anomaly detection alerts
116
+ - Brute force protection on login and PIN entry
117
+ - Encryption of sensitive data at rest and in transit
118
+ - Secure password requirements (length, complexity)
119
+ - Biometric authentication (fingerprint, face ID) on mobile
120
+ - PIN entry for transaction confirmation
121
+ - Security questions as backup recovery method
122
+ - Account lockout after excessive failed attempts
123
+ - Unlock procedure (identity reverification)
124
+ - Phishing detection warnings on suspicious links
125
+
126
+ ### Regulatory Compliance
127
+ - KYC (Know Your Customer) identity verification flow
128
+ - Document upload for ID verification (passport, driver license)
129
+ - Address verification (utility bill, bank statement)
130
+ - AML (Anti-Money Laundering) transaction monitoring
131
+ - Suspicious Activity Report (SAR) generation triggers
132
+ - OFAC sanctions list screening
133
+ - Transaction reporting thresholds (CTR for $10,000+)
134
+ - Consumer disclosure documents (Truth in Lending, fee schedules)
135
+ - Regulation E compliance (electronic fund transfer rights)
136
+ - PSD2 Strong Customer Authentication (EU)
137
+ - Open Banking API compliance (if applicable)
138
+
139
+ ### Audit Trails
140
+ - Login and logout events logged
141
+ - Every transaction logged with full details
142
+ - Permission changes logged
143
+ - Account modification events logged
144
+ - Failed authentication attempts logged
145
+ - Export of audit log for compliance review
146
+ - Audit log tamper protection (immutable entries)
147
+ - Audit log retention meets regulatory minimums
148
+ - Audit log search and filter by date, user, action type
149
+ - Administrative actions logged separately
150
+
151
+ ### Data Precision
152
+ - Currency amounts stored with correct decimal places (2 for USD, 0 for JPY, 8 for crypto)
153
+ - No floating-point arithmetic for currency (use decimal or integer cents)
154
+ - Rounding direction consistent (round half even for financial)
155
+ - Negative amounts handled correctly (debits, fees, reversals)
156
+ - Currency formatting matches locale (symbol, separator, decimal)
157
+ - Percentage displays with appropriate precision
158
+ - Large number formatting (thousand separators)
159
+ - Zero amount transactions handled correctly
160
+ - Display precision matches calculation precision (no hidden rounding)
161
+
162
+ ### Error Handling for Financial Operations
163
+ - Insufficient funds returns clear error with current balance
164
+ - Daily limit exceeded shows limit and reset time
165
+ - Invalid recipient account returns specific error
166
+ - Network failure during transaction shows clear status (not "unknown")
167
+ - Timeout during payment does not result in lost funds
168
+ - Partial failure in batch operations identifies which items failed
169
+ - Concurrent modification conflict resolution
170
+ - Expired session during transaction saves draft or clearly notifies
171
+ - Payment gateway errors mapped to user-friendly messages
172
+ - Recovery flow after failed transaction (retry, contact support)
173
+
174
+ ## Common Bugs
175
+
176
+ - **Floating-point arithmetic errors** - Using float instead of decimal for currency results in rounding drift, totals off by 0.01 after many operations, percentage fee calculates to incorrect amount
177
+ - **Race conditions on balance** - Two concurrent withdrawals both succeed when only one should, balance goes negative briefly before correction, pending transactions not considered in available balance
178
+ - **Transaction state inconsistencies** - Sender debited but receiver not credited (half-completed transfer), transaction status shows "completed" while still pending at bank, cancelled transaction still processes
179
+ - **Rounding discrepancy** - Statement total does not match sum of individual transactions, currency conversion rounds differently on different screens, tax calculation rounding differs from display
180
+ - **Security session issues** - Session not invalidated on 2FA change, token replay attack possible, device trust persists after account compromise, PIN attempt counter resets on app restart
181
+ - **Timezone-related bugs** - Interest accrual calculated wrong across timezone boundaries, scheduled payment executes on wrong day, statement date range off by one day
182
+ - **Currency display errors** - Negative amounts shown without minus sign, wrong currency symbol after locale change, thousand separator used as decimal in some locales
183
+ - **Compliance gaps** - KYC check can be bypassed by direct API call, transaction below threshold split into multiple to avoid reporting, audit log missing entries for bulk operations
184
+ - **Notification failures** - Large transaction alert not sent, fraud alert delayed, duplicate notifications on retry
185
+
186
+ ## Compliance Requirements
187
+
188
+ - **PCI DSS** - Payment card data encryption, no card numbers in logs, network segmentation, quarterly vulnerability scans
189
+ - **SOX (Sarbanes-Oxley)** - Financial reporting accuracy, internal controls, audit trail integrity
190
+ - **KYC / AML** - Customer identification program, ongoing monitoring, suspicious activity reporting
191
+ - **GLBA (Gramm-Leach-Bliley)** - Financial privacy, safeguards rule, pretexting protection
192
+ - **Regulation E** - Electronic fund transfer error resolution, unauthorized transaction liability limits
193
+ - **PSD2 (EU)** - Strong Customer Authentication, open banking API access, transaction risk analysis
194
+ - **GDPR** - Data minimization, right to erasure (balanced with record retention requirements), consent management
195
+ - **CCPA** - Consumer data access and deletion rights
196
+ - **BSA (Bank Secrecy Act)** - Currency Transaction Reports, recordkeeping requirements
197
+ - **OFAC Sanctions** - Screening all parties against sanctions lists before transactions
198
+ - **SOC 2 Type II** - Security, availability, and confidentiality controls audited
199
+ - **Accessibility (WCAG 2.1 AA)** - All financial workflows accessible, including transaction flows and statements
200
+ - **Data Residency** - Financial data stored in jurisdictions meeting regulatory requirements