Automated Standards Enforcement

Better Code Through Reflective Testing

Introduction

Everyone agrees that unit testing your code is a great idea. But, we can take it further. Most modern programming languages (Java, Smalltalk, Ruby, etc) have powerful reflective capabilities that allow programmers to reflect on their source. Automated standards enforcement is an idea that combines the power of unit testing and reflection together. It tests that team contracts and coding standards are kept in check. Violations are known immediately and not during the code review. Reviews themselves can now focus on business logic and not mundane concerns such as making sure resources are properly finalized. It allows the developer to save face by being able to fix their code before check in. It's also better than a document that no one will read. Enforcing standards through testing allows developers to think about complex business problems and keep the code clean. Finally, it ensures team decisions are not forgotten. We have a test to keep us honest.