Test Smell: Implicit Meaning and Misleading Organization

Learn the way developers should use the principles of Arrange, Act, and Assert in writing tests.

Misleading organization

Knowing which part of the test is the act part, which is the arrange part, and which is the assert can speed up understanding. With this in mind, we can use AAA to make the test’s intent explicit. The highlighted lines in the following listing show the blank lines to insert (act or assert) for each test:

Get hands-on with 1400+ tech skills courses.