Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] JGit unit tests could be more readable.


As a recent contributor, I've found the JGit unit tests highly useful
as a safety-net when making changes. Thanks for the great work!

However I've found that a lot of the tests don't talk to me. Most of
the test names I've come across are of the form "testDoSomething".
They don't tell me what is expected when doSomething happens. Surely
there are assertions, but that raises another question that I then
need to understand what every assertion means, which sucks away my
time to have to understand the entire test which may not necessarily
interest me, and have to do the same with some other test.

May I suggest that going ahead the tests be written in the form
"testDoingSomethingShouldHaveThisSideEffect" or
"testDoingSomethingShouldRaiseError". This ensures that reading the
testname clearly conveys what is expected of the test.


-- Ketan | |

Back to the top