Critical mass (software engineering)
Critical mass in software engineering is a term used to describe a stage in software life cycle: when the source code grows too large to effectively manage without a complete rewrite.[1] At the Critical Mass stage, fixing a bug can introduce one or more bugs.[2]
Tools such as high-level programming languages, object-oriented programming languages [3], and techniques such as programming in the large, code refactoring and test-driven development, exist to make it easier to maintain large, complicated programs.
Causes
This section possibly contains original research. (February 2010) |
Any or all of the following can contribute for a project to reach the disorganized state of Critical Mass:
Poor planning
Large software projects are often poorly planned. Sometimes, in an effort to attract investment capital, a "quick and dirty" project is completed. This could succeed completely in its goals — getting investment. The next step is to use the investment and interest to reformulate the project into a more mature and stable version; however, this revision is often skipped, and the flawed initial design is used as a base for adding features. This can quickly lead to a very disorganized and unmaintainable codebase.
Developer turnover
If the original developers of a project leave, newcomers must move the project forward. Poor, nonexistent, or ignored documentation can lead to several incompatible implementations that attempt to solve the same problems. Additionally, the techniques of newcomers might be inherently incompatible with what already exists in the codebase.
Copy-and-paste programming
In order to solve a problem quickly, developers can copy-and-paste code that addresses a similar problem. The code is then modified to address the specific problem at hand. This is considered sloppy programming, and can lead a developer to easily overlook errors in the pasted code.
Solutions
Tools
- Good core development tools (e.g. a capable compiler) should be used with higher warning levels and a commitment to eliminate all warnings.
- Sufficient documentation should exist. It should be concise and comprehensive, and it should be maintained thoroughly.
- Bugs should be fixed as soon as possible to prevent developers from forgetting them. A system for tracking and prioritizing bugs is essential.
- A revision control system should be used, and its ability to include comments should be taken advantage of.
Techniques
- Functions created for tasks instead of using cut-and-paste to duplicate functionality.
- If a function's interface can be improved or simplified, the change should be made to the function and anything that calls it.
- The implementation of a function should be isolated from the function's interface. This is a goal of object oriented programming.
- Disorganized code should be isolated from cleaner code to enhance readability.
- Large applications frequently are built on top of workhorse functions that are invoked as needed. If a workhorse function is going to be used in many places, the function should be easy to use. Complexity belongs in the implementation of the function itself.
- Source formatting conventions should be planned before the project begins. The formatting should be well-documented and consistently applied.
References
This article needs additional citations for verification. (February 2010) |