Chaperoning Promiscuous Software

submit to reddit StumbleUpon Delicious Save to Delicious
Every developer has done it. We just needed a bit of XML parsing or a better utility for dealing with connections. So we downloaded a library, stuck it in our code base and used it. Minutes later we felt great as our software had new capabilities quickly. Weeks later when things started to break we wondered,  "Did one of those libraries also have bugs and does our team even know all the libraries it has let into its code?"

Reuse of open source or commercial libraries can be great. It lets a team focus on delivering unique functionality to the business without rewriting that XML parsing utility. However, a mature software development organization needs to understand some of the risks of reuse and take steps to chaperon their code.

A team should know

  • which components we have in our product portfolio
  • if we are staying compliant with licensing
  • if the libraries we are using are secure
  • if the various components we are using are compatible
  • where developers can find pre-screened libraries
To address these challenges, we need a coherent strategy for chaperoning our organization's reuse. There are four elements of a successful strategy for managing components:

1) Testing and Validation of 3rd party components
2) A Definitive Software Library to track approved versions
3) Preventing unapproved libraries slipping in
4) Rapid audit of what is used where for impact analysis

Component Test Labs

At Urbancode, we increasingly encounter IT departments adopting rigorous standards for approving third party libraries for reuse. Developers identify specific versions of the components they want and a special testing team approves those versions. The best test labs screen licensing models, run security scans and test model applications built from a stack of proposed components for performance characteristics and correctness.

A Definitive Software Library

Once the test team approves a version of a component, we need to store the approved binary and give developers access to it. ITIL refers to this kind of storage as a Definitive Software Library (DSL) or Definitive Media Library. I'm a fan of the older DSL terminology.

Java teams using Maven can utilize solutions like Artifactory or Nexus to provide a basic DSL. AnthillPro customers, be they developing Java, Microsoft technologies or other stacks, can use the built in CodeStation repository to manage their shared artifacts. In either scenario, the approved libraries are provisioned automatically at build time making it easier for developers to use the pre-approved versions than download something new from the internet.

Using Protection

When a new library is required, developers may skirt the validation process and simply download a library and commit it into source control. Any gains made by the creation of an approval process for third party libraries can be undone very quickly. So we need a way of preventing unapproved libraries from entering our projects.

At Urbancode, part of our strategy is running an extra step in our automated, authoritative build process that scans the files checked out from source control for any obvious library files (those with extensions like .jar or .dll) and immediately failing the build if any are present. If the code base is clean, we continue on and retrieve any libraries we use from the DSL (CodeStation); and perform the build.

Rapid Impact Analysis

From time to time, a security firm may issue a warning about a commonly used library. Or the team behind the library may warn that a serious bug is in some versions. If we are using a DSL and preventing other components from being used, we can quickly identify if we might be impacted. If we have not approved those library versions we are in the clear.

If the team has approved problematic components, we know some of our projects are likely impacted. But which ones? To facilitate this impact analysis the team must track which projects use which libraries. At Urbancode, we use AnthillPro's CodeStation integration to automatically record when builds reference outside libraries. Our team can quickly and easily determine which projects, releases and builds include suspect libraries, speeding our impact analysis.

Conclusion


Reuse components. But reuse them responsibly. These four elements: testing, a DSL, prevention, and usage tracking; provide the foundation for controlled, effective reuse of 3rd party libraries.


Re: Chaperoning Promiscuous Software

That seems like a heavy-process and heavy-handed approach to me.  Also the reward structure is all backwards.  IT managers and tools that need to "prevent" developers from doing things which are easy and get their job done fastest probably will never be able to tap their developers' full potential.  The incentives are mis-aligned.  To change behaviors, the organization, culture and practices must be arranged such that the desired behavior is also the easiest thing to do for developers.

And the idea that some in-house test team is supposed to verify 3rd party libraries strikes me an inversion of responsibility as well.  This is like hiring a test driver to check that the car I just bought actually is safe to drive.  For open source components, why not insist that all libraries have test suites, verify test coverage with your Anthill tool and reject those that don't pass their own suite or don't have coverage.  For 3rd party proprietary libraries the same applies. The vendor should test it, ideally show this by demonstrating their own test suite.  Or else you better check the fine print in the support contract.

Perhaps this sounds too utopian for the Enterprise Java world, but it is standard practice in the Ruby-on-Rails community.

Re: Chaperoning Promiscuous Software

Thanks for the well thought out response! I agree that implementing this whole system can be heavy handed. It's very extreme for a mission a simple CRUD application. Teams I know who are writing shrink-box applications take any change to their tool-change or dependency graphs very seriously and test any new version of a component they are upgrading to extensively.

I would also argue that part of the goal is to facilitate developer productivity not hamper it in favor of control. By creating a set of approved components in a well know, easily accessible (and ideally searchable) place, developers don't need to hunt down various components online, and perform whatever validation they would do on them (usually none). This helps at component finding time, it also helps in a large enterprise as developers switch projects. When they move from one project to another, they find the same XML parsing libraries in place. The same logging technologies in place, etc, etc. Enterprise IT, in reality has quite a lot of friction caused by people moving between projects. If some level of consistency between those projects is facilitated, that friction can be reduced a little bit.

That said, I can see where the testing and the seperate approval organizations can be too much rigor in some teams. At very least, have a central place to store the components and track what you're using. It's truly frightening how many teams have no idea what components their using.

Re: Chaperoning Promiscuous Software

Very timely article. We're well on our to making this real without really getting in the way of development too. Wolfram sounds like a developer to me ;-)


© 2006-2010 Urbancode, Inc.
Anthill, AnthillPro, and AnthillOS are trademarks of Urbancode, Inc.
All other trademarks are owned by their respective owners.
tel: (216) 858-9000 fax: i (216) 393-0006 email:info@urbancode.com