1 of 6

PleaseDoNotNameYourTest�CasesLikeThis

@alexJamesBrown

github.com/alexJamesBrown

Alex Brown

2 of 6

y tho

HardToReadWhenTheMethodNameGetsLongerThanAFewWords

Too Similar to ‘real’ method names

Navigation through IDE is a pain

Grammatically difficult to understand intent

DidIMentionTheyAreReallyHardToReadWhenTheyAreLong

3 of 6

There is of course (slightly) worse...

public void Test1()

public void Test2()

public void Test3()

4 of 6

A better way

UnitOfWork_StateUnderTest_ExpectedBehavior

Credit: Roy Osherove

Action_Arrangement_Assertion

5 of 6

y tho

Obviously_LotsEasier_ToRead

Clear separation of what is under test, with what parameters, and what we expect to be the outcome

Navigation through IDE is a breeze

Nothing like your ‘production’ code �(I would hope!)

6 of 6

Further Reading

tiny.cc/test_case_names