Testing

NCheck V2

Paul Hatcher
Posted in Testing, Patterns

Just release V2 of NCheck, my test object comparison helper which tidies up a few things that simplify custom comparisons and excluding properties.

  1. Reworked the ITypeCompareTargter/IPropertyCompareTargeter into a more generic IConvention<Source, Target>
  2. Introduced custom comparers and use convention-based registration for them.
  3. Retired Exclude, you can now use Compare(x => x.PropertyName).Ignore, unifies the syntax compared to other options.

NCheck: A object comparison helper

Paul Hatcher
Posted in Testing, Patterns

With unit testing one of the precepts is to check one thing in your test, but when you have objects this is difficult to express, since you want to check that the your business process has updated all of the expected properties (positive testing) and also that has not modified things that are not expected to have changed (negative testing).

This becomes even more problematic when you have an object graph, e.g. Order –> OrderLine –> Product where you have to navigate the graph, and reporting accurately where any errors is also a major issue as you need to track property names, collection indexes, etc. etc.

Quality Myths

Paul Hatcher
Posted in DevEnv, DevOps, Testing

Microsoft has published the results of some empirical studies about how development practices affect quality

  • Test Driven Development improves quality by 60 to 90 percent but takes 15 to 35 percent more ‘up front’ time. The time spent is compensated by savings in maintenance time later on.
  • Team & organization structure has a huge impact on quality. Although this is conventional wisdom the study publishes figures to prove this. The metrics used data such as how many engineers are involved in a project, how many times individual source files were modified.
  • Code coverage in tests must be used intelligently, and has less overall impact than other factors.

Another paper highlights the issues of not running the unit tests….