claude-mpm 5.4.59__py3-none-any.whl → 5.4.62__py3-none-any.whl
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.
Potentially problematic release.
This version of claude-mpm might be problematic. Click here for more details.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +5 -0
- claude_mpm/scripts/start_activity_logging.py +0 -0
- claude_mpm/services/agents/deployment/agent_template_builder.py +8 -0
- claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
- claude_mpm/skills/bundled/collaboration/git-worktrees.md +317 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
- claude_mpm/skills/bundled/collaboration/stacked-prs.md +251 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/INTEGRATION.md +611 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/README.md +596 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/SKILL.md +260 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/examples/nextjs-env-structure.md +315 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/frameworks.md +436 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/security.md +433 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/synchronization.md +452 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/troubleshooting.md +404 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/references/validation.md +420 -0
- claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
- claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
- claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
- claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
- claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
- claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
- claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
- claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
- claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
- claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
- claude_mpm/skills/bundled/pm/pm-delegation-patterns/SKILL.md +167 -0
- claude_mpm/skills/bundled/pm/pm-git-file-tracking/SKILL.md +113 -0
- claude_mpm/skills/bundled/pm/pm-pr-workflow/SKILL.md +124 -0
- claude_mpm/skills/bundled/pm/pm-ticketing-integration/SKILL.md +154 -0
- claude_mpm/skills/bundled/pm/pm-verification-protocols/SKILL.md +198 -0
- claude_mpm/skills/bundled/react/flexlayout-react.md +742 -0
- claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
- claude_mpm/skills/bundled/tauri/tauri-async-patterns.md +495 -0
- claude_mpm/skills/bundled/tauri/tauri-build-deploy.md +599 -0
- claude_mpm/skills/bundled/tauri/tauri-command-patterns.md +535 -0
- claude_mpm/skills/bundled/tauri/tauri-error-handling.md +613 -0
- claude_mpm/skills/bundled/tauri/tauri-event-system.md +648 -0
- claude_mpm/skills/bundled/tauri/tauri-file-system.md +673 -0
- claude_mpm/skills/bundled/tauri/tauri-frontend-integration.md +767 -0
- claude_mpm/skills/bundled/tauri/tauri-performance.md +669 -0
- claude_mpm/skills/bundled/tauri/tauri-state-management.md +573 -0
- claude_mpm/skills/bundled/tauri/tauri-testing.md +384 -0
- claude_mpm/skills/bundled/tauri/tauri-window-management.md +628 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
- claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/SKILL.md +458 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/examples/example-inspection-report.md +411 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/references/assertion-quality.md +317 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/references/inspection-checklist.md +270 -0
- claude_mpm/skills/bundled/testing/test-quality-inspector/references/red-flags.md +436 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
- claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
- claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
- claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
- claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
- claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
- claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/METADATA +1 -1
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/RECORD +127 -10
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/WHEEL +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/entry_points.txt +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/licenses/LICENSE-FAQ.md +0 -0
- {claude_mpm-5.4.59.dist-info → claude_mpm-5.4.62.dist-info}/top_level.txt +0 -0
claude_mpm/skills/bundled/testing/test-quality-inspector/examples/example-inspection-report.md
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
# Example Test Inspection Report
|
|
2
|
+
|
|
3
|
+
## Scenario: User Registration Feature
|
|
4
|
+
|
|
5
|
+
### Engineer's Test Suite
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
# test_user_registration.py
|
|
9
|
+
|
|
10
|
+
def test_user_creation():
|
|
11
|
+
"""Test user creation"""
|
|
12
|
+
user = create_user("test@example.com", "password123")
|
|
13
|
+
assert user
|
|
14
|
+
|
|
15
|
+
def test_login():
|
|
16
|
+
"""Test login"""
|
|
17
|
+
user = create_user("test@example.com", "password123")
|
|
18
|
+
result = login("test@example.com", "password123")
|
|
19
|
+
assert result
|
|
20
|
+
|
|
21
|
+
def test_duplicate_email():
|
|
22
|
+
"""Test duplicate email"""
|
|
23
|
+
create_user("test@example.com", "password123")
|
|
24
|
+
user2 = create_user("test@example.com", "password456")
|
|
25
|
+
assert user2
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## QA Inspection Report
|
|
31
|
+
|
|
32
|
+
### Test 1: test_user_creation()
|
|
33
|
+
|
|
34
|
+
**Claimed Intent:** Test user creation
|
|
35
|
+
**Actually Tests:** Object instantiation only
|
|
36
|
+
|
|
37
|
+
#### Issues Found
|
|
38
|
+
|
|
39
|
+
🔴 **CRITICAL: Worthless Assertion**
|
|
40
|
+
```python
|
|
41
|
+
assert user # Line 5
|
|
42
|
+
```
|
|
43
|
+
- Would pass with corrupt data
|
|
44
|
+
- Would pass with wrong email
|
|
45
|
+
- Would pass with invalid password hash
|
|
46
|
+
- Would pass if database save failed
|
|
47
|
+
|
|
48
|
+
**Mental Debug:** User object with garbage data would pass this test.
|
|
49
|
+
|
|
50
|
+
🟠 **HIGH: Missing Validation Tests**
|
|
51
|
+
- No test for invalid email format
|
|
52
|
+
- No test for weak password
|
|
53
|
+
- No test for duplicate email (separate test exists but broken)
|
|
54
|
+
- No test for SQL injection in email
|
|
55
|
+
|
|
56
|
+
🟠 **HIGH: No Persistence Verification**
|
|
57
|
+
- Test doesn't verify user is saved to database
|
|
58
|
+
- Test doesn't verify user can be retrieved
|
|
59
|
+
- Transaction might be rolled back
|
|
60
|
+
|
|
61
|
+
🟡 **MEDIUM: Vague Test Name**
|
|
62
|
+
- "test_user_creation" doesn't describe what should happen
|
|
63
|
+
- Better: "test_user_creation_with_valid_data_persists_to_database"
|
|
64
|
+
|
|
65
|
+
#### Suggested Improvements
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
def test_user_creation_with_valid_data_persists_to_database():
|
|
69
|
+
"""Creating a user with valid email and password should:
|
|
70
|
+
1. Create user object with correct attributes
|
|
71
|
+
2. Save to database
|
|
72
|
+
3. Hash password (not store plaintext)
|
|
73
|
+
4. Set default role and active status
|
|
74
|
+
"""
|
|
75
|
+
email = "test@example.com"
|
|
76
|
+
password = "SecurePass123!"
|
|
77
|
+
|
|
78
|
+
user = create_user(email, password)
|
|
79
|
+
|
|
80
|
+
# Verify user object
|
|
81
|
+
assert user.id is not None, "User should have an ID after creation"
|
|
82
|
+
assert user.email == email, "Email should match input"
|
|
83
|
+
assert user.is_active is True, "New users should be active by default"
|
|
84
|
+
assert user.role == "user", "New users should have 'user' role"
|
|
85
|
+
assert user.created_at is not None, "Created timestamp should be set"
|
|
86
|
+
|
|
87
|
+
# Verify password is hashed, not plaintext
|
|
88
|
+
assert user.password_hash != password, "Password should be hashed"
|
|
89
|
+
assert len(user.password_hash) > 50, "Password hash should be substantial"
|
|
90
|
+
|
|
91
|
+
# Verify persistence
|
|
92
|
+
retrieved_user = User.get_by_email(email)
|
|
93
|
+
assert retrieved_user is not None, "User should be retrievable from database"
|
|
94
|
+
assert retrieved_user.id == user.id, "Retrieved user should match created user"
|
|
95
|
+
|
|
96
|
+
def test_user_creation_with_invalid_email_format_raises_validation_error():
|
|
97
|
+
"""Creating a user with malformed email should raise ValidationError"""
|
|
98
|
+
invalid_emails = [
|
|
99
|
+
"not-an-email",
|
|
100
|
+
"@example.com",
|
|
101
|
+
"test@",
|
|
102
|
+
"test space@example.com",
|
|
103
|
+
"",
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
for invalid_email in invalid_emails:
|
|
107
|
+
with pytest.raises(ValidationError) as exc:
|
|
108
|
+
create_user(invalid_email, "password123")
|
|
109
|
+
|
|
110
|
+
assert "email" in str(exc.value).lower()
|
|
111
|
+
assert "invalid" in str(exc.value).lower()
|
|
112
|
+
|
|
113
|
+
def test_user_creation_with_weak_password_raises_validation_error():
|
|
114
|
+
"""Creating a user with weak password should raise ValidationError"""
|
|
115
|
+
weak_passwords = [
|
|
116
|
+
"123", # Too short
|
|
117
|
+
"password", # No numbers
|
|
118
|
+
"12345678", # No letters
|
|
119
|
+
"", # Empty
|
|
120
|
+
]
|
|
121
|
+
|
|
122
|
+
for weak_password in weak_passwords:
|
|
123
|
+
with pytest.raises(ValidationError) as exc:
|
|
124
|
+
create_user("test@example.com", weak_password)
|
|
125
|
+
|
|
126
|
+
assert "password" in str(exc.value).lower()
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Risk Level:** 🔴 CRITICAL
|
|
130
|
+
**Action:** ❌ BLOCK - Core functionality not tested
|
|
131
|
+
**Estimated Fix Time:** 30 minutes
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### Test 2: test_login()
|
|
136
|
+
|
|
137
|
+
**Claimed Intent:** Test login
|
|
138
|
+
**Actually Tests:** Function call completes
|
|
139
|
+
|
|
140
|
+
#### Issues Found
|
|
141
|
+
|
|
142
|
+
🔴 **CRITICAL: Worthless Assertion**
|
|
143
|
+
```python
|
|
144
|
+
assert result # Line 11
|
|
145
|
+
```
|
|
146
|
+
- Passes with any truthy value
|
|
147
|
+
- Doesn't verify session/token
|
|
148
|
+
- Doesn't verify user authentication state
|
|
149
|
+
|
|
150
|
+
🔴 **CRITICAL: Missing Negative Tests**
|
|
151
|
+
- No test for wrong password
|
|
152
|
+
- No test for non-existent user
|
|
153
|
+
- No test for locked account
|
|
154
|
+
- No test for expired credentials
|
|
155
|
+
|
|
156
|
+
🟠 **HIGH: No Session Verification**
|
|
157
|
+
- Doesn't verify authentication token
|
|
158
|
+
- Doesn't verify session expiry
|
|
159
|
+
- Doesn't verify user context in session
|
|
160
|
+
|
|
161
|
+
🟡 **MEDIUM: Test Depends on Previous Test**
|
|
162
|
+
- Creates user in this test
|
|
163
|
+
- Should use fixture or setup
|
|
164
|
+
- Tests should be independent
|
|
165
|
+
|
|
166
|
+
#### Suggested Improvements
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
@pytest.fixture
|
|
170
|
+
def registered_user():
|
|
171
|
+
"""Fixture providing a registered user for login tests"""
|
|
172
|
+
user = create_user("test@example.com", "SecurePass123!")
|
|
173
|
+
yield user
|
|
174
|
+
# Cleanup if needed
|
|
175
|
+
User.delete(user.id)
|
|
176
|
+
|
|
177
|
+
def test_login_with_valid_credentials_returns_authenticated_session(registered_user):
|
|
178
|
+
"""Logging in with correct email and password should:
|
|
179
|
+
1. Return authentication token/session
|
|
180
|
+
2. Set authenticated state
|
|
181
|
+
3. Include user context
|
|
182
|
+
4. Set appropriate expiry
|
|
183
|
+
"""
|
|
184
|
+
session = login(registered_user.email, "SecurePass123!")
|
|
185
|
+
|
|
186
|
+
assert session is not None, "Login should return session"
|
|
187
|
+
assert session.is_authenticated is True, "Session should be authenticated"
|
|
188
|
+
assert session.user_id == registered_user.id, "Session should contain user ID"
|
|
189
|
+
assert session.token is not None, "Session should have authentication token"
|
|
190
|
+
assert session.expires_at > datetime.now(), "Session should have future expiry"
|
|
191
|
+
assert (session.expires_at - datetime.now()).seconds >= 3600, "Session should last at least 1 hour"
|
|
192
|
+
|
|
193
|
+
def test_login_with_wrong_password_raises_authentication_error(registered_user):
|
|
194
|
+
"""Logging in with incorrect password should raise AuthenticationError"""
|
|
195
|
+
with pytest.raises(AuthenticationError) as exc:
|
|
196
|
+
login(registered_user.email, "WrongPassword")
|
|
197
|
+
|
|
198
|
+
assert "Invalid credentials" in str(exc.value)
|
|
199
|
+
assert "password" in str(exc.value).lower()
|
|
200
|
+
|
|
201
|
+
def test_login_with_nonexistent_email_raises_authentication_error():
|
|
202
|
+
"""Logging in with non-existent email should raise AuthenticationError"""
|
|
203
|
+
with pytest.raises(AuthenticationError) as exc:
|
|
204
|
+
login("doesnotexist@example.com", "password")
|
|
205
|
+
|
|
206
|
+
assert "Invalid credentials" in str(exc.value)
|
|
207
|
+
# Note: Don't reveal if email exists (security)
|
|
208
|
+
|
|
209
|
+
def test_login_with_locked_account_raises_account_locked_error(registered_user):
|
|
210
|
+
"""Logging in to locked account should raise AccountLockedError"""
|
|
211
|
+
lock_account(registered_user.id)
|
|
212
|
+
|
|
213
|
+
with pytest.raises(AccountLockedError) as exc:
|
|
214
|
+
login(registered_user.email, "SecurePass123!")
|
|
215
|
+
|
|
216
|
+
assert registered_user.email in str(exc.value)
|
|
217
|
+
|
|
218
|
+
def test_login_with_empty_password_raises_validation_error(registered_user):
|
|
219
|
+
"""Logging in with empty password should raise ValidationError"""
|
|
220
|
+
with pytest.raises(ValidationError) as exc:
|
|
221
|
+
login(registered_user.email, "")
|
|
222
|
+
|
|
223
|
+
assert "password" in str(exc.value).lower()
|
|
224
|
+
assert "required" in str(exc.value).lower()
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Risk Level:** 🔴 CRITICAL
|
|
228
|
+
**Action:** ❌ BLOCK - Authentication not actually tested
|
|
229
|
+
**Estimated Fix Time:** 45 minutes
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### Test 3: test_duplicate_email()
|
|
234
|
+
|
|
235
|
+
**Claimed Intent:** Test duplicate email handling
|
|
236
|
+
**Actually Tests:** Second user creation succeeds (WRONG!)
|
|
237
|
+
|
|
238
|
+
#### Issues Found
|
|
239
|
+
|
|
240
|
+
🔴 **CRITICAL: Test is Backwards**
|
|
241
|
+
```python
|
|
242
|
+
user2 = create_user("test@example.com", "password456")
|
|
243
|
+
assert user2 # Line 17
|
|
244
|
+
```
|
|
245
|
+
- This test expects duplicate creation to SUCCEED
|
|
246
|
+
- It should expect it to FAIL with an error
|
|
247
|
+
- Test passes when it should fail
|
|
248
|
+
- **This is testing the opposite of what's needed**
|
|
249
|
+
|
|
250
|
+
🔴 **CRITICAL: False Confidence**
|
|
251
|
+
- Production bug: duplicate emails are allowed
|
|
252
|
+
- Test claims to verify duplicate prevention
|
|
253
|
+
- Test actually verifies duplicates work
|
|
254
|
+
- QA might approve thinking it's covered
|
|
255
|
+
|
|
256
|
+
🟡 **MEDIUM: Same Email Issue as Other Tests**
|
|
257
|
+
- If this fixed to expect error, needs all improvements from Test 1
|
|
258
|
+
|
|
259
|
+
#### Suggested Fix
|
|
260
|
+
|
|
261
|
+
```python
|
|
262
|
+
def test_create_user_with_duplicate_email_raises_integrity_error():
|
|
263
|
+
"""Creating a user with an email that already exists should:
|
|
264
|
+
1. Raise IntegrityError or ValidationError
|
|
265
|
+
2. Not create duplicate user in database
|
|
266
|
+
3. Preserve existing user data
|
|
267
|
+
"""
|
|
268
|
+
email = "test@example.com"
|
|
269
|
+
|
|
270
|
+
# Create first user
|
|
271
|
+
user1 = create_user(email, "FirstPassword123!")
|
|
272
|
+
initial_count = User.count()
|
|
273
|
+
|
|
274
|
+
# Attempt to create duplicate
|
|
275
|
+
with pytest.raises((IntegrityError, ValidationError)) as exc:
|
|
276
|
+
create_user(email, "SecondPassword456!")
|
|
277
|
+
|
|
278
|
+
assert "email" in str(exc.value).lower()
|
|
279
|
+
assert "duplicate" in str(exc.value).lower() or "exists" in str(exc.value).lower()
|
|
280
|
+
|
|
281
|
+
# Verify no new user created
|
|
282
|
+
assert User.count() == initial_count, "User count should not increase"
|
|
283
|
+
|
|
284
|
+
# Verify original user unchanged
|
|
285
|
+
original_user = User.get_by_email(email)
|
|
286
|
+
assert original_user.id == user1.id, "Original user should be intact"
|
|
287
|
+
assert original_user.verify_password("FirstPassword123!"), "Original password should work"
|
|
288
|
+
assert not original_user.verify_password("SecondPassword456!"), "New password should not work"
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Risk Level:** 🔴 CRITICAL
|
|
292
|
+
**Action:** ❌ BLOCK - Test verifies opposite of requirement
|
|
293
|
+
**Estimated Fix Time:** 20 minutes
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Summary Report
|
|
298
|
+
|
|
299
|
+
### Overall Assessment
|
|
300
|
+
|
|
301
|
+
**Test Suite Quality:** 🔴 FAILING
|
|
302
|
+
|
|
303
|
+
**Critical Issues:** 3
|
|
304
|
+
- Test 1: Doesn't actually test user creation
|
|
305
|
+
- Test 2: Doesn't actually test authentication
|
|
306
|
+
- Test 3: Tests opposite of requirement
|
|
307
|
+
|
|
308
|
+
**Total Tests:** 3
|
|
309
|
+
**Effective Tests:** 0
|
|
310
|
+
**Coverage:** High (claims)
|
|
311
|
+
**Protection:** None (reality)
|
|
312
|
+
|
|
313
|
+
### Risk Assessment
|
|
314
|
+
|
|
315
|
+
**Production Risk:** 🔴 EXTREME
|
|
316
|
+
|
|
317
|
+
Current test suite provides **zero protection** against:
|
|
318
|
+
- Data corruption in user creation
|
|
319
|
+
- Authentication bypass
|
|
320
|
+
- Duplicate email registration
|
|
321
|
+
- Password security issues
|
|
322
|
+
- Database integrity issues
|
|
323
|
+
|
|
324
|
+
**Confidence Level:** 0% - Tests passing means nothing
|
|
325
|
+
|
|
326
|
+
### Required Actions
|
|
327
|
+
|
|
328
|
+
#### Immediate (Block Merge)
|
|
329
|
+
1. Rewrite all three tests with proper assertions
|
|
330
|
+
2. Add negative test cases (12+ tests needed)
|
|
331
|
+
3. Verify tests catch intentional bugs
|
|
332
|
+
4. Add fixture for test user management
|
|
333
|
+
|
|
334
|
+
#### Follow-up (Required for completion)
|
|
335
|
+
1. Add edge case tests (15+ additional tests)
|
|
336
|
+
2. Add integration tests for full registration flow
|
|
337
|
+
3. Add security tests (SQL injection, XSS, etc.)
|
|
338
|
+
4. Add performance tests for registration endpoint
|
|
339
|
+
|
|
340
|
+
### Estimated Timeline
|
|
341
|
+
- Fix critical issues: 2-3 hours
|
|
342
|
+
- Complete test suite: 1 day
|
|
343
|
+
- Review and iteration: 0.5 days
|
|
344
|
+
|
|
345
|
+
**Total:** 1.5-2 days for proper test coverage
|
|
346
|
+
|
|
347
|
+
### Recommendation
|
|
348
|
+
|
|
349
|
+
❌ **BLOCK MERGE**
|
|
350
|
+
|
|
351
|
+
Do not approve this PR. Tests provide false confidence and mask critical bugs.
|
|
352
|
+
|
|
353
|
+
**Evidence:**
|
|
354
|
+
- All tests would pass with completely broken functionality
|
|
355
|
+
- Duplicate email test verifies the opposite of requirements
|
|
356
|
+
- No actual behavior is verified
|
|
357
|
+
|
|
358
|
+
**Next Steps:**
|
|
359
|
+
1. Engineer rewrites tests following examples above
|
|
360
|
+
2. QA re-inspects rewritten tests
|
|
361
|
+
3. QA verifies tests catch intentional bugs
|
|
362
|
+
4. Only then approve merge
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Lessons for Engineer
|
|
367
|
+
|
|
368
|
+
### What Went Wrong
|
|
369
|
+
|
|
370
|
+
1. **Wrote tests after code** - Led to tests that just confirm code runs
|
|
371
|
+
2. **Weak assertions** - "assert x" proves nothing
|
|
372
|
+
3. **No mental debugging** - Didn't verify tests catch bugs
|
|
373
|
+
4. **No negative testing** - Only tested happy path
|
|
374
|
+
5. **Misunderstood duplicate test** - Test verified opposite
|
|
375
|
+
|
|
376
|
+
### How to Improve
|
|
377
|
+
|
|
378
|
+
1. **Write tests first** (TDD) - Prevents these issues
|
|
379
|
+
2. **Specific assertions** - Verify exact values
|
|
380
|
+
3. **Mental debugging** - Break code, ensure test fails
|
|
381
|
+
4. **Test failures explicitly** - Every success needs failure test
|
|
382
|
+
5. **Read test name carefully** - Test what you claim to test
|
|
383
|
+
|
|
384
|
+
### TDD Would Have Prevented This
|
|
385
|
+
|
|
386
|
+
If tests were written first:
|
|
387
|
+
```python
|
|
388
|
+
# Write this FIRST (it will fail):
|
|
389
|
+
def test_user_creation_with_valid_data_persists_to_database():
|
|
390
|
+
user = create_user("test@example.com", "password")
|
|
391
|
+
assert user.email == "test@example.com" # Will fail until create_user works
|
|
392
|
+
...
|
|
393
|
+
|
|
394
|
+
# Then implement create_user to make it pass
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
See [test-driven-development skill](../../test-driven-development/) for complete TDD workflow.
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Sign-off
|
|
402
|
+
|
|
403
|
+
**QA Inspector:** [Your name]
|
|
404
|
+
**Date:** [Date]
|
|
405
|
+
**Status:** ❌ REJECTED
|
|
406
|
+
**Reason:** Tests provide zero protection, must be rewritten
|
|
407
|
+
**Re-inspection Required:** Yes
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
*This is what thorough test inspection looks like. Better to catch these issues now than in production.*
|