Loading...
Loading...
Compare original and translation side by side
undefinedundefined
**Refer to docs/pict_syntax.md for:**
- Complete syntax reference
- Constraint grammar and operators
- Advanced features (sub-models, aliasing, negative testing)
- Command-line options
- Detailed constraint patterns
**Refer to docs/examples.md for:**
- Complete real-world examples by domain
- Software function testing examples
- Web application, API, and mobile testing examples
- Database and configuration testing patterns
- Common patterns for authentication, resource access, error handling
**参考docs/pict_syntax.md获取:**
- 完整的语法参考
- 约束语法和运算符
- 高级功能(子模型、别名、负面测试)
- 命令行选项
- 详细的约束模式
**参考docs/examples.md获取:**
- 按领域分类的完整真实示例
- 软件功能测试示例
- Web应用、API和移动测试示例
- 数据库和配置测试模式
- 认证、资源访问、错误处理的常见模式undefinedundefined
**Using the helper script (optional):**
The `scripts/pict_helper.py` script provides utilities for model generation and output formatting:
```bash
**使用辅助脚本(可选):**
`scripts/pict_helper.py`脚本提供了模型生成和输出格式化的工具:
```bash
**To generate actual test cases**, the user can:
1. Save the PICT model to a file (e.g., `model.txt`)
2. Use online PICT tools like:
- https://pairwise.yuuniworks.com/
- https://pairwise.teremokgames.com/
3. Or install PICT locally (see docs/pict_syntax.md)
**要生成实际的测试用例**,用户可以:
1. 将PICT模型保存到文件中(例如:`model.txt`)
2. 使用在线PICT工具,如:
- https://pairwise.yuuniworks.com/
- https://pairwise.teremokgames.com/
3. 或在本地安装PICT(参考docs/pict_syntax.md)undefinedundefinedundefinedundefinedundefinedundefined| Test # | Parameter1 | Parameter2 | Expected Output |
|---|---|---|---|
| 1 | Value1 | ValueA | Success |
| 2 | Value2 | ValueB | Success |
| 3 | Value1 | ValueB | Error: Invalid combination |
| ... |
| 测试编号 | Parameter1 | Parameter2 | 预期输出 |
|---|---|---|---|
| 1 | Value1 | ValueA | 成功 |
| 2 | Value2 | ValueB | 成功 |
| 3 | Value1 | ValueB | 错误:无效组合 |
| ... |
undefinedundefinedAuthMethodUserRolePaymentTypeFileSize: Small, Medium, LargeFileSize: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10Age: 0, 17, 18, 65, 66Amount: ~-1, 0, 100, ~999999Param1Value1V1AuthMethodUserRolePaymentTypeFileSize: Small, Medium, LargeFileSize: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10Age: 0, 17, 18, 65, 66Amount: ~-1, 0, 100, ~999999Param1Value1V1# Safari only available on MacOS# Safari仅在MacOS上可用parameters = {
"Name": ["Valid", "Empty", "TooLong"],
"Email": ["Valid", "Invalid", "Empty"],
"Password": ["Strong", "Weak", "Empty"],
"Terms": ["Accepted", "NotAccepted"]
}
constraints = [
'IF [Terms] = "NotAccepted" THEN [Name] = "Valid"', # Test validation even if terms not accepted
]parameters = {
"Name": ["Valid", "Empty", "TooLong"],
"Email": ["Valid", "Invalid", "Empty"],
"Password": ["Strong", "Weak", "Empty"],
"Terms": ["Accepted", "NotAccepted"]
}
constraints = [
'IF [Terms] = "NotAccepted" THEN [Name] = "Valid"', # 即使未接受条款也要测试验证逻辑
]parameters = {
"HTTPMethod": ["GET", "POST", "PUT", "DELETE"],
"Authentication": ["Valid", "Invalid", "Missing"],
"ContentType": ["JSON", "XML", "FormData"],
"PayloadSize": ["Empty", "Small", "Large"]
}
constraints = [
'IF [HTTPMethod] = "GET" THEN [PayloadSize] = "Empty"',
'IF [Authentication] = "Missing" THEN [HTTPMethod] IN {GET, POST}'
]parameters = {
"HTTPMethod": ["GET", "POST", "PUT", "DELETE"],
"Authentication": ["Valid", "Invalid", "Missing"],
"ContentType": ["JSON", "XML", "FormData"],
"PayloadSize": ["Empty", "Small", "Large"]
}
constraints = [
'IF [HTTPMethod] = "GET" THEN [PayloadSize] = "Empty"',
'IF [Authentication] = "Missing" THEN [HTTPMethod] IN {GET, POST}'
]parameters = {
"Environment": ["Dev", "Staging", "Production"],
"CacheEnabled": ["True", "False"],
"LogLevel": ["Debug", "Info", "Error"],
"Database": ["SQLite", "PostgreSQL", "MySQL"]
}
constraints = [
'IF [Environment] = "Production" THEN [LogLevel] <> "Debug"',
'IF [Database] = "SQLite" THEN [Environment] = "Dev"'
]parameters = {
"Environment": ["Dev", "Staging", "Production"],
"CacheEnabled": ["True", "False"],
"LogLevel": ["Debug", "Info", "Error"],
"Database": ["SQLite", "PostgreSQL", "MySQL"]
}
constraints = [
'IF [Environment] = "Production" THEN [LogLevel] <> "Debug"',
'IF [Database] = "SQLite" THEN [Environment] = "Dev"'
];[ParameterName];[ParameterName]NOT<>NOT<>pip install pypict --break-system-packagespip install pypict --break-system-packagesDividend: -10, 0, 10, 1000
Divisor: ~0, -5, 1, 5, 100
IF [Divisor] = "0" THEN [Dividend] = "10";| Test # | Dividend | Divisor | Expected Output |
|---|---|---|---|
| 1 | 10 | 0 | Error: Division by zero |
| 2 | -10 | 1 | -10.0 |
| 3 | 0 | -5 | 0.0 |
| 4 | 1000 | 5 | 200.0 |
| 5 | 10 | 100 | 0.1 |
Dividend: -10, 0, 10, 1000
Divisor: ~0, -5, 1, 5, 100
IF [Divisor] = "0" THEN [Dividend] = "10";| 测试编号 | 被除数 | 除数 | 预期输出 |
|---|---|---|---|
| 1 | 10 | 0 | 错误:除零错误 |
| 2 | -10 | 1 | -10.0 |
| 3 | 0 | -5 | 0.0 |
| 4 | 1000 | 5 | 200.0 |
| 5 | 10 | 100 | 0.1 |
PaymentMethod: CreditCard, PayPal, BankTransfer
ShippingMethod: Standard, Express, Overnight
UserType: Guest, Registered, Premium
IF [UserType] = "Guest" THEN [PaymentMethod] <> "BankTransfer";
IF [UserType] = "Premium" AND [ShippingMethod] = "Express" THEN [PaymentMethod] IN {CreditCard, PayPal};PaymentMethod: CreditCard, PayPal, BankTransfer
ShippingMethod: Standard, Express, Overnight
UserType: Guest, Registered, Premium
IF [UserType] = "Guest" THEN [PaymentMethod] <> "BankTransfer";
IF [UserType] = "Premium" AND [ShippingMethod] = "Express" THEN [PaymentMethod] IN {CreditCard, PayPal};