Skip to content

Commit 544549d

Browse files
authored
Merge pull request #164 from appian-design/feature/test-data-guidance-101
Add test data guidelines for code examples
2 parents 19e127c + b5f10d2 commit 544549d

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

docs/SAIL_CODING_GUIDE.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,112 @@ a!localVariables(
8585

8686
In this example, local!number starts out as an Integer. However, once a user interacts with the Number field, a Decimal value will be saved into local!number.
8787

88+
## Test Data Guidelines
89+
90+
When creating code examples, use realistic but generic test data that helps users understand the component's purpose without being distracting or inappropriate.
91+
92+
### Naming Conventions
93+
94+
**✅ Use generic, professional names:**
95+
```sail
96+
local!employees: {
97+
a!map(name: "Sarah Johnson", department: "Engineering", id: 1001),
98+
a!map(name: "Michael Chen", department: "Marketing", id: 1002),
99+
a!map(name: "Emily Rodriguez", department: "Sales", id: 1003)
100+
}
101+
```
102+
103+
**❌ Avoid:**
104+
- Real people's names (especially public figures)
105+
- Culturally insensitive or inappropriate names
106+
- Names that could be distracting or controversial
107+
108+
### Data Values
109+
110+
**✅ Use realistic business data:**
111+
```sail
112+
local!orders: {
113+
a!map(orderNumber: "ORD-2024-001", amount: 1250.00, status: "Shipped"),
114+
a!map(orderNumber: "ORD-2024-002", amount: 875.50, status: "Processing"),
115+
a!map(orderNumber: "ORD-2024-003", amount: 2100.75, status: "Delivered")
116+
}
117+
```
118+
119+
**✅ Use placeholder patterns for sensitive data:**
120+
```sail
121+
local!customers: {
122+
a!map(email: "sarah.j@company.com", phone: "(555) 123-4567"),
123+
a!map(email: "michael.c@company.com", phone: "(555) 234-5678"),
124+
a!map(email: "emily.r@company.com", phone: "(555) 345-6789")
125+
}
126+
```
127+
128+
### Quantities and Amounts
129+
130+
**✅ Use varied, realistic numbers:**
131+
```sail
132+
local!salesData: {45000, 52000, 48000, 61000, 58000}
133+
local!inventory: {
134+
a!map(item: "Laptop", quantity: 25, price: 1299.99),
135+
a!map(item: "Monitor", quantity: 18, price: 349.99),
136+
a!map(item: "Keyboard", quantity: 42, price: 89.99)
137+
}
138+
```
139+
140+
**❌ Avoid:**
141+
- Sequential numbers (1, 2, 3, 4)
142+
- Round numbers only (100, 200, 300)
143+
- Unrealistic values ($999,999,999)
144+
145+
### Dates and Times
146+
147+
**✅ Use relative dates with today():**
148+
```sail
149+
local!projects: {
150+
a!map(name: "Website Redesign", startDate: today() - 45, dueDate: today() + 30),
151+
a!map(name: "Mobile App", startDate: today() - 30, dueDate: today() + 75),
152+
a!map(name: "Database Migration", startDate: today() - 15, dueDate: today() + 45)
153+
}
154+
```
155+
156+
### Status and Category Values
157+
158+
**✅ Use common business statuses:**
159+
```sail
160+
/* Order statuses */
161+
"Pending", "Processing", "Shipped", "Delivered", "Cancelled"
162+
163+
/* Project statuses */
164+
"Planning", "In Progress", "Review", "Complete", "On Hold"
165+
166+
/* Priority levels */
167+
"Low", "Medium", "High", "Critical"
168+
169+
/* Departments */
170+
"Engineering", "Marketing", "Sales", "HR", "Finance", "Operations"
171+
```
172+
173+
### Comments in Examples
174+
175+
**✅ Use helpful placeholder comments:**
176+
```sail
177+
a!startProcess(
178+
processModel: cons!PM_EMPLOYEE_ONBOARDING,
179+
processParameters: {
180+
employee: local!employeeData,
181+
department: local!selectedDepartment
182+
},
183+
onSuccess: {
184+
/* Add success handling logic here */
185+
a!save(local!showConfirmation, true)
186+
},
187+
onError: {
188+
/* Add error handling logic here */
189+
a!save(local!errorMessage, "Failed to start onboarding process")
190+
}
191+
)
192+
```
193+
88194
## Essential Layout Components
89195

90196
### Section Layout

0 commit comments

Comments
 (0)