Sunday, December 4, 2016

Function Talks

Visual Studio has this great built-in feature that - on hovering over a method - immediately shows how often this method is used by other methods. When you develop code, you simply cannot ignore it, and it helps you keep your code clean. If you see a method with zero references, you just want to get rid of it immediately.

 Automated tests in NUNIT are declared using the [Test] attribute and in other programming languages there are similar terms in use to mark a method as a test-method such as @Test, or similar.

 Anyhow, if a developer forgets to add the attribute, nothing bad happens. The compiler does not care about it. The developer may have invested a lot of time developing the test case and then simply forget about setting the attribute. What happens is, the code is never executed and therefore never fails.

No comments:

Post a Comment