Andrey Shchekin » Naming Sat, 13 Apr 2013 23:16:21 +0000 en-US hourly 1 http://wordpress.org/?v=4.2.14 Unit Testing and the importance of naming /2007/10/13/unit-testing-and-the-importance-of-naming/ /2007/10/13/unit-testing-and-the-importance-of-naming/#comments Sat, 13 Oct 2007 11:36:37 +0000 /index.php/2007/10/13/unit-testing-and-the-importance-of-naming/ Microsoft’s VSTS lacks RowTest and that’s why I will not use it.
But there is one thing about VSTS that is done right.
It is naming.

We use TestFixture so often, but what is it exactly?
Let’s go to wikipedia:

Test fixture refers to the fixed state used as a baseline for running tests in software testing.
The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable.

If I go and ask all developers I know, no one would be able to repeat this definition.

And it is why unit testing was really hard for me to understand.
TestClass and TestMethod are practical names that desribe what we want to do.
TestFixture is an academic name that describes what we are supposed to do.
It conveys the feeling that I should read a tome of obscure knowledge to get it.
While I am fine with reading, this time things just seem to be hard.

Take VB’s Shared versus C# static.
How many people you know understand why static keyword has this name?
But we still have to live without useful features just because of the name.

The moral of the story: naming is very important.
It can make things unnecesarily complex or decrease your agility in changing underlying behavior.

]]>
/2007/10/13/unit-testing-and-the-importance-of-naming/feed/ 2