Featured Whitepapers
- Apples, Oranges, and Acorns - All Agile Development Tools Are Not the Same
- One's Enough for Agile Application Development Management
- Requirements Management 101 – 4 Basics Everyone Should Know
- Tips on Requirements Traceability – Learn How to Control Change and Improve Quality
- Scaling Continuous Integration to Large and Distributed Teams
|
Software people love challenges and want to exercise their brains by tackling difficult problems. Our nature is to understand complicated problems, become familiar with various business domains, and generate a solution that helps the world become a better place. During our journey, we may have to look at complicated code (or “spaghetti code”). If we don't understand the dilemma or code, we risk solving the wrong problem and wasting time and money. This article offers some techniques I have used in the past to muddle through complicated problems and wrap my head around complicated code.
We Are Intelligent However, this technique is not scalable as the problem complexity increases. Relying on intuition has limits. Sometimes, you can look at code all day in bits and pieces and still never get a clear picture. This can be not only unsuccessful but also wasteful. We need a more disciplined, efficient, and effective approach.
Below are four useful techniques. They start with lightweight and intuitive and gradually trend towards more heavy and formal. Each approach has its own context, and you should use it where it is most effective. In my experience, this is the most common way that developers try to solve problems. It is beneficial for straightforward, simple issues. The domain of the problem should be understandable, the code should be readable, and the time taken with this approach should be minimal. The “intuition” approach is good because it is hands free, requires no discipline, and is the quickest in some situations. The drawback is that sometimes it doesn’t scale or just doesn’t work.
It is important to time box how long you work in this manner. Since using “intuition only” is the fastest and simplest method, it often is the correct first choice. However, if progress stops, you should use alternate methods. A common mistake for programmers is to spend too much time using this method before transitioning to a more formal method. Taking notes is effective when trying to understand a complex domain, which could be code or even a sophisticated business process. While you are perusing code, jot down your ideas in a free-flowing manner. If you are listening to a business person explain a process, jot down the process in a free-flowing manner. Now, here is where the novel idea comes in. After you have logged notes, take a step back and analyze them. Organize and structure the notes in a more disciplined manner. The most effective way is to create three sections: Known, Unknown, and Formulated Questions. Write down concepts that you understand clearly as bullet points in the Known section. Following this process, you will derive things that are unclear or not well understood; document these in the Unknown section. From this known and unknown information, you can formulate questions that you will direct at subject matter experts or research yourself at a later time.
This method is lightweight, fast, and extremely effective when you are wrapping your head around something complicated. It helps organize your thoughts, and the output is very direct, containing specific pertinent questions that get to the heart of the matter and eventually lead to a clear understanding. In both shows, the protagonists set out to solve complicated crimes with a multitude of variables and circumstances. While thinking about the problem, they post all the facts and suspects on a bulletin board with thumbtacks. As more information relating to the crime comes through, they draw associations and possible outcomes. How does this relate to software? You can use the same technique when you hit a brick wall and can’t figure out a problem. Take everything you know and lay it out in front of you on a whiteboard or some scratch paper. Stare at it for a while, and draw some relationships between items. Trust your intellectual powers to process the information in front of you, and let your creative juices flow.
On a government project that processed checks, I ran into a race condition issue where several transactions processed data concurrently. It seemed like the data entry disappeared into thin air after it was persisted to the database. I used the FBI board to enumerate all the moving parts. This helped me to qualify the scenarios, run some tests, and discover the problem. The most useful diagrams are sequence diagrams, class diagrams, and activity diagrams. In tandem, they offer both the structural and behavioral aspect of the system. Once you’ve taken the time to generate these diagrams, developers and business members can have a common visual depiction of the system to use as a base to solve problems. Because generating these diagrams sometimes requires significant time and effort compared to the previous techniques, I recommend the UML diagramming technique when the lighter tactics come up short.
I had to resort to UML diagrams when working for a client that developed its own custom model view controller framework. The assignment was to add a simple upload page for a multimedia file. However, the framework had up to seven different layers with delegation and unnecessary code handoffs. It was so convoluted that it was difficult to understand the behavior without creating sequence diagrams. Every class was similarly named, and classes had unclear responsibilities. Drawing diagrams provided the structural and behavioral understanding necessary to make the changes easily.
Thanks to Jacob Orshalick and Mick Curry for reviewing this article.
About the Author Nirav Assar is an independent consultant and owner of Solutionsfit, a consulting firm based in the Dallas-Fort Worth Area. He has consulted on several projects in various industries, such as financial, real estate, government, and retail. His expertise is based in several Java technologies like Grails, Groovy, Spring, and Seam. Agile philosophy is at the heart of his profession, and he enjoys sharing techniques and tools that help software people excel at their jobs. You may contact him at nirav@solutionsfit.com. View his blog at http://assarconsulting.blogspot.com/.
Set as favorite
Bookmark
Email this
Hits: 988 Trackback(0)Comments (2)
|
| Last Updated on Tuesday, 12 July 2011 11:42 |
Agile Marketplace - Announcements and Special Offers
The Business Case for ALM Transformation
Are legacy systems holding your company back? Breakthrough these technical constraints with an open and scalable environment that meets your unique business need to transform. There is no reason to be locked into an obsolete platform. The output of a number of recent transitions from legacy systems, this is practical white paper shares lessons learned and illustrates how guidance and enablement can pave the way for change.
Download this Whitepaper




