Consistent naming scheme for unit tests?

Kevin Funk kfunk at kde.org
Wed Jul 9 13:50:12 UTC 2014


Hey,

While working on kdevplatform/kdevelop in the past this one annoyed me quite a 
bit:

There's lots of different naming styles for file, executable and class names 
for all the unit tests. This makes it hard to identify them when searching for 
classes via Quick Open or when looking up test binaries in the build folder.

I'm proposing the following naming scheme (something I've already started 
doing in kdev-clang):
- test_foo.cpp (file name)
- test_foo (target name)
- TestFoo (class name)

To be applied to all existing unit tests (potentially as a junior job) and for 
code written in the future.

Advantages:
- Easy to look up via Quick Open because of the "Test" prefix
- Easy to determine if a given class/file/target is a test, again because of 
the prefix
- Consistent!!11

Opinions?

-- 
Kevin Funk


More information about the KDevelop-devel mailing list