Saturday, July 25, 2015

Being a Code Custodian



The roles of a team lead can vary dramatically depending on the team dynamics. Being a code custodian may or may not be appropriate for your organization. I have found it valuable in some situations. There are automated and manual approaches to monitoring the integrity of software. I like to apply both when appropriate. Each has pros and cons:

  • Automated Approach - Usage of software tools to detect potential defects and/or style violations
    • Advantages
      • Can check for a large number of potential defects and/or design smells
      • No ongoing time investment after initial investment to setup and configure
      • Can be tied into CI environments like Jenkins to guarantee adherance
    • Disadvantages
      • Not good at catching the most important issues
      • If rules are configured too restrictively, becomes more of a hindrance than a benefit
  • Manual Approach - Human review of checkins or some subset of checkins
    • Advantages
      • Only way to catch many types of issues
      • Keeps the reviewer abreast of new development
      • Leads to mentoring opportunities for the reviewer
      • Good way for the reviewer to learn from other approaches and pickup new techniques
    • Disadvantages
      • Difficult and important to be completely objective and remove opinion from feedback
      • If applied heavy-handedly 
        • Kills developer empowerment
        • Can be disastrous to morale
      • Time-intensive
      • Spotty
        • Usually unrealistic to fully check everything
I would further decompose automated approaches into 2 categories.
  • Category 1: Surface Analysis - Static-analysis tools including lint, checkstyle, and findbugs
    • Advantages
      • Customizable
      • Rules-based
      • File-driven
      • Easily integrated into many modern IDE's
      • Easily integrated into build or CI environments via a CLI
      • Many free or open-source
      • Often mature and robust
    • Disadvantage
      • While they can catch many "surface" issues, they don't always dig very deeply
  • Category 2: Deep Analysis - Tools that looks more deeply into aspects such as cyclomatic complexity, memory usage, and performance. 
    • Advantage
      • Tend to be higher value 
    • Disadvantages
      • Difficult to automate
        • Some intended more as an aid for manual test and debug
        • Some produce results that should be inspected and interpreted
      • Can be difficult or impossible to quantify rules for
      • Less typically free or open-source

In the next two posts I will delve into how I applied these tools in recent projects.

No comments:

Post a Comment