Vincent Massol wrote:
Hi,

I'd like to propose a way to name our test methods. Instead of naming
them with "test<method named><extension>" such as in:

testSetUniqueIdOk()
testSetUniqueIdCannotBeRest()

I propose to name them with a sentence. This means that if you remove
the "test" prefix it should make a sentence. For example:

testUniqueIdIsAddedToListOfQueryStringParameters()
testUniqueIdCannotBeReset()

Why?

For 2 reasons:
- it documents better what the test is doing

+1


- javadoc documentation could then be generated automatically using
TestDox (http://agiledox.sourceforge.net)

I'm not sure that gives us anything... we don't actually generate Javadoc for the test classes currently, and most of the time you want to see the documentation in the same place where the code is. For tests, an easily understandable name is very good, but often you just can't describe what a test does with 6 words or so. In those cases putting a javadoc comment above the test method is helpful.


If you're ok then we can use this strategy in the future and slowly
refactor existing test names. We should also add it to the development
rules web page.

What do you think?

I don't consider generating docs from the test names very helpful. But I agree to use "sentence-ish" names for the tests. All in all, +1.


--
Christopher Lenz
/=/ cmlenz at gmx.de


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to