[Windmill-dev] Test naming conventions / var naming conventions
Matthew Eernisse
mde at osafoundation.org
Tue Dec 11 15:25:40 PST 2007
Howdy.
I'll have to do a bit more digesting to respond to Mikeal's message, but
just a quick response re. the naming conventions for tests.
I lifted the naming convention I was familiar with from JSUnit, where
"test_" is appending to the beginning of the normal camel-case name of a
JS method. This makes the regex for parsing namespace objects
(FF/Safari) and source strings (IE) for tests very simple (presumably
why the JSUnit guys started using it too).
So the convention is:
test_someNormalCamelCaseTestName()
This is kind of an ugly hybrid of both, and I'm not married to it, but
it does have some history behind it.
On a related note, it would be nice to clean up the Windmill source code
to replace underscore varable names with standard JS-style camel case.
It's certainly not critical, but makes our code look better to the
outside world.
Thanks.
Matthew
Travis Vachon wrote:
>>
>>
>> testModule.setup()
>> testModule.test_a()
>> testModule.test_b()
>> testModule.teardown()
>
>
> With a note that the camel case/underscore stuff is an unfortunate
> impedance mismatch between js and python. Given that these tests are in
> js I'd advocate moving to:
>
> testModule.setup()
> testModule.testA()
> testModule.testB()
> testModule.teardown()
>
> That would, of course, mean changes in the js test framework, so I'm not
> going to advocate too hard. Generally I prefer underscore variable
> names, but "When in Rome..."
>
> -Travis
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev
>
More information about the Windmill-dev
mailing list