Software Design Principles & Cost Estimation Methods

Coupling and Cohesion in Software Engineering

Coupling and Cohesion are fundamental concepts in software engineering that describe the relationships between modules in a system.

Coupling

Coupling refers to the degree of interdependence between modules. The lower the coupling, the better the design, as tightly coupled modules are more difficult to maintain and modify.

Types of Coupling

  • Tightly Coupled: Modules rely heavily on each other, making changes difficult.
  • Loosely Coupled: Modules are independent and interact minimally, allowing easier modifications.

Cohesion

Cohesion refers to how closely the functions within a module are related. A highly cohesive module focuses on a specific task, making code more readable and maintainable.

Types of Cohesion

  • Low Cohesion: A module performs unrelated tasks, making it difficult to understand.
  • High Cohesion: A module is focused on a single, well-defined task.
AspectCouplingCohesion
DefinitionInterdependence between modulesRelationship among functions within a module
Ideal CaseLow couplingHigh cohesion
EffectsAffects maintainability and flexibilityAffects readability and modularity
ExampleModule interaction via API vs. direct data accessFocused vs. scattered functionalities within a module

Top-Down and Bottom-Up Programming Approaches

Top-Down and Bottom-Up Programming are two fundamental approaches to software development and system design.

Top-Down Programming

  • Starts with a high-level overview of the system.
  • Breaks the problem into smaller subproblems.
  • Each subproblem is refined until it can be implemented.
  • Commonly used in structured programming (e.g., C, COBOL).

Bottom-Up Programming

  • Begins with small, reusable components.
  • These components are integrated to form larger systems.
  • Often used in object-oriented programming (e.g., C++, Java, Python).
  • Encourages modularity and reusability.
AspectTop-Down ApproachBottom-Up Approach
Starting PointHigh-level system overviewSmall, reusable components
Development StyleBreaks system into smaller partsBuilds components first, then integrates
Programming ParadigmStructured programmingObject-oriented programming
ReusabilityLess focus on reusabilityHigh focus on modularity and reusability
ExampleUniversity system designed from broad functionalitiesUniversity system built from independent modules

Software Cost Estimation in Project Management

Cost estimation is the process of predicting the financial resources required to complete a project successfully. It involves assessing labor, materials, equipment, and other expenses to ensure proper budgeting and resource allocation.

Types of Cost Estimation

There are several methods used to estimate costs, depending on the complexity and nature of the project:

  1. Analogous Estimation

    • Based on historical data from similar projects.
    • Quick and cost-effective but may lack accuracy.
    • Example: Estimating the cost of a new banking application by referencing a previously developed banking system.
  2. Parametric Estimation

    • Uses mathematical models and statistical relationships.
    • More accurate than analogous estimation.
    • Example: Estimating software development costs based on the number of lines of code or function points.
  3. Bottom-Up Estimation

    • Breaks the project into smaller components and estimates each separately.
    • Highly detailed and accurate but time-consuming.
    • Example: Estimating costs for each module in a Visual Basic application and summing them up.
  4. Top-Down Estimation

    • Estimates the overall project cost first, then distributes it among components.
    • Faster but may overlook details.
    • Example: Allocating a fixed budget for a Spiral Model-based software development project and dividing it among phases.
  5. Three-Point Estimation

    • Uses optimistic, pessimistic, and most likely estimates to calculate an average.
    • Helps account for uncertainties.
    • Example: Estimating the cost of a cooperating process system by considering best-case, worst-case, and expected scenarios.
  6. Expert Judgment

    • Relies on industry experts to provide cost estimates.
    • Useful when historical data is unavailable.
    • Example: Consulting experienced developers to estimate the cost of implementing virtual memory management in an operating system.