Monthly Archives: October 2007

Optimal Encapsulation

  There is a very simple thing to do to rationalize a code base: making sure that every methods, fields and types have an optimal visibility. For example, if a method is declared internal but is not used outside its … Continue reading 

Posted in Uncategorized | 2 Comments

Refactoring estimation

  As every team that cares for quality and agility, we (the NDepend team) are constantly refactoring the code we modify. Since NDepend became a professional tool (feb 2007), it is mandatory to cover at least 98% of the code … Continue reading 

Posted in Uncategorized | 1 Comment

A free library to handle common and complex path operations

I just release the library NDepend.Helpers.FilePathDirectory on CodePlex.  NDepend.Helpers.FilePathDirectory is the library used by the tool NDepend to handle common path operations. Benefits of the NDepend.Helpers.FilePathDirectory over the .NET Framework class System.IO.Path include: Strongly typed File/Directory path. Relative / absolute … Continue reading 

Posted in Featured | 3 Comments

Simplify your unit test code with some C# anonymous methods

While writing some unit test to check that an event was indeed triggered, I figured out that anonymous methods can be a great help to avoid writing some mock handler methods. Here is the case. I have a class Foo … Continue reading 

Posted in Uncategorized | 1 Comment

Unit Test vs. Debug.Assert()

  How should your automatic tests behave when they are executing an assertion through  System.Diagnostics.Debug.Assert(…)?   I have been mulling over this question because by default, the tool TestDriven.NET ignored my assertions. Concretely, while executing tests with TD.NET, the Assertion … Continue reading 

Posted in Uncategorized | 4 Comments

How to isolate your integration tests from your unit tests ?

Recently, we needed to isolate our integration tests from our unit tests. They were mixed in the same test project and we wanted to avoid the cost of executing integration tests while executing our unit tests. Integration tests takes longer … Continue reading 

Posted in Uncategorized | 1 Comment

Why is it useful to count the number of Lines Of Code (LOC) ?

My previous post explained How to count the LOC of your .NET application and Tim B and Keith answered that LOC should never be counted because it is not useful. I don’t agree at all. Often developers get stressed when we talk about LOC … Continue reading 

Posted in Uncategorized | 5 Comments

How do you count your number of Lines Of Code (LOC) ?

Do you count method signature declaration? Do you count lines with only bracket? Do you count several lines when a single method call is written on several lines because of a high number of parameters? Do you count ‘namespaces’ and … Continue reading 

Posted in Lines of Code, LoC | 13 Comments

Encapsulate your Fields at object level

There is one interesting detail of modern OOP language (C#, Java, VB.NET, C++…) that often developers are not aware of: the ‘private encapsulation’ applies at class level and not at object level. For example, in the following program, we can … Continue reading 

Posted in Uncategorized | 5 Comments