An outlet for my obsession with technology
TDD
Validating DataAnnotations
Nov 26th
public static IList<String> GetClassLevelErrors(object instance){ return TypeDescriptor.GetAttributes(instance).OfType<ValidationAttribute>() .Where(attribute => !attribute.IsValid(instance)) .Select(attribute => attribute.FormatErrorMessage(string.Empty)) .ToList();}
[TestMethod]public void TestMethod1(){ var prop = typeof (DataAnnotationsModelBinderSpike.Models.Contact).GetProperty("First"); var attrib = prop.GetCustomAttributes(true).Cast<RequiredAttribute>().FirstOrDefault(); Assert.IsNotNull(attrib);}
TDD ROI Metrics
Aug 4th
Case studies were conducted with three development teams at Microsoft and one at IBM that have adopted TDD. The results of the case studies indicate that the pre-release defect density of the four products decreased between 40% and 90% relative to similar projects that did not use the TDD practice. Subjectively, the teams experienced a 15–35% increase in initial development time after adopting TDD.
http://www.springerlink.com/content/q91566748q234325/?p=7fd98b01480f49e2925f36393c999a72&pi=3