-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules_registry.json
More file actions
2878 lines (2878 loc) · 163 KB
/
Copy pathrules_registry.json
File metadata and controls
2878 lines (2878 loc) · 163 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"version": "1.3.1",
"total_rules": 147,
"generated_at": "2026-08-24T14:48:00Z",
"priority_counts": {
"P0_BLOCKER": 7,
"P1_HIGH": 17,
"P2_MEDIUM": 116,
"P3_INFO": 7
},
"rules": [
{
"id": "2008-04-tott-avoiding-flakey-tests",
"title": "TotT: Avoiding Flakey Tests",
"source_file": "best_practices/2008-04-tott-avoiding-flakey-tests.md",
"source_url": "https://testing.googleblog.com/2008/04/tott-avoiding-flakey-tests.html",
"published_date": "2008-04-17",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P0_BLOCKER",
"summary": "Isolate tests from external environments, shared mutable states, and unmanaged background workers.",
"rationale": "Flaky tests destroy developer trust in CI pipelines, leading to ignored build breakages and production outages.",
"enforcing_prompt": "CRITICAL: Eliminate all sources of test flakiness. Guarantee that tests are completely isolated, create unique temporary file directories, and clean up spawned background routines.",
"dos": [
"Use hermetic in-memory state or unique temporary test directories (`t.TempDir()`)",
"Ensure all spawned goroutines/threads terminate before test completion"
],
"donts": [
"Share global variables or static mutable state across test functions",
"Rely on unmanaged system environment variables"
],
"linter_rule_id": "go:avoid-sleep-in-test"
},
{
"id": "2008-04-tott-time-is-random",
"title": "TotT: Time is Random",
"source_file": "best_practices/2008-04-tott-time-is-random.md",
"source_url": "https://testing.googleblog.com/2008/04/tott-time-is-random.html",
"published_date": "2008-04-03",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P0_BLOCKER",
"summary": "Treat time and clocks as dynamic inputs; never assume real time stands still between consecutive statements.",
"rationale": "Reading `time.Now()` directly inside business logic makes unit test assertions brittle across leap seconds and CI pauses.",
"enforcing_prompt": "CRITICAL: Inject clock interfaces or pass explicit `time.Time` values into domain functions. In Go 1.24+, use `testing/synctest` to step through time deterministically.",
"dos": [
"Inject a mockable `Clock` interface or frozen timestamp into time-sensitive methods",
"Use `synctest` to test timers and timeouts deterministically"
],
"donts": [
"Call `time.Now()` or `System.currentTimeMillis()` directly inside business calculation logic",
"Write assertions comparing real-time elapsed durations"
],
"linter_rule_id": "go:avoid-sleep-in-test"
},
{
"id": "2008-08-tott-sleeping-synchronization",
"title": "TotT: Sleeping != Synchronization",
"source_file": "best_practices/2008-08-tott-sleeping-synchronization.md",
"source_url": "https://testing.googleblog.com/2008/08/tott-sleeping-synchronization.html",
"published_date": "2008-08-21",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P0_BLOCKER",
"summary": "Never use real-time sleep for test synchronization; use explicit event notification, channels, or virtual time.",
"rationale": "Hardcoded sleeps make test suites slow and flaky on CI runners due to CPU throttling or scheduling jitter.",
"enforcing_prompt": "CRITICAL: Under no circumstances should you call `time.Sleep()` or `Thread.sleep()` to wait for asynchronous workers in tests. Wrap async tests in Go 1.24 `testing/synctest.Run` or synchronize with channels and condition polling.",
"dos": [
"Use Go 1.24 `testing/synctest.Run` for zero-wall-clock virtual time advancements",
"Use notification channels (`chan struct{}`) with timeout bounds for async coordination"
],
"donts": [
"Add arbitrary `time.Sleep(500 * time.Millisecond)` hoping background tasks finish",
"Rely on wall-clock timing for deterministic assertions"
],
"linter_rule_id": "go:avoid-sleep-in-test"
},
{
"id": "2017-12-testing-on-toilet-only-verify-state",
"title": "Testing on the Toilet: Only Verify State-Changing Method Calls",
"source_file": "best_practices/2017-12-testing-on-toilet-only-verify-state.md",
"source_url": "https://testing.googleblog.com/2017/12/testing-on-toilet-only-verify-state.html",
"published_date": "2017-12-11",
"language_scope": "universal",
"category_id": "test_doubles",
"priority": "P0_BLOCKER",
"summary": "When using test doubles, verify only state-changing method calls (mutations), never read-only query calls.",
"rationale": "Verifying getter or finder calls ties tests to internal implementation details, breaking tests during harmless refactorings.",
"enforcing_prompt": "CRITICAL: When using mocks, ONLY verify invocations on state-changing methods (e.g. `Save()`, `ChargePayment()`, `SendNotification()`). NEVER assert call counts on read-only queries (e.g. `GetUser()`, `FindByID()`).",
"dos": [
"Assert expectations on methods that produce external side effects or state mutations",
"Stub return values for query methods without verifying invocation count"
],
"donts": [
"Add `.Times(1)` or `verify()` on getters and read-only helper functions",
"Assert intermediate data-fetching query sequences"
],
"linter_rule_id": "go:mock-query-verification"
},
{
"id": "2021-03-test-flakiness-one-of-main-challenges",
"title": "Test Flakiness - One of the main challenges of automated testing (Part II)",
"source_file": "best_practices/2021-03-test-flakiness-one-of-main-challenges.md",
"source_url": "https://testing.googleblog.com/2021/03/test-flakiness-one-of-main-challenges.html",
"published_date": "2021-03-24",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P0_BLOCKER",
"summary": "Isolate tests from external environments, shared mutable states, and unmanaged background workers.",
"rationale": "Flaky tests destroy developer trust in CI pipelines, leading to ignored build breakages and production outages.",
"enforcing_prompt": "CRITICAL: Eliminate all sources of test flakiness. Guarantee that tests are completely isolated, create unique temporary file directories, and clean up spawned background routines.",
"dos": [
"Use hermetic in-memory state or unique temporary test directories (`t.TempDir()`)",
"Ensure all spawned goroutines/threads terminate before test completion"
],
"donts": [
"Share global variables or static mutable state across test functions",
"Rely on unmanaged system environment variables"
],
"linter_rule_id": "go:avoid-sleep-in-test"
},
{
"id": "2024-02-increase-test-fidelity-by-avoiding-mocks",
"title": "Increase Test Fidelity By Avoiding Mocks",
"source_file": "best_practices/2024-02-increase-test-fidelity-by-avoiding-mocks.md",
"source_url": "https://testing.googleblog.com/2024/02/increase-test-fidelity-by-avoiding-mocks.html",
"published_date": "2024-02-27",
"language_scope": "universal",
"category_id": "test_doubles",
"priority": "P0_BLOCKER",
"summary": "Prefer real implementations or high-fidelity in-memory fakes over interaction mocks whenever possible.",
"rationale": "Interaction mocks test how code works rather than what it accomplishes, creating brittle test suites.",
"enforcing_prompt": "CRITICAL: Default to real objects or high-fidelity in-memory fakes (e.g. `FakeUserRepository`, `FakeBlobStore`). Restrict interaction mocks strictly to external third-party I/O boundaries.",
"dos": [
"Use real objects when execution is fast and deterministic",
"Maintain reusable, contract-compliant in-memory fakes for infrastructure layers"
],
"donts": [
"Mock domain entities, value objects, or lightweight utility structs",
"Construct complex nested mock expectation trees for internal business code"
]
},
{
"id": "2026-04-one-map-key-one-lookup",
"title": "One Map Key, One Lookup",
"source_file": "best_practices/2026-04-one-map-key-one-lookup.md",
"source_url": "https://testing.googleblog.com/2026/04/one-map-key-one-lookup.html",
"published_date": "2026-04-29",
"language_scope": "universal",
"category_id": "functions_and_data",
"priority": "P0_BLOCKER",
"summary": "Never perform duplicate map lookups for existence checking and value retrieval; look up once and reuse the value.",
"rationale": "Double indexing pays key hashing and tree/bucket traversal costs twice, wasting CPU cycles and introducing race window bugs.",
"enforcing_prompt": "CRITICAL: Look up map keys exactly once. In Go, always use the 2-value comma-ok idiom `if val, ok := m[k]; ok { use(val) }`. Never write `if _, ok := m[k]; ok { ... m[k] ... }`.",
"dos": [
"Bind the retrieved value in the if-init statement (`if val, ok := m[k]; ok`)",
"Reuse the bound variable throughout the block"
],
"donts": [
"Check existence with `_, ok := m[k]` and immediately index `m[k]` again",
"Perform multiple map index lookups with the same key in a tight loop"
],
"linter_rule_id": "go:one-map-lookup"
},
{
"id": "2008-07-breaking-law-of-demeter-is-like-looking",
"title": "Breaking the Law of Demeter is Like Looking for a Needle in the Haystack",
"source_file": "best_practices/2008-07-breaking-law-of-demeter-is-like-looking.md",
"source_url": "https://testing.googleblog.com/2008/07/breaking-law-of-demeter-is-like-looking.html",
"published_date": "2008-07-21",
"language_scope": "universal",
"category_id": "design_principles",
"priority": "P1_HIGH",
"summary": "Adhere to the Law of Demeter; do not chain through internal object graphs to reach distant collaborators.",
"rationale": "Train-wreck call chains couple the caller to the internal object layout of every intermediary class.",
"enforcing_prompt": "MANDATORY: Speak only to immediate collaborators. Never navigate deep object structures (`a.GetB().GetC().DoSomething()`). Ask the immediate owner to perform the action or provide the direct data.",
"dos": [
"Delegate domain operations to immediate collaborator objects",
"Provide high-level convenience methods on container structs"
],
"donts": [
"Write deep call/field navigation chains (depth \u003e= 5)",
"Expose internal nested dependencies through getters"
],
"linter_rule_id": "go:law-of-demeter"
},
{
"id": "2013-06-optimal-logging",
"title": "Optimal Logging",
"source_file": "best_practices/2013-06-optimal-logging.md",
"source_url": "https://testing.googleblog.com/2013/06/optimal-logging.html",
"published_date": "2013-06-14",
"language_scope": "universal",
"category_id": "code_hygiene",
"priority": "P1_HIGH",
"summary": "Use structured, leveled logging with contextual attributes; avoid unstructured log spam and repetitive loop logging.",
"rationale": "Unstructured log spam degrades system throughput and makes searching and diagnosing production incidents painful.",
"enforcing_prompt": "MANDATORY: Use structured logging (`log/slog` in Go 1.21+). Include typed key-value attributes for searchability. Avoid logging inside tight loops or repeating identical errors.",
"dos": [
"Use structured logging with key-value pairs (`slog.Info`, `slog.Error`)",
"Log once at the appropriate error handling boundary with full context"
],
"donts": [
"Use unstructured `log.Printf` or `fmt.Println` in production code",
"Emit repetitive logs on every iteration of a large loop"
],
"linter_rule_id": "go:structured-log"
},
{
"id": "2017-06-code-health-reduce-nesting-reduce",
"title": "Code Health: Reduce Nesting, Reduce Complexity",
"source_file": "best_practices/2017-06-code-health-reduce-nesting-reduce.md",
"source_url": "https://testing.googleblog.com/2017/06/code-health-reduce-nesting-reduce.html",
"published_date": "2017-06-05",
"language_scope": "universal",
"category_id": "control_flow",
"priority": "P1_HIGH",
"summary": "Minimize indentation depth by using guard clauses, early returns, and extracting complex blocks.",
"rationale": "Deep nesting forces developers to keep multiple mental branch conditions in working memory simultaneously.",
"enforcing_prompt": "MANDATORY: Invert conditional statements to return or continue early. Maintain the primary happy path at 0 to 1 indentation levels. If nesting exceeds 3 levels, extract inner blocks into helper functions.",
"dos": [
"Handle validation and error cases upfront with guard clauses",
"Extract nested loops or switch bodies into focused helper functions"
],
"donts": [
"Wrap entire function bodies inside giant `if ... { ... }` blocks",
"Nest conditional statements more than 3 levels deep"
],
"linter_rule_id": "go:reduce-nesting"
},
{
"id": "2018-07-code-health-make-interfaces-hard-to",
"title": "Code Health: Make Interfaces Hard to Misuse",
"source_file": "best_practices/2018-07-code-health-make-interfaces-hard-to.md",
"source_url": "https://testing.googleblog.com/2018/07/code-health-make-interfaces-hard-to.html",
"published_date": "2018-07-25",
"language_scope": "universal",
"category_id": "interface_design",
"priority": "P1_HIGH",
"summary": "Design interfaces and function signatures that make misuse and incorrect invocations impossible at compile time.",
"rationale": "Weak parameter types and hidden temporal dependencies cause subtle runtime bugs and poor developer ergonomics.",
"enforcing_prompt": "MANDATORY: Use strong types (e.g. `time.Duration` instead of `int`) and avoid boolean argument traps (`fn(true, false)`). Design factory constructors that return fully initialized, ready-to-use objects.",
"dos": [
"Use `time.Duration` for all time quantities",
"Use typed enums or configuration structs in place of boolean argument traps"
],
"donts": [
"Pass raw integers for timeouts or delays (`timeoutMs int`)",
"Require callers to execute custom manual initialization sequences"
],
"linter_rule_id": "go:boolean-argument-trap"
},
{
"id": "2023-04-sensenmann-code-deletion-at-scale",
"title": "Sensenmann: Code Deletion at Scale",
"source_file": "best_practices/2023-04-sensenmann-code-deletion-at-scale.md",
"source_url": "https://testing.googleblog.com/2023/04/sensenmann-code-deletion-at-scale.html",
"published_date": "2023-04-28",
"language_scope": "universal",
"category_id": "code_hygiene",
"priority": "P1_HIGH",
"summary": "Aggressively delete dead code, obsolete feature flags, and unused tests to reduce maintenance overhead.",
"rationale": "Dead code continues to impose mental burden, slows down refactoring migrations, and wastes CI build cycles.",
"enforcing_prompt": "MANDATORY: Delete obsolete code, unused functions, expired feature flags, and stale tests immediately rather than commenting them out or leaving them orphaned.",
"dos": [
"Remove dead functions, types, and unused packages completely",
"Clean up expired feature flag branches and their associated legacy paths"
],
"donts": [
"Leave commented-out legacy code blocks in the repository",
"Retain dead code 'just in case' it might be needed in the future"
]
},
{
"id": "2023-09-else-nuances",
"title": "Else Nuances",
"source_file": "best_practices/2023-09-else-nuances.md",
"source_url": "https://testing.googleblog.com/2023/09/else-nuances.html",
"published_date": "2023-09-13",
"language_scope": "universal",
"category_id": "control_flow",
"priority": "P1_HIGH",
"summary": "Eliminate redundant 'else' blocks following terminal statements (return, panic, break, continue).",
"rationale": "Dangling else blocks after terminal statements create unnecessary indentation and visual clutter.",
"enforcing_prompt": "MANDATORY: Never write an `else` or `else if` block immediately after a branch ending in `return`, `panic`, `break`, or `continue`. Dedent the subsequent statements.",
"dos": [
"Dedent and flatten subsequent logic following terminal statements",
"Use switch statements for multi-way branching"
],
"donts": [
"Write `if cond { return A } else { return B }`",
"Maintain unnecessary else blocks around fallback return values"
],
"linter_rule_id": "go:redundant-else"
},
{
"id": "2023-10-improve-readability-with-positive",
"title": "Improve Readability With Positive Booleans",
"source_file": "best_practices/2023-10-improve-readability-with-positive.md",
"source_url": "https://testing.googleblog.com/2023/10/improve-readability-with-positive.html",
"published_date": "2023-10-17",
"language_scope": "universal",
"category_id": "control_flow",
"priority": "P1_HIGH",
"summary": "Name boolean variables and predicates with positive semantics to prevent double-negative confusion.",
"rationale": "Negative names combined with boolean operators (`!isNotAuthorized`) require mental inversion, increasing error rates.",
"enforcing_prompt": "MANDATORY: Name all boolean flags, struct fields, and functions with positive semantics (e.g. `isValid`, `isEnabled`, `hasAccess`). Avoid negative prefixes like `isNot*`, `isDis*`, `un*`, or `isInvalid`.",
"dos": [
"Use positive identifiers like `isEnabled`, `isAuthorized`, `allowAnonymous`",
"Invert logic naturally using the `!` operator on positive flags"
],
"donts": [
"Declare variables named `isNotValid`, `disabled = false`, or `isUnauthorized`",
"Combine negative boolean identifiers with logical NOT (`!isNotDisabled`)"
],
"linter_rule_id": "go:positive-booleans"
},
{
"id": "2023-10-simplify-your-control-flows",
"title": "Simplify Your Control Flows",
"source_file": "best_practices/2023-10-simplify-your-control-flows.md",
"source_url": "https://testing.googleblog.com/2023/10/simplify-your-control-flows.html",
"published_date": "2023-10-24",
"language_scope": "universal",
"category_id": "control_flow",
"priority": "P1_HIGH",
"summary": "Minimize indentation depth by using guard clauses, early returns, and extracting complex blocks.",
"rationale": "Deep nesting forces developers to keep multiple mental branch conditions in working memory simultaneously.",
"enforcing_prompt": "MANDATORY: Invert conditional statements to return or continue early. Maintain the primary happy path at 0 to 1 indentation levels. If nesting exceeds 3 levels, extract inner blocks into helper functions.",
"dos": [
"Handle validation and error cases upfront with guard clauses",
"Extract nested loops or switch bodies into focused helper functions"
],
"donts": [
"Wrap entire function bodies inside giant `if ... { ... }` blocks",
"Nest conditional statements more than 3 levels deep"
],
"linter_rule_id": "go:reduce-nesting"
},
{
"id": "2023-12-let-code-speak-for-itself",
"title": "Let Code Speak for Itself",
"source_file": "best_practices/2023-12-let-code-speak-for-itself.md",
"source_url": "https://testing.googleblog.com/2023/12/let-code-speak-for-itself.html",
"published_date": "2023-12-12",
"language_scope": "universal",
"category_id": "code_hygiene",
"priority": "P1_HIGH",
"summary": "Make code self-explanatory through unambiguous naming and clean structure; write comments strictly to explain 'WHY'.",
"rationale": "Comments that merely describe what the code does drift out of date, add noise, and mask poor variable naming.",
"enforcing_prompt": "MANDATORY: Do not write comments that describe what code does. Express intent through clear variable and function names. Reserve comments strictly for explaining WHY (non-obvious constraints, business edge-cases, bug workarounds).",
"dos": [
"Choose descriptive identifiers that make code readable as natural language",
"Document external constraints, unusual trade-offs, and bug workaround rationales"
],
"donts": [
"Write comments that merely translate code syntax into English",
"Leave stale or misleading comments in the codebase"
],
"linter_rule_id": "go:naked-return"
},
{
"id": "2024-04-isbooleantoolongandcomplex",
"title": "isBooleanTooLongAndComplex",
"source_file": "best_practices/2024-04-isbooleantoolongandcomplex.md",
"source_url": "https://testing.googleblog.com/2024/04/isbooleantoolongandcomplex.html",
"published_date": "2024-04-25",
"language_scope": "universal",
"category_id": "control_flow",
"priority": "P1_HIGH",
"summary": "Decompose complex multi-operator boolean expressions into descriptive explanatory variables.",
"rationale": "Compound conditions with 3+ logical operators (`\u0026\u0026`, `||`) obscure business intent and lead to precedence bugs.",
"enforcing_prompt": "MANDATORY: If a boolean expression contains 3 or more logical operators, break it down into well-named intermediate boolean variables or extract it into an explanatory predicate function.",
"dos": [
"Assign sub-conditions to descriptive variables (`isEligibleForDiscount := ...`)",
"Extract complex domain condition evaluations into separate predicate methods"
],
"donts": [
"Write long compound boolean chains across multiple lines inside a single if statement",
"Mix `\u0026\u0026` and `||` operators without explicit grouping parentheses"
],
"linter_rule_id": "go:boolean-complexity"
},
{
"id": "2024-04-prefer-narrow-assertions-in-unit-tests",
"title": "Prefer Narrow Assertions in Unit Tests",
"source_file": "best_practices/2024-04-prefer-narrow-assertions-in-unit-tests.md",
"source_url": "https://testing.googleblog.com/2024/04/prefer-narrow-assertions-in-unit-tests.html",
"published_date": "2024-04-04",
"language_scope": "universal",
"category_id": "test_design",
"priority": "P1_HIGH",
"summary": "Use narrow, targeted assertions focused on the specific behavior under test rather than broad whole-object equality.",
"rationale": "Broad assertions fail when unrelated default fields change and produce difficult-to-debug diff dumps.",
"enforcing_prompt": "MANDATORY: Assert specifically on the exact fields or outputs modified by the test case. Avoid giant object comparison assertions unless verifying comprehensive end-to-end payload fidelity.",
"dos": [
"Assert on specific expected return fields or state changes",
"Provide descriptive assertion failure messages that clarify root cause"
],
"donts": [
"Compare entire serialized structs or JSON blobs when only 1-2 fields matter",
"Write broad assertions that break on unrelated field additions"
]
},
{
"id": "2024-05-dont-dry-your-code-prematurely",
"title": "Don't DRY Your Code Prematurely",
"source_file": "best_practices/2024-05-dont-dry-your-code-prematurely.md",
"source_url": "https://testing.googleblog.com/2024/05/dont-dry-your-code-prematurely.html",
"published_date": "2024-05-28",
"language_scope": "universal",
"category_id": "design_principles",
"priority": "P1_HIGH",
"summary": "Avoid premature DRY abstractions; tolerate small, localized duplication until a true, stable pattern emerges.",
"rationale": "The wrong abstraction is far more expensive to maintain and untangle than a few duplicated lines of code.",
"enforcing_prompt": "MANDATORY: Do not extract shared abstractions or polymorphic hierarchies until at least 3 distinct use-cases clearly demonstrate identical evolution requirements. Keep evolving behaviors decoupled.",
"dos": [
"Allow new features to develop independently before unifying code",
"Refactor into shared abstractions only after patterns stabilize across multiple implementations"
],
"donts": [
"Force two loosely similar modules into a rigid shared base class or interface",
"Create overly generic 'Common' or 'Util' frameworks prematurely"
]
},
{
"id": "2024-05-test-failures-should-be-actionable",
"title": "Test Failures Should Be Actionable",
"source_file": "best_practices/2024-05-test-failures-should-be-actionable.md",
"source_url": "https://testing.googleblog.com/2024/05/test-failures-should-be-actionable.html",
"published_date": "2024-05-06",
"language_scope": "universal",
"category_id": "test_design",
"priority": "P1_HIGH",
"summary": "Design test failure outputs to be immediately actionable, clearly detailing Expected, Actual, and context.",
"rationale": "Ambiguous test failure outputs force engineers to attach debuggers or add print statements to diagnose CI breakages.",
"enforcing_prompt": "MANDATORY: Ensure test failure messages clearly state what was expected, what was actually received, and the specific input parameters that triggered the failure.",
"dos": [
"Format failure messages with clear `got = %v, want = %v` and input context",
"Include domain identifiers in failure outputs"
],
"donts": [
"Rely on generic assertion failures without explanatory context",
"Produce silent test failures or swallowed errors in test helpers"
]
},
{
"id": "2024-07-in-praise-of-small-pull-requests",
"title": "In Praise of Small Pull Requests",
"source_file": "best_practices/2024-07-in-praise-of-small-pull-requests.md",
"source_url": "https://testing.googleblog.com/2024/07/in-praise-of-small-pull-requests.html",
"published_date": "2024-07-16",
"language_scope": "universal",
"category_id": "collaboration_and_reviews",
"priority": "P1_HIGH",
"summary": "Keep pull requests small, single-purpose, and easy to review (\u003c 200-300 lines of delta).",
"rationale": "Small changes are reviewed thoroughly, merge quickly, catch more defects, and are trivial to roll back.",
"enforcing_prompt": "MANDATORY: Split large tasks into small, self-contained pull requests focusing on a single concern. Never bundle unrelated refactorings or cleanups with functional feature additions.",
"dos": [
"Submit atomic, well-scoped pull requests (\u003c 300 lines of change)",
"Break multi-step initiatives into a sequence of small, reviewable PRs"
],
"donts": [
"Submit giant multi-thousand-line monolithic changes",
"Mix formatting cleanups, refactorings, and new features in a single PR"
]
},
{
"id": "2025-10-simplify-your-code-functional-core",
"title": "Simplify Your Code: Functional Core, Imperative Shell",
"source_file": "best_practices/2025-10-simplify-your-code-functional-core.md",
"source_url": "https://testing.googleblog.com/2025/10/simplify-your-code-functional-core.html",
"published_date": "2025-10-20",
"language_scope": "universal",
"category_id": "functions_and_data",
"priority": "P1_HIGH",
"summary": "Architect code with a pure, side-effect-free Functional Core and an Imperative Shell for I/O orchestration.",
"rationale": "Pure functions that take data and return data are trivial to test, reason about, and execute concurrently.",
"enforcing_prompt": "MANDATORY: Separate pure algorithmic and business calculation logic (functional core) from database, network, and disk I/O operations (imperative shell). Ensure core decision logic does not perform side effects.",
"dos": [
"Write deterministic calculation functions that accept immutable inputs and return results without I/O",
"Perform database queries and API calls in the outer orchestration layer"
],
"donts": [
"Interleave DB queries, file reads, and HTTP calls inside core mathematical or business decision algorithms"
]
},
{
"id": "2026-05-construct-with-collaborators-call-with",
"title": "Construct with Collaborators, Call with Work",
"source_file": "best_practices/2026-05-construct-with-collaborators-call-with.md",
"source_url": "https://testing.googleblog.com/2026/05/construct-with-collaborators-call-with.html",
"published_date": "2026-05-05",
"language_scope": "universal",
"category_id": "interface_design",
"priority": "P1_HIGH",
"summary": "Pass long-lived service dependencies into constructors; pass per-request data into method execution calls.",
"rationale": "Passing collaborators to individual methods pollutes signatures and leaks infrastructure concerns into business logic.",
"enforcing_prompt": "MANDATORY: Inject persistent services/clients (collaborators like DB, Logger, HTTP Client) via constructor/factory functions (`NewService(...)`). Pass dynamic request parameters (`ctx`, `payload`, `userID`) into method calls.",
"dos": [
"Inject infrastructure dependencies at struct instantiation time",
"Pass request-scoped context and data to method calls"
],
"donts": [
"Pass database handles or network clients as parameters to domain methods",
"Instantiate new long-lived infrastructure clients inside business methods"
],
"linter_rule_id": "go:inline-dependency-creation"
},
{
"id": "2026-07-prefactoring-clear-way-for-your-new",
"title": "Prefactoring: Clear the Way for Your New Feature",
"source_file": "best_practices/2026-07-prefactoring-clear-way-for-your-new.md",
"source_url": "https://testing.googleblog.com/2026/07/prefactoring-clear-way-for-your-new.html",
"published_date": "2026-07-21",
"language_scope": "universal",
"category_id": "collaboration_and_reviews",
"priority": "P1_HIGH",
"summary": "Prefactor existing code in a separate preliminary change to make the upcoming feature easy to implement.",
"rationale": "Combining structural code restructuring and new business logic in a single change makes code reviews arduous and bug-prone.",
"enforcing_prompt": "MANDATORY: Refactor first to prepare the codebase (prefactor commit/PR), then implement the new feature cleanly on top of the restructured base. Keep structural and behavioral changes strictly separate.",
"dos": [
"Submit a dedicated preparatory cleanup PR before starting feature implementation",
"Ensure test suites pass before and after each prefactoring step"
],
"donts": [
"Force new features into poorly structured existing code without prefactoring",
"Combine architectural refactorings and new business logic into one commit"
]
},
{
"id": "2007-01-better-stubbing-in-python",
"title": "TotT: Better Stubbing in Python",
"source_file": "best_practices/2007-01-better-stubbing-in-python.md",
"source_url": "https://testing.googleblog.com/2007/01/better-stubbing-in-python.html",
"published_date": "2007-01-24",
"language_scope": "python",
"category_id": "test_doubles",
"priority": "P2_MEDIUM",
"summary": "You could avoid this problem by stubbing or mocking out DoSomethingElse, but the task might be",
"rationale": "Core engineering principle derived from: TotT: Better Stubbing in Python.",
"enforcing_prompt": "RECOMMENDED: Apply test doubles practice 'TotT: Better Stubbing in Python'. Prefer high-fidelity fakes and verify only state mutations.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Better Stubbing in Python"
],
"donts": [
"Violate the principle: You could avoid this problem by stubbing or mocking out DoSomethingElse, but the task might be"
]
},
{
"id": "2007-02-tott-naming-unit-tests-responsibly",
"title": "TotT: Naming Unit Tests Responsibly",
"source_file": "best_practices/2007-02-tott-naming-unit-tests-responsibly.md",
"source_url": "https://testing.googleblog.com/2007/02/tott-naming-unit-tests-responsibly.html",
"published_date": "2007-02-01",
"language_scope": "universal",
"category_id": "test_design",
"priority": "P2_MEDIUM",
"summary": "These naming conventions can help point out smells.",
"rationale": "Core engineering principle derived from: TotT: Naming Unit Tests Responsibly.",
"enforcing_prompt": "RECOMMENDED: Apply test design practice 'TotT: Naming Unit Tests Responsibly'. Ensure test assertions are narrow, descriptive, and actionable.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Naming Unit Tests Responsibly"
],
"donts": [
"Violate the principle: These naming conventions can help point out smells."
]
},
{
"id": "2007-04-tott-refactoring-tests-in-red",
"title": "TotT: Refactoring Tests in the Red",
"source_file": "best_practices/2007-04-tott-refactoring-tests-in-red.md",
"source_url": "https://testing.googleblog.com/2007/04/tott-refactoring-tests-in-red.html",
"published_date": "2007-04-26",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Like any code, tests should ideally be kept in a state that's easy to understand and maintain.",
"rationale": "Core engineering principle derived from: TotT: Refactoring Tests in the Red.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: Refactoring Tests in the Red'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Refactoring Tests in the Red"
],
"donts": [
"Violate the principle: Like any code, tests should ideally be kept in a state that's easy to understand and maintain."
]
},
{
"id": "2007-04-tott-stubs-speed-up-your-unit-tests",
"title": "TotT: Stubs Speed up Your Unit Tests",
"source_file": "best_practices/2007-04-tott-stubs-speed-up-your-unit-tests.md",
"source_url": "https://testing.googleblog.com/2007/04/tott-stubs-speed-up-your-unit-tests.html",
"published_date": "2007-04-04",
"language_scope": "universal",
"category_id": "test_doubles",
"priority": "P2_MEDIUM",
"summary": "Test Double is a generic term for any test object that replaces a production object.",
"rationale": "Core engineering principle derived from: TotT: Stubs Speed up Your Unit Tests.",
"enforcing_prompt": "RECOMMENDED: Apply test doubles practice 'TotT: Stubs Speed up Your Unit Tests'. Prefer high-fidelity fakes and verify only state mutations.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Stubs Speed up Your Unit Tests"
],
"donts": [
"Violate the principle: Test Double is a generic term for any test object that replaces a production object."
]
},
{
"id": "2007-05-sign-up-to-attend-our-test-automation",
"title": "Sign up to attend our Test Automation Conference",
"source_file": "best_practices/2007-05-sign-up-to-attend-our-test-automation.md",
"source_url": "https://testing.googleblog.com/2007/05/sign-up-to-attend-our-test-automation.html",
"published_date": "2007-05-23",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Today, I'm happy to tell you that we've finalized the speaker list and have opened the attendee",
"rationale": "Core engineering principle derived from: Sign up to attend our Test Automation Conference.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Sign up to attend our Test Automation Conference'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Sign up to attend our Test Automation Conference"
],
"donts": [
"Violate the principle: Today, I'm happy to tell you that we've finalized the speaker list and have opened the attendee"
]
},
{
"id": "2007-06-tott-extracting-methods-to-simplify",
"title": "TotT: Extracting Methods to Simplify Testing",
"source_file": "best_practices/2007-06-tott-extracting-methods-to-simplify.md",
"source_url": "https://testing.googleblog.com/2007/06/tott-extracting-methods-to-simplify.html",
"published_date": "2007-06-13",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "When a method is long and complex, it is harder to test.",
"rationale": "Core engineering principle derived from: TotT: Extracting Methods to Simplify Testing.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: Extracting Methods to Simplify Testing'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Extracting Methods to Simplify Testing"
],
"donts": [
"Violate the principle: When a method is long and complex, it is harder to test."
]
},
{
"id": "2007-09-but-it-works-on-my-machine",
"title": "But it works on my machine!",
"source_file": "best_practices/2007-09-but-it-works-on-my-machine.md",
"source_url": "https://testing.googleblog.com/2007/09/but-it-works-on-my-machine.html",
"published_date": "2007-09-25",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "But I have a gazillion unit tests and I don't need system level tests!",
"rationale": "Core engineering principle derived from: But it works on my machine!.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'But it works on my machine!'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in But it works on my machine!"
],
"donts": [
"Violate the principle: But I have a gazillion unit tests and I don't need system level tests!"
]
},
{
"id": "2007-09-seleniums-inventor",
"title": "Selenium's Inventor",
"source_file": "best_practices/2007-09-seleniums-inventor.md",
"source_url": "https://testing.googleblog.com/2007/09/seleniums-inventor.html",
"published_date": "2007-09-19",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "One way to bring the test run times down is to run them in parallel on a grid of servers, instead",
"rationale": "Core engineering principle derived from: Selenium's Inventor.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Selenium's Inventor'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Selenium's Inventor"
],
"donts": [
"Violate the principle: One way to bring the test run times down is to run them in parallel on a grid of servers, instead"
]
},
{
"id": "2007-09-testing-applications-and-apis",
"title": "Testing Applications and APIs",
"source_file": "best_practices/2007-09-testing-applications-and-apis.md",
"source_url": "https://testing.googleblog.com/2007/09/testing-applications-and-apis.html",
"published_date": "2007-09-14",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Adding fuzz to the parameters and call patterns can help, but not eliminate, this problem.",
"rationale": "Core engineering principle derived from: Testing Applications and APIs.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Testing Applications and APIs'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Testing Applications and APIs"
],
"donts": [
"Violate the principle: Adding fuzz to the parameters and call patterns can help, but not eliminate, this problem."
]
},
{
"id": "2007-10-automating-tests-vs-test-automation",
"title": "Automating tests vs. test-automation",
"source_file": "best_practices/2007-10-automating-tests-vs-test-automation.md",
"source_url": "https://testing.googleblog.com/2007/10/automating-tests-vs-test-automation.html",
"published_date": "2007-10-24",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "If so, it should be tested through the API, and the UI should just be checked to interact with the",
"rationale": "Core engineering principle derived from: Automating tests vs. test-automation.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Automating tests vs. test-automation'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Automating tests vs. test-automation"
],
"donts": [
"Violate the principle: If so, it should be tested through the API, and the UI should just be checked to interact with the"
]
},
{
"id": "2007-10-performance-testing",
"title": "Performance Testing",
"source_file": "best_practices/2007-10-performance-testing.md",
"source_url": "https://testing.googleblog.com/2007/10/performance-testing.html",
"published_date": "2007-10-08",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "If you do not have service related monitoring developed and set up to be used during live",
"rationale": "Core engineering principle derived from: Performance Testing.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Performance Testing'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Performance Testing"
],
"donts": [
"Violate the principle: If you do not have service related monitoring developed and set up to be used during live"
]
},
{
"id": "2007-10-tott-avoiding-friend-twister-in-c",
"title": "TotT: Avoiding friend Twister in C++",
"source_file": "best_practices/2007-10-tott-avoiding-friend-twister-in-c.md",
"source_url": "https://testing.googleblog.com/2007/10/tott-avoiding-friend-twister-in-c.html",
"published_date": "2007-10-30",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "In a previous episode, we extracted methods to simplify testing in Python.",
"rationale": "Core engineering principle derived from: TotT: Avoiding friend Twister in C++.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: Avoiding friend Twister in C++'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Avoiding friend Twister in C++"
],
"donts": [
"Violate the principle: In a previous episode, we extracted methods to simplify testing in Python."
]
},
{
"id": "2008-02-in-movie-amadeus-austrian-emperor",
"title": "TotT: Too Many Tests",
"source_file": "best_practices/2008-02-in-movie-amadeus-austrian-emperor.md",
"source_url": "https://testing.googleblog.com/2008/02/in-movie-amadeus-austrian-emperor.html",
"published_date": "2008-02-21",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "public void decide(int a, int b, int c, int d, int e, int f) { if (a \u003e b || c \u003e d || e \u003e f) {",
"rationale": "Core engineering principle derived from: TotT: Too Many Tests.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: Too Many Tests'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Too Many Tests"
],
"donts": [
"Violate the principle: public void decide(int a, int b, int c, int d, int e, int f) { if (a \u003e b || c \u003e d || e \u003e f) {"
]
},
{
"id": "2008-02-tott-stroop-effect",
"title": "TotT: The Stroop Effect",
"source_file": "best_practices/2008-02-tott-stroop-effect.md",
"source_url": "https://testing.googleblog.com/2008/02/tott-stroop-effect.html",
"published_date": "2008-02-07",
"language_scope": "universal",
"category_id": "test_design",
"priority": "P2_MEDIUM",
"summary": "Failure: testProtanopiaColorMatcherCannotDistinguishBetweenCertainPairsOfColorsMessage: BLUE and",
"rationale": "Core engineering principle derived from: TotT: The Stroop Effect.",
"enforcing_prompt": "RECOMMENDED: Apply test design practice 'TotT: The Stroop Effect'. Ensure test assertions are narrow, descriptive, and actionable.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: The Stroop Effect"
],
"donts": [
"Violate the principle: Failure: testProtanopiaColorMatcherCannotDistinguishBetweenCertainPairsOfColorsMessage: BLUE and"
]
},
{
"id": "2008-03-cost-benefit-analysis-of-test",
"title": "Cost-Benefit Analysis of a Test",
"source_file": "best_practices/2008-03-cost-benefit-analysis-of-test.md",
"source_url": "https://testing.googleblog.com/2008/03/cost-benefit-analysis-of-test.html",
"published_date": "2008-03-12",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "This cost should be balanced against the benefits of the test when deciding whether a test should",
"rationale": "Core engineering principle derived from: Cost-Benefit Analysis of a Test.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Cost-Benefit Analysis of a Test'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Cost-Benefit Analysis of a Test"
],
"donts": [
"Violate the principle: This cost should be balanced against the benefits of the test when deciding whether a test should"
]
},
{
"id": "2008-03-tott-testng-on-toilet",
"title": "TotT: TestNG on the Toilet",
"source_file": "best_practices/2008-03-tott-testng-on-toilet.md",
"source_url": "https://testing.googleblog.com/2008/03/tott-testng-on-toilet.html",
"published_date": "2008-03-20",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "The elements in the array represent // parameters to the test call.",
"rationale": "Core engineering principle derived from: TotT: TestNG on the Toilet.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: TestNG on the Toilet'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: TestNG on the Toilet"
],
"donts": [
"Violate the principle: The elements in the array represent // parameters to the test call."
]
},
{
"id": "2008-03-tott-understanding-your-coverage-data",
"title": "TotT: Understanding Your Coverage Data",
"source_file": "best_practices/2008-03-tott-understanding-your-coverage-data.md",
"source_url": "https://testing.googleblog.com/2008/03/tott-understanding-your-coverage-data.html",
"published_date": "2008-03-06",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Some tools do not provide fractional coverage.",
"rationale": "Core engineering principle derived from: TotT: Understanding Your Coverage Data.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: Understanding Your Coverage Data'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Understanding Your Coverage Data"
],
"donts": [
"Violate the principle: Some tools do not provide fractional coverage."
]
},
{
"id": "2008-05-exploratory-testing-on-chat",
"title": "Exploratory Testing on Chat",
"source_file": "best_practices/2008-05-exploratory-testing-on-chat.md",
"source_url": "https://testing.googleblog.com/2008/05/exploratory-testing-on-chat.html",
"published_date": "2008-05-20",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Testing Google Talk is challenging -- we have multiple client implementations, between the Google",
"rationale": "Core engineering principle derived from: Exploratory Testing on Chat.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Exploratory Testing on Chat'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Exploratory Testing on Chat"
],
"donts": [
"Violate the principle: Testing Google Talk is challenging -- we have multiple client implementations, between the Google"
]
},
{
"id": "2008-05-performance-testing-of-distributed-file",
"title": "Performance Testing of Distributed File Systems at Google",
"source_file": "best_practices/2008-05-performance-testing-of-distributed-file.md",
"source_url": "https://testing.googleblog.com/2008/05/performance-testing-of-distributed-file.html",
"published_date": "2008-05-31",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Unified testing: The framework should be stand-alone or independent ie it should be a one-stop",
"rationale": "Core engineering principle derived from: Performance Testing of Distributed File Systems at Google.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Performance Testing of Distributed File Systems at Google'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Performance Testing of Distributed File Systems at Google"
],
"donts": [
"Violate the principle: Unified testing: The framework should be stand-alone or independent ie it should be a one-stop"
]
},
{
"id": "2008-05-tott-invisible-branch",
"title": "TotT: The Invisible Branch",
"source_file": "best_practices/2008-05-tott-invisible-branch.md",
"source_url": "https://testing.googleblog.com/2008/05/tott-invisible-branch.html",
"published_date": "2008-05-28",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "If you were to draw a flowchart of both snippets (left as an exercise - and we recommend against",
"rationale": "Core engineering principle derived from: TotT: The Invisible Branch.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: The Invisible Branch'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: The Invisible Branch"
],
"donts": [
"Violate the principle: If you were to draw a flowchart of both snippets (left as an exercise - and we recommend against"
]
},
{
"id": "2008-05-tott-testable-contracts-make",
"title": "TotT: Testable Contracts Make Exceptional Neighbors",
"source_file": "best_practices/2008-05-tott-testable-contracts-make.md",
"source_url": "https://testing.googleblog.com/2008/05/tott-testable-contracts-make.html",
"published_date": "2008-05-01",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "bool SomeCollection::GetObjects(vector* objects) const { objects-\u003eclear(); typedef",
"rationale": "Core engineering principle derived from: TotT: Testable Contracts Make Exceptional Neighbors.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'TotT: Testable Contracts Make Exceptional Neighbors'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Testable Contracts Make Exceptional Neighbors"
],
"donts": [
"Violate the principle: bool SomeCollection::GetObjects(vector* objects) const { objects-\u003eclear(); typedef"
]
},
{
"id": "2008-06-productivity-games-using-games-to",
"title": "Productivity Games - Using Games to Improve Quality",
"source_file": "best_practices/2008-06-productivity-games-using-games-to.md",
"source_url": "https://testing.googleblog.com/2008/06/productivity-games-using-games-to.html",
"published_date": "2008-06-21",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Successful game design is best achieved through experience and experimentation, and the goal",
"rationale": "Core engineering principle derived from: Productivity Games - Using Games to Improve Quality.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Productivity Games - Using Games to Improve Quality'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Productivity Games - Using Games to Improve Quality"
],
"donts": [
"Violate the principle: Successful game design is best achieved through experience and experimentation, and the goal"
]
},
{
"id": "2008-06-taming-beast-aka-how-to-test-ajax",
"title": "Taming the Beast (a.k.a. how to test AJAX applications) : Part 1",
"source_file": "best_practices/2008-06-taming-beast-aka-how-to-test-ajax.md",
"source_url": "https://testing.googleblog.com/2008/06/taming-beast-aka-how-to-test-ajax.html",
"published_date": "2008-06-13",
"language_scope": "universal",
"category_id": "test_doubles",
"priority": "P2_MEDIUM",
"summary": "don't give confidence that the business logic and functionality of the system meets the",
"rationale": "Core engineering principle derived from: Taming the Beast (a.k.a. how to test AJAX applications) : Part 1.",
"enforcing_prompt": "RECOMMENDED: Apply test doubles practice 'Taming the Beast (a.k.a. how to test AJAX applications) : Part 1'. Prefer high-fidelity fakes and verify only state mutations.",
"dos": [
"Follow the specific architectural guidance outlined in Taming the Beast (a.k.a. how to test AJAX applications) : Part 1"
],
"donts": [
"Violate the principle: don't give confidence that the business logic and functionality of the system meets the"
]
},
{
"id": "2008-06-test-engineering-class-project-at-uc",
"title": "Test Engineering Class Project at UC-Irivine",
"source_file": "best_practices/2008-06-test-engineering-class-project-at-uc.md",
"source_url": "https://testing.googleblog.com/2008/06/test-engineering-class-project-at-uc.html",
"published_date": "2008-06-24",
"language_scope": "universal",
"category_id": "testing_strategy",
"priority": "P2_MEDIUM",
"summary": "Test Reporting - The examination of test results.",
"rationale": "Core engineering principle derived from: Test Engineering Class Project at UC-Irivine.",
"enforcing_prompt": "RECOMMENDED: Apply testing strategy practice 'Test Engineering Class Project at UC-Irivine'. Build fast, hermetic, single-process tests.",
"dos": [
"Follow the specific architectural guidance outlined in Test Engineering Class Project at UC-Irivine"
],
"donts": [
"Violate the principle: Test Reporting - The examination of test results."
]
},
{
"id": "2008-06-tott-friends-you-can-depend-on",
"title": "TotT: Friends You Can Depend On",
"source_file": "best_practices/2008-06-tott-friends-you-can-depend-on.md",
"source_url": "https://testing.googleblog.com/2008/06/tott-friends-you-can-depend-on.html",
"published_date": "2008-06-12",
"language_scope": "universal",
"category_id": "test_doubles",
"priority": "P2_MEDIUM",
"summary": "A Mock can return values, but it also cares about the way its methods are called (\"strict",
"rationale": "Core engineering principle derived from: TotT: Friends You Can Depend On.",
"enforcing_prompt": "RECOMMENDED: Apply test doubles practice 'TotT: Friends You Can Depend On'. Prefer high-fidelity fakes and verify only state mutations.",
"dos": [
"Follow the specific architectural guidance outlined in TotT: Friends You Can Depend On"