TrainingConferencesAbout UsContact UsAdvertiseSQE.comRSS Feed

StickyMinds.com: brain food for building better software

Log In
 Clarify Your Search Criteria

Tips on Using Our Search Feature(s)
 
StickyMinds.com Home
ResourcesTopicsCommunityPowerPassBlogs
Home  >  Detail: Reusability vs. Usability: Where to Draw the Line?



A StickyMinds.com Original
Article Picture
Reusability vs. Usability: Where to Draw the Line?

By Linda Hayes

Send This Content to a FriendGet a Short Link to This ContentPrint This ContentSee User Comments About This Content

Summary: Arbitrary reuse of code components could deteriorate overall usability. In this week's column, Linda Hayes explains the good and bad qualities of reusability and five factors one should keep in mind when managing reusability to get the most of it.


TechExcel, Inc.
Reusability is one of those attributes we assume is good. After all, reusability implies less work. Isn't it easier to use something that already exists than it is to create something new? Not necessarily. Sometimes, reusability creates more problems than it solves. The trick is to know where to draw the line

The Bright Side
An axiom of software and test automation development is that less code means less development and maintenance. This leads to strategies for reusing code whenever possible, usually by organizing code into components that perform discrete tasks that can be shared in multiple places. Done right, this can save coding time and effort.

You may even buy reusable code components. Software libraries provide generic functionality for common tasks such as spell check, sending emails, or designing reports. You can also acquire custom controls to add power and pizzazz to your user interface with minimal effort.

Reusable components are also employed in keyword test automation frameworks to shield less-technical users from the complexities of coding. In this scenario, skilled scripters develop a component library that can then be assembled into test cases by domain experts. As with software components, you could acquire libraries from others and shortcut implementation time.

Clearly, reusability has benefits, but there are some drawbacks.

The Dark Side
Without proper design and control, reusability can reduce code readability, maintainability, and usability. Code readability is compromised when the reusable segments make it difficult to understand the logical flow of the code without actually tracing the execution. Depending on the level of component granularity, debugging code comprising components may actually take longer than linear code.

This, in turn, may cripple maintainability, as future changes could take longer or introduce unexpected effects because the coder has an incomplete understanding of the potential impact of modifications. Extensive use of reusable components requires the developer to understand the function of each component. This isn't always the case, especially for someone new, and may make the learning curve steeper. And changes to a widely used component can, naturally, have far-reaching and sometimes unintended results.

In test automation, complex application behavior may result in too many components, thus confusing users and reducing usability. In one project, a company that developed hospital management software decided to employ a keyword framework so their business analysts, who understood the ins and outs of the functionality but had no coding skills, could develop automated tests.

It started out well enough, but as users encountered variations in behavior, they had to request additional components. For example, the admissions process varied based on whether the patient requested a semi-private or private room, whether a private room was covered by insurance, and if the type of room requested was available. Each of these variants caused a change in the application behavior and thus required another component.

After about six months, the number of components swelled to over seven hundred, overwhelming the developers and confusing users. Selecting the right component and fitting them together became, as one user described, like a "giant jigsaw puzzle" where the pieces were so small it was hard to see where they fit into the overall picture. In the end the framework was abandoned. So, where do you draw the line between reusability and usability?

Drawing the Lines
Managing reusability to gain the greatest benefit and avoid pitfalls depends on five factors:
  1. Overall Design. Unless you start with the big picture, designing the pieces will be an ad hoc process and, therefore, endless. Begin with a well-thought-out architecture so you know which components can and should be reused, where they fit, and their precise function.
  2. Balance Granularity. Resist the urge to make too many components. The greater the number of components, the harder it becomes to manage and maintain them. Some duplication of lines of code may be preferable to managing yet another component. Less may be best.
  3. Enforce Standards. You can't use a component if you don't know it exists, where to find it, or what it does. This means that naming, documentation, and design conventions are a must. Mystery components will clutter your library and cause duplication and confusion.
  4. Centralize Control. As with any software, changes to components must be tightly managed, including version and change control. Don't let just anyone modify a component to suit her needs, as this may cause unforeseen problems.
  5. Provide Training. Make sure everyone on the team is trained on the component library, including where it can be found, the names of the components, the functions of each component, and the conventions and procedures for managing them.

Done right, reusability and usability enable each other. Approached casually, they work against each other. So don't just assume reusability is right: Make sure it is.


About the Author
Linda G. Hayes is a founder of Worksoft, Inc., developer of next-generation test automation solutions. Linda is a frequent industry speaker and award-winning author on software quality. She has been named as one of Fortune magazine's People to Watch and one of the Top 40 Under 40 by Dallas Business Journal. She is a regular columnist and contributor to StickyMinds.com and Better Software magazine, as well as a columnist for Computerworld and Datamation, author of the Automated Testing Handbook and co-editor Dare To Be Excellent with Alka Jarvis on best practices in the software industry. You can contact Linda at lhayes@worksoft.com.

Back to Top
 

StickyMinds.com Weekly Column From 12/15/2008 

Member Comments
Add Your CommentExpand Comments
 
Comment:    
by Mohammad Alam 12/19/2008

Linda,
I am so glad that you have addressed this issue of "Know when to say No" to reusability. Since most test automation engineers have development experience, some of them do get carried away and loose sight on usability and maintenance. Reusability and complexity of the code go hand in hand. The more reusability you want the more complex code you need to write. And the more complex code you write the harder it is to maintain. The reality is you are probably not going to find a large number of testers who have sophisticated programming skills. So, I guess the trick is to use the reusability such that a person with little...Read On

Author's Response:
12/20/2008    
Well said, Mohammed. Everyone thinks reusability enables maintenance but the truth can be exactly the opposite. The code becomes so complex it can't be easily understood and is therefore harder to maintain.

 
 
Comment:    
by Llarry Amrose 12/19/2008

When Reusability Goes Wrong: when I started at my current job, 12 years ago, there was a developer who, fortunately, left early on. Still, it took a number of years to expunge some of the problems he caused. He took reusability to an extreme, creating large, cumbersome units combining superficially related tasks behind a maze of sliding panels and case statements. Even the input forms were combined into one giant "formzilla" with fields and flows turned on or off as needed. Trying to modify one case would often have undesired consequences, but it was only recently that we were able to commit the time and effort to thoroughly break apart...Read On

Author's Response:
12/19/2008    
Sorry to hear of your suffering, Larry, but your story is all too familiar. I think some coders exult in complexity for reasons hard to understand. Give me a linear plodder over an evil genius anytime!

 
 
Comment:    
by Sanat Sharma 12/15/2008

Good points, Linda. Now days, my team is testing one web application where the programmers had used the already written code (for some GUI enhancements) without even thinking of about what they are copying and whether it is right or not. And for any questions, the response from their side is amazing, irrational and thoughtless. I am surprised how come one can copy the code without even giving a single thought on it. I would definitely refer them your article and hope they will get some clear picture about "Reusability" and "Usability".

-- Sanat Sharma
http://www.xtremeedge.blogspot.com



Author's Response:
12/17/2008    
Sorry to hear that, Sanat. Sometimes developers get under the gun and do what's fast instead of what's right. Hope the column helps!

 
 
Comment:    
by william Ames 12/15/2008

Good article. I find rules 4 & 5 are often ignored with bad results. I would add don't put anything into a directory or library of reusable code until it is going to be used in more than one application. This helps to keep the number of reusable modules from exploding. A good unit test (junit or whatever) will often help a developer decide if he/she should in fact use the module.

Author's Response:
12/15/2008    
Good point, William. I should have mentioned the unit test! Of course you don't want to share or reuse a component that isn't well tested.

 
Back to Top



 
Ads By Google
What's This?
 
 



Home   |   Resources   |   Topics   |   Community   |   PowerPass



© 2010 StickyMinds.com. All rights reserved.
StickyMinds.com is a division of Software Quality Engineering.
Privacy Policy    Terms & Conditions    Link to StickyMinds.com    Feedback


MicroFocus




STAREAST 2010 


Better Software Conference