After some time in every project sooner or later you will need to find a feature in it a fix it or extend it so I was wondering if there is already a system or a convention for marking those features in code... what I mean is to somehow mark a place or places in code where a particular functionality is implemented or tested.
I gave it some thought and came up with the idea that I could crate a new comment token in visual studio like FX and use it to mark particular features/tests with a random three letter code:
class Person
{
public string FirstName
{
set
{
// fx abc
if (string.IsNullOrEmpty(value)) { throw new ArgumentNullException...}
}
}
}
Then I could track all the features in Excel:
- abc - person first name must not be null or empty / does not allow empty/null value - hastest: yes
The same three letter code I would also use in a unit test to test this features:
(putting test naming conventions etc. aside)
[TestMethod]
[ExpectedException(typeof(ArgumentNullException)]
public void PersonFristNameTest()
{
// fx abc
new Person().FirstName = null;
}
It's obvious that we have a Person class and it has a FirstName property... but it's not so easy to keep track or document each and every requirement or condition inside every property or method especially if you need to find something later or tell if you already have it or not and where.
Have you seen something like this or do you use anything similar by yourself? I'm curious about your experience and suggestions.
I don't use this idea yet. I kind a invented it just yesterday after I was checking for the hundredth time if I already tested some if
s and where I did it and whether I already documented them.