Test naming

michaelabuckley 2022-08-24 11:20:28 -04:00
parent d9e5a3910d
commit 2198f6862a

@ -13,4 +13,11 @@ Variable naming:
* Statics are named `ourFoo`
* Constants are named `FOO_CONSTANT`
The project also uses an [`.editorconfig`](https://editorconfig.org/) file to avoid ever worrying about tabs vs. spaces issues. There are plugins for most IDEs (and IntelliJ has built in support) for this format, so it is highly recommended to use it.
The project also uses an [`.editorconfig`](https://editorconfig.org/) file to avoid ever worrying about tabs vs. spaces issues. There are plugins for most IDEs (and IntelliJ has built in support) for this format, so it is highly recommended to use it.
Test naming:
* Test classes end with `Test` (e.g. SubscriptionCanonicalizerTest) or `IT` (e.g. Batch2CoordinatorIT)
* Test classes named `*Test` should be safe to run in parallel.
* Any test that depends on external resources (e.g. Docker containers) or is otherwise unsafe to run in parallel should be named `*IT`. These will be run as integration tests, one at a time, in isolated jvms.
* We are experimenting with a naming scheme for microtests (quick, narrow, unit-tests): test methods are named by template `methodName_StateUnderTest_ExpectedBehavior`. See the first convention in this [list](https://dzone.com/articles/7-popular-unit-test-naming).