Jon Udell talks about "New directions in source code analysis" or why TDD and run-time checking are both useful techniques and are complementary.
[Full article: Source code analysis breaks new ground]
Microsoft recenly released an MSDN-article on testing a web part: "Checklist for Testing SharePoint Web Parts". [Via Tim Heuer]
As all your created web parts - your SharePoint building blocks - inherit from Microsoft.SharePoint.WebPartPages.WebPart, you should override various methods of this class to implement your own functionality. It's also worth mentioning that the WebPart class inherits from the System.Web.UI.Control class. This is the same class from which the class System.Web.UI.WebControls.WebControl inherits. So, both custom ASP.NET controls and web parts are almost exactly the same and behave as such:
they both have properties that are set during the design of the user interface,
they both have runtime behavior that is affected by the values of these properties,
and they both are usable from within Visual Studio .NET through the Visual Studio toolbox.
All this means that your developed web parts, just as your ASP.NET applications, should meet the same quality requirements. This can easliy be achieved by using DevPartner Studio for code review, performance analysis, code coverage and memory analysis or by using other tools like AutomatedQA AQTime 4 for performance profiling and memory debugging.
However if you don't have access to any of those products to ensure that your requirements are met, this checklist is a great place to start for SharePoint developers!