|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Product Reviews Large Scale Software Development in Java: Issues and Solutions
Large Scale Software Development in Java: Issues and Solutions
By: Sriram Sankar
Oct. 1, 1998 12:00 AM
As developers are increasingly using Java for advanced applications, they've become dependent on the availability of scalable technologies and tools to support their development, including quality assurance (QA), testing, maintenance, release and customer support requirements. The technologies available today have been inherited largely from those available for languages such as C and C++, including visual IDEs and a host of other tools that offer a solution to a particular problem. A few tools have been tailored specifically for Java and enhance the strengths of the language (like the incremental IDE VisualAge and InstallShield's installer for Java that allows Java applications to be installed onto any Java-compliant platform). This article discusses specific issues related to large-scale software development in Java, suggests ways to address them and concludes with an overview of the Metamata (derived from meta-automata) toolsuite's answer to some of these problems. While large-scale software development in Java faces some of the same issues as those of other languages, some are unique to Java. Factors related to C and C++, such as memory leaks, don't exist in Java because of garbage collection. On the other hand, Java introduces different issues such as thread analysis and memory debugging. Standard IDEs don't address most of the problems that arise during large-scale software development. In fact, they aren't designed to be a complete solution for large-scale development. Hence their functionality must be augmented with specialized tools.
Organization and Maintenance of Software Components Typically, time constraints and insufficient experience combine to introduce defects in the way software systems are architected, leading to decreased quality and larger overheads in managing and maintaining the system. As an answer to this problem, a number of studies have measured software systems for complexity, which has led to a standardized set of software quality metrics. While there's no substitute for experienced project managers, the metrics do offer insight into assessing software complexity and quality. It's also important to be able to detect inconsistencies in the program as it changes. Typically, a program may be changed in one place, but the effect of these changes in other places is overlooked. For example, by changing a type it's possible to make an existing type cast located in a different module no longer necessary, and also overlook this type cast.
Time Constraints Organizing a system into well-architected components and reusable libraries goes a long way toward solving this problem. Yet developer tools still need to be smart about how much rebuilding they have to do for each small change. The best solution to this problem is incremental development environments such as VisualAge. They recompile only the minimum amount necessary when a system is changed. This concept of incrementality can also be extended to other activities beyond the standard development steps to include QA, testing and so forth.
Memory Management Unfortunately, garbage collection can take a significant amount of time when systems use a lot of memory, severely contributing to performance degradation. Most Java programmers today assume that they have to live with this in large Java programs. The solution is to actively manage memory, and simply let the garbage collector kick in for the smaller chunks of memory as well as what slips through the cracks of the explicit memory management routines. Hopefully, better garbage collection algorithms will become available shortly in Java Virtual Machines and the problems related to garbage collection will soon be a memory; the next six months will reveal this possibility. Another memory-related problem specific to Java is leaks due to the unrelinquishment of memory that's no longer necessary. In Java the garbage collector can only recycle memory that isn't being retained by the user program. Memory retained erroneously by the user program will never be collected, even if it's not used anymore. To solve these problems, debuggers and profilers need to provide specialized features for Java. Debuggers should provide capabilities to determine whether a memory leak is occurring, and profilers should provide insight into the details of memory allocation.
Performance Good profilers are important with Java. Information provided by profilers can help developers modify their programs to run faster. Furthermore, a certain amount of code optimization during the compilation process can also improve performance. For example, field access can be inlined, and certain classes and methods can be made final during final packaging of a system.
Threads A lot of research has been devoted to understanding the issues of multithreaded systems over the past 20 years. The Java language design offers state-of-the-art features based on this research, which does contribute to simplifying thread-based systems. However, a good language alone is not enough - there's also the need for good debugging and analysis tools to facilitate a better understanding of how a multithreaded system works. I believe the best way to deal with threads is to have a diagnostic capability in which probes are permanently inserted within the Java program. These probes save information pertaining to program execution, which can then be used later to analyze the program's behavior. This analysis can be performed to ensure that certain properties always hold (e.g., no two threads simultaneously execute a certain portion of code).
Safety In mission-critical systems some assumptions are important and require enforcement. Similarly, in multithreaded systems where it's often impossible to reproduce a problem, the violation of any assumption must be reported. Providing diagnostic APIs solves this problem, allowing assumptions to be built into the program as constraints that must hold during the program's execution. Tools to help manage them are needed to encourage users to write such constraints. One important capability necessary to encourage using diagnostic constructs is an easy way to strip out these constructs when it's time to package the system for final shipping.
Portability
Only a few problems exist in writing portable Java applications. The most important: While these problems are really quite trivial when compared to the issues involved in porting programs written in other languages, the promise of "write once, run everywhere" exacerbates these problems when developers expect their Java program to run smoothly everywhere. The only real way to solve this problem is to test Java systems on as many platforms as possible. In addition, several heuristics to writing portable Java programs have been developed over the past couple of years. Facilitating portable testing and checking Java programs for certain portability heuristics violations can help developers in writing portable Java programs.
Developing Multiplatform Applications
Platform Accessibilty One thing to do is to ask the customer to run a general probing tool that provides full information on the customer's Java environment. It's also useful to have a version of the software that's heavily instrumented and then ask the customer to attempt to reproduce the problem using this instrumented version. Usually, it should simply be the shipped application running with a special environment setting. Then it's possible to study why the application runs differently on the customer's machine.
Build Reusable Libraries As a result, it's necessaray to trim these libraries down to only the essential pieces of code to enable systems to be packaged for release.
Obfuscation
Conclusion One year ago a 100,000-line Java program was large and there were only a handful of them. If a system could handle tens of thousands of lines of code, it was good enough. Today many Java programs exceed 100,000 lines, and soon we should start seeing a few programs reach a million lines of code. Tool builders will therefore be required to scale up their tools to handle such large systems efficiently. We should also see new Java Virtual Machines capable of running much faster than current ones and significantly closing the gap between native code and interpreted execution. There'll also be native Java compilers that can compile code to execute natively on a platform-by-platform basis. The performance issues will essentially disappear once this happens. These are very exciting times indeed for the Java community and I look forward to a more mature set of Java developer tools at next JavaOne! Reader Feedback: Page 1 of 1
Your Feedback
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||