We have 3267 guests and 7 members online

Home > Articles > Columns > Articles > Accelerating Agile Development through Software Reuse

Accelerating Agile Development through Software Reuse

E-mail
Written by Werner Janjic, Oliver Hummel and Colin Atkinson   
Thursday, 15 January 2009 21:41
january-09-acceleratebigOne of the main attractions of agile methods over traditional heavyweight approaches to software engineering is their ability to accelerate the software development process. By minimizing superfluous activities and artefacts such as models and documentation and focusing developers' efforts on coding, agile methods increase productivity and reduce overall development time. However, this focus on coding also has a down side - it means that new applications are typically written entirely from scratch. Software reuse, as envisaged by McIlroy back in 1969 [1] at the conference that coined the terms "software engineering" and "software crisis" is not explicitly addressed in the current generation of agile methods. If it takes place at all, reuse tends to be done in an ad hoc, unsystematic way.

Until recently this was not a big issue, because fine grained component reuse was not a cost effective proposition anyway - there simply were not enough good components around and the technologies available for finding them were too inaccurate. As a result, systematic attempts to reuse software did not pay off because the likelihood of finding suitable components was too low compared to the effort required to find and evaluate them. However, this situation has changed over the last few years with the dramatic increase in the amount of open source software freely available over the Internet, and the emergence of high-performance code search engines such as Koders, Google Code Search and Merobase dedicated to indexing and support searches over these code resources. For the first time, these technologies make fine-grained component reuse a viable proposition, reducing the effort involved in finding and reusing components to a level similar, or lower, to that involved in building them from scratch.

All kinds of projects stand to benefit from this enhanced opportunity for reuse, but agile projects stand to benefit the most because they specialise in development at the level of fine grained components, and they offer the same basic value proposition as software reuse - accelerated development. They also emphasise the description of what components should do (i.e. tests) before the description of how they should do it (i.e. implementation) providing a ready made opportunity to search for potential reusable components before they are implemented from scratch. In short, there is a high potential synergy between agile development and software reuse which can further accelerate the software development process and lower costs.

In this paper we introduce a software tool developed by the Software Engineering Group at the University of Mannheim that aims to promote this synergy. Known as Code Conjurer [2], the tool is an Eclipse plugin driven by the Merobase component search engine. The tool is released as open source under the GNU/GPL license.

Proactive Reuse Recommendation

The basic service offered by Code Conjurer is to search for reusable components (e.g. Java classes) based on a description of an interface or API (i.e. set of operations). This description can take various forms such as a Java code module (e.g. interface or class) or even a UML class. Suppose, for example, that a developer has decided that he wants a matrix supporting a certain set of operations.

wg0109-1


Once he has defined a part of the interface supported by the desired component, Code Conjurer is able to find suitable reusable components that already implement this interface using the Merobase search engine. In Figure 1, which shows a screenshot of an Eclipse environment including Code Conjurer, the user has defined parts of the required Matrix as a UML class in the top right hand window. After sending a search request to Merobase, Code Conjurer lists the discovered components in the reuse recommendation window in the lower central part of Figure 1. It first displays the results and then fetches the source code so the developer can instantly browse through the interesting reuse candidates (lower right part of Figure 1) and access relevant metrics such as LOC, Halstead and complexity measures etc.

If the developer thinks a component looks useful he can insert it into his workspace with a double click of his mouse. Code Conjurer has an automatic dependency resolution feature that can be employed in the background to find any other classes that the chosen component depends on. After analysing the component, the tool can trigger new searches to find missing components and insert them alongside the original one. In many cases all dependencies can be resolved and fully functioning, executable code can be automatically added to the development project.

Code Conjurer can also be set to "proactive mode" in which it monitors the work of the developer in the background and triggers new searches automatically every time the interface-defining part of the component under development changes (i.e. whenever a method is added, changed or removed). The developer can therefore proceed with his normal work, undisturbed, until he decides that one or more of the recommended reuse candidates are worthy of attention. He can also trigger a manual search for reuse recommendations or use Code Conjurer's quick fix integration feature that searches for reusable assets when a type in the developed Java code cannot be resolved.

Test Driven Reuse


wg0109-2


This proactive recommendation capability can be valuable in all kinds of development projects, including traditional heavyweight projects. However, it does not exploit all the opportunities that exist to accelerate software development. In particular, it does not exploit the fact that discovered software components are potentially executable and that test-cases are often written before the implementation code, especially in agile projects. Code Conjurer therefore offers another more advanced search facility, known as test-driven search that leverages these two facts to significantly boost the value of search results. As soon as an executable test has been defined by the developer, Code Conjurer sends this to the Merobase server to find matching components that pass the test. Merobase does this by:
1. working out what interface the test is written against,

2. performing a normal search on this interface and

3. testing the results to filter out those that match.
The resulting set of component recommendations is of much higher value than that generated by regular interface-based matching alone because the components do what the developer has specified - that is, they pass his test.

A developer can decide to write the whole test before initiating a test driven search (as shown in Figure 2), or can configure Code Conjurer to search for components within the test/implementation cycle advocated in Extreme Programming [3]. In both cases, Code Conjurer gives an indication of how the search is proceeding in the bottom left corner, and optionally in the other two windows at the bottom. Whenever a candidate component passes the given test, it is highlighted in green using the familiar JUnit convention. If the test is complete, a component that has passed the tests (indicated in green) is fit for purpose and can be inserted directly into the project. If not, the developer can complete the test using the candidate component's interface to check if it behaves as required.

When performing test-driven searches in proactive mode, Code Conjurer is able to suggest candidate reusable components based on partial tests without disturbing the developers normal work and before much of the component has been implemented. It complements extreme programming by promoting the reuse of component implementations alongside the traditional approach of building them from scratch. We have therefore referred to this approach as Extreme Harvesting in previous papers [3]. Extreme Harvesting extends the extreme programming mantra of "design a little, code a little, test a little" to include "design a little, harvest (i.e. reuse) a little, test a little" as a possible route to successful application development.

Using Code Conjurer it is not only possible to find normal reusable components based on tests defined by the developer, it also possible to search for pre-existing tests as well. When a developer starts writing a test, Code Conjurer can look for previously indexed tests and offer these for reuse.

Conclusion
When Code Conjurer is able to find components that match a developer's tests, it effectively "conjures up" reusable code from "thin air". The user does not have to deviate from his normal development work until a component has been found that does what he is trying to build. Even when no components are found that pass a developer's tests Code Conjurer is able to provide valuable information. By analysing the search results using various clustering techniques it can create a characteristic picture of the group that includes the "typical" set of methods. For example, when searching for a matrix component based on an interface with just a "multiply" method, Code Conjurer can indicate that components with this method typically also support 13 other methods as well, such as swapRows(), transpose() or findPivot(int).

By unobtrusively adding test-driven search capabilities to mainstream development platforms such as Eclipse, Code Conjurer is able to genuinely speed up software development projects, whatever methodology is used. However, agile projects that specialise on small-grained components and on writing test cases upfront stand to gain the most from the tool. Code Conjurer is one small step for test-driven development, one giant leap for agile projects.


[1] M.D. McIlroy. "Mass produced software components", Software Engineering Concepts and Techniques, pages 8898, 1969.
[2] O. Hummel, W. Janjic and C. Atkinson, "Code Conjurer - Pulling Software out of a Hat", IEEE Software, August/September, 2008.
[3] O. Hummel and C. Atkinson: "Supporting Agile Reuse through Extreme Harvesting", International Conference on Agile Processes in Software Engineering and Extreme Programming (XP2007), 2007.


About the Author
Oliver Hummel currently works as a consultant for Perot Systems Germany in Frankfurt. Prior to that he used to work for the Chair of Software Engineering at the University of Mannheim where he received his PhD degree with a dissertation on software component retrieval. Oliver's research interests include software reuse, information retrieval and software development processes. Contact Oliver via e-mail: hummel@informatik.uni-mannheim.de.

Werner Janjic is a research student at the chair for Software Engineering at the University of Mannheim. Werner’s main research interests are practical software reuse in the context of agile development and its impact on the software development lifecycle. He received a diploma in business and computer science from the University of Mannheim. Contact him at the Institute for Computer Science, University of Mannheim, A 5, 6, B238, 68131 Mannheim; janjic@informatik.uni-mannheim.de.

Colin Atkinson holds the chair of software engineering at the University of Mannheim where his research interests focus on object and component technology and their use in the systematic development of software systems. He received his PhD in computer science from Imperial College, London. Contact him at the Institute for Computer Science, University of Mannheim, A 5, 6 Zi. B242, 68131 Mannheim, Germany; atkinson@informatik.uni-mannheim.de.

Comments (0)Add Comment


Write comment

You must be logged in to post a comment. Please register if you do not have an account yet.

busy
Last Updated on Tuesday, 23 June 2009 18:25
 

Agile Marketplace - Announcements and Special Offers

Rally Software Extends Agile ALM Platform to Meet the Unique Needs of Global Organizations
Rally Unlimited Edition – Promote Agile practices throughout your organization by providing a complete system-of-record of each product's status, progress and quality across the full idea-to-deployment lifecycle. Sign-up today for your free trial!

iPhone iPad Developers Conference
The iPhone iPad Developers Conference, September 27-29 in San Diego, is the world's premier independent event dedicated to building and marketing apps for Apple's iPhone, iPad and iPod Touch. The format includes 45+ technical classes, workshops and breakout classes.  It will also be the first major developer conference after the release of iPhone OS4.  CMC subscribers can receive a $100 discount off the Full Event Passport and/or gain free admission to the exhibits (first time registrants only - cannot be combined with other offers) by inserting the code MEDIASPONSOR when prompted on the eRegistration page linked from www.iphonedevcon.com

AgilePalooza - Serious Learning in a Fun Atmosphere
AgilePaloozas are community events sponsored by VersionOne and Agile Journal.  These one day conferences provide serious learning in a fun atmosphere.   Two tracks are included: Learning Agility and Advancing Agility. Speakers include internationally recognized agile coaches and trainers. The next seminar will be held August 27th in Dallas, TX – use discount code agilejournal and save $20!
Register Here


CollabNet Subversion Edge Improves Governance, Security, Administration

Quickly configure SVN, Apache, and ViewVC with one certified stack, fronted by a powerful UI.
Try our beta version and let us know what you think!