Introduction
Open in the Padhaiko app1.1 Software and software engineering
Software
Software consists of:
- Instructions (computer programs) that, when executed, provide desired features, function, and performance.
- Data structures that enable programs to adequately manipulate information.
- Descriptive information (documentation) in both hard copy and virtual forms that describes the operation and use of the programs.
Software Engineering (IEEE Definition)
According to the IEEE Standard Glossary, software engineering is:
- The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software; that is, the application of engineering to software.
- The study of approaches as in (1).
In Pressman's layered technology view, software engineering rests on four concentric/stacked layers built upon an organizational quality focus:
+-------------------------------------------------------+
| Tools | (Automated / CASE support)
+-------------------------------------------------------+
| Methods | (Technical "how-to"s: modeling, design, testing)
+-------------------------------------------------------+
| Process | (Framework: tasks, milestones, deliverables, QA)
+-------------------------------------------------------+
| A Quality Focus | (Bedrock: organizational commitment to quality)
+-------------------------------------------------------+- A Quality Focus: The bedrock supporting software engineering; encompasses Total Quality Management (TQM), Six Sigma, and continuous process improvement.
- Process: The glue that holds the technology layers together and enables rational, timely development. It defines the framework for project management, technical methods, work products, milestones, and change control.
- Methods: Provide the technical how-tos for building software—covering communication, requirements analysis, design modeling, program construction, testing, and support.
- Tools: Provide automated or semi-automated support for the process and the methods (such as IDEs, version control, static analyzers, and test runners).
| Aspect | Computer Science | Software Engineering |
|---|---|---|
| Primary Focus | Theory, algorithms, computability, data structures, and language design | Systematic design, construction, verification, and maintenance of reliable software products |
| Constraint Set | Mathematical correctness and asymptotic complexity | Schedule, budget, team coordination, safety, maintainability, and stakeholder needs |
| Output | Proofs, models, and foundational algorithms | Production-grade software systems, documentation, and lifecycle support |
1.2 Nature and characteristics of software
Unlike physical machines, software is a logical rather than a physical system element. This gives software three defining characteristics that distinguish it sharply from hardware:
- Software is developed or engineered; it is not manufactured in the classical sense.
- Although software development shares some management concerns with hardware manufacturing, its quality and cost are concentrated almost entirely in engineering (design) rather than assembly-line production.
- Duplicating a software binary costs virtually nothing and introduces no assembly defects; errors come from design flaws, not worn molds or bad raw materials.
- Software does not "wear out."
- Hardware exhibits the classic bathtub curve: a high initial failure rate ("infant mortality" due to manufacturing defects), a long flat steady-state period, and a rising failure rate as components suffer physical wear (dust, vibration, heat, corrosion).
- Software is immune to environmental wear. In theory, once early defects are fixed, software failure rate drops to a flat line.
- In reality, software undergoes change (updates, patches, new environments). Each change can introduce new defects (side effects), causing the failure rate to spike and gradually deteriorate over time—a phenomenon called software deterioration.
Failure
Rate Hardware ("Bathtub Curve") Software (Idealized vs. Actual)
^ \ / ^ \ Actual (spikes from changes)
| \ / | \ /\ /\ /\ --> Deterioration
| \_______________/ | \___/ \__/ \/ \
| Infant Steady Wear | \____________________ Idealized
| mort. state out |
+----------------------------> Time +----------------------------> Time- Although the industry is moving toward component-based construction, most software continues to be custom-built.
- Hardware designers assemble systems from standardized, cataloged off-the-shelf components (ICs, resistors, buses) with well-defined electrical interfaces.
- While modern software increasingly reuses libraries, frameworks, APIs, and microservices, large portions of business logic, UI workflows, and domain integration remain custom engineered.
1.3 Software application domains
Pressman classifies modern software into seven broad application domains, each presenting distinct engineering challenges:
| Domain | Description | Representative Examples |
|---|---|---|
| 1. System Software | Programs written to service other programs; heavy hardware interaction, concurrent processing, and strict resource scheduling | Operating systems, compilers, device drivers, networking utilities |
| 2. Application Software | Stand-alone programs that solve a specific business or technical need in real time or batch mode | Point-of-sale billing, payroll systems, banking transaction processing |
| 3. Engineering / Scientific Software | Compute-intensive numerical modeling, simulation, and mathematical analysis ("number crunching") | CAD/CAM tools, finite-element stress analyzers, weather simulators, MATLAB scripts |
| 4. Embedded Software | Resides inside read-only or flash memory of a host product to control hardware features and real-time events | Anti-lock braking (ABS) controllers, microwave keypads, drone flight controllers |
| 5. Product-Line Software | Designed to provide a common capability across many different customers, from mass-market desktop suites to specialized niche apps | Word processors, spreadsheet suites, inventory management packages |
| 6. Web / Mobile Applications | Network-centric, browser- or device-delivered applications integrating hypermedia, APIs, cloud backends, and responsive UIs | E-commerce portals, ride-sharing mobile apps, cloud SaaS dashboards |
| 7. Artificial Intelligence Software | Uses non-numerical algorithms, heuristics, and machine learning to solve complex perception, reasoning, and decision problems | Pattern recognition, NLP chatbots, autonomous navigation, recommendation engines |
1.4 Legacy software
Legacy Software
Legacy software refers to older, mission-critical software systems that were developed years or decades ago using outdated languages, architectures, or hardware platforms, yet continue to perform indispensable business functions.
Characteristics and Problems of Legacy Systems
Although legacy systems remain operationally vital, they commonly suffer from four quality and maintainability issues:
- Inextensible Design: Tightly coupled modules make adding a feature risky and expensive.
- Convoluted Code: Years of quick patches ("spaghetti code") obscure original control flow.
- Poor or Non-existent Documentation: Design docs are lost, and current maintainers were rarely the original authors.
- Missing Test Cases and Change Logs: Without automated regression tests or archived change histories, every modification risks breaking existing functionality.
Why Legacy Software Must Evolve
Organizations do not simply discard legacy software because replacing a proven mission-critical system is costly and risky. Instead, legacy software undergoes evolution for four primary reasons:
- Adaptation: To run on new computing environments, operating systems, or databases.
- Enhancement: To implement new business requirements and user workflows.
- Extension: To interoperate with modern web services, mobile clients, or external APIs.
- Re-architecture: To migrate monolithic code onto modern network or cloud architectures.
1.5 Software crisis
During the late 1960s and 1970s (highlighted at the 1968 NATO Software Engineering Conference), rapid growth in hardware speed and memory enabled organizations to attempt far larger software projects than existing ad-hoc programming practices could handle. The resulting failures became known as the software crisis (today often termed software chronic affliction).
Manifestations (Symptoms) of the Software Crisis
- Schedule and Budget Overruns: Projects routinely finished months or years late and cost multiples of their initial estimates.
- Low Software Quality and Reliability: Delivered programs frequently crashed, produced wrong results, or failed under real workloads.
- Failure to Meet User Requirements: Systems were delivered that solved the wrong problem or were unusable by end users.
- Unmanageable Maintenance Burden: Fixing one bug introduced new bugs elsewhere; maintenance consumed to of total lifecycle expenditure.
- Lack of Progress Visibility: Managers could not measure how much work was truly complete ("90% done for 50% of the schedule").
Root Causes of the Software Crisis
- Ad-hoc ("Code-and-Fix") Development: Jumping straight into coding without requirements analysis, architectural design, or planning.
- Inherent Complexity: Software size and logical state space grew exponentially faster than informal human mental models.
- Poor Communication: Ambiguous specs and weak collaboration between customers and developers.
- Underestimation of Testing and Maintenance: Treating testing as an afterthought at the end of a project.
1.6 Software myths
Software myths are misleading, deeply held beliefs about software and the process used to build it. Because they sound plausible, managers, customers, and practitioners act on them—causing poor decisions and project failure.
| Management Myth | Reality |
|---|---|
| "We already have a book full of standards and procedures; that gives my team everything they need." | Unused binders on a shelf help nobody; standards must reflect real modern practice and be actively adopted by engineers. |
| "If we fall behind schedule, we can add more programmers and catch up." | Brooks's Law: Adding people to a late software project makes it later, because existing engineers must pause work to train newcomers and communication overhead grows quadratically as . |
| "If we outsource the project to a third party, we can relax and let them build it." | An organization that cannot manage and specify software internally will also fail when managing an external vendor. |
| Customer Myth | Reality |
|---|---|
| "A general statement of objectives is sufficient to begin writing programs; we can fill in details later." | Vague initial goals are a leading cause of rework; unambiguous requirements are needed up front, or via disciplined iterative feedback. |
| "Software requirements continually change, and software is flexible enough to accommodate every change easily." | While software can be changed, the cost of change grows dramatically from requirements/design into coding and post-release maintenance if architecture is not planned for flexibility. |
| Practitioner Myth | Reality |
|---|---|
| "Once we write the program and get it to work, our job is done." | Industry data shows of total software effort occurs after the first release, during maintenance and evolution. |
| "Until I get the program running, I have no way of assessing its quality." | Technical reviews (walkthroughs and inspections) detect defects far earlier and more cheaply than waiting for runtime execution. |
| "The only deliverable for a successful project is the working program." | A working program is only one component; maintainable systems require models, design docs, test suites, and user/operator documentation. |
| "Software engineering makes us create voluminous, unnecessary documentation and slows us down." | Software engineering is about creating quality at every step, not bureaucracy; disciplined design and testing reduce rework and speed up delivery. |
1.7 Software engineering practice: Essence of practice, general principles
The Essence of Practice (George Polya's Four Steps)
Pressman adapts mathematician George Polya's problem-solving framework into four universal steps for software engineering practice:
- Understand the problem (Communication and Analysis):
- Who are the stakeholders? What are the unknowns (data, functions, features, constraints)?
- Can the problem be compartmentalized into smaller sub-problems? Can it be represented graphically (models)?
- Plan a solution (Modeling and Software Design):
- Have you seen similar problems before (design patterns, reusable components)?
- Can sub-problems be solved independently? Can you represent the design cleanly before writing code?
- Carry out the plan (Code Generation):
- Does the solution conform to the plan? Is every component verifiable (reviewed and tested)?
- Examine the result for accuracy (Testing and Quality Assurance):
- Can each component be tested? Does the solution produce outputs consistent with requirements and stakeholder expectations?
David Hooker's Seven General Principles of Software Engineering
Hooker's Seven Core Principles
- The First Principle — The Reason It All Exists: A software system exists solely to provide value to its users. Every technical decision should serve user value.
- The Second Principle — KISS (Keep It Simple, Stupid!): All design should be as simple as possible, but not simpler. Simple designs are easier to understand, test, and maintain.
- The Third Principle — Maintain the Vision: A clear architectural vision keeps individual compromises from fragmenting the system into an incoherent patchwork.
- The Fourth Principle — What You Produce, Others Will Consume: Write code, interfaces, and documentation assuming someone else will read, debug, extend, and operate them.
- The Fifth Principle — Be Open to the Future: Never design yourself into a corner. Anticipate hardware shifts, scaling, and changing business rules through clean modularity.
- The Sixth Principle — Plan Ahead for Reuse: Reusing proven code and designs saves time and improves quality; designing reusable abstractions takes foresight.
- The Seventh Principle — Think!: Placing clear, disciplined thought before action produces better architectures and fewer rework cycles.
Worked Examples
1.1
A software team of engineers is running weeks behind schedule. Management proposes adding new engineers immediately to recover the lost time. Compute the number of pairwise communication channels before and after adding the new engineers, and explain why Brooks's Law warns against this decision.
Compute Pairwise Communication Channels Before Expansion (): Using the pairwise communication formula :
Compute Pairwise Communication Channels After Expansion ():
Increase in communication channels:
Apply Brooks's Law to the Scenario:
- Experienced engineers must stop writing code to onboard the newcomers on codebase structure, domain rules, and tooling (ramp-up cost).
- Communication overhead jumps from to channels, consuming meetings and code-review bandwidth.
- Consequently, net productivity drops in the short term, pushing the late project even further behind schedule.
Communication channels jump from (for engineers) to (for engineers)—an addition of channels. By Brooks's Law, adding engineers to an already late project increases onboarding and coordination overhead so sharply that it delays delivery further.
1.2
Suppose a generic enterprise software product takes to develop up to its first production release. Historical data for similar systems indicates that initial development accounts for of total lifecycle cost, while post-release maintenance and evolution account for the remaining . Calculate the projected total lifecycle cost and total maintenance cost, and relate this to software deterioration and practitioner myths.
Calculate Total Lifecycle Cost: Let be the total lifecycle cost. Since development cost represents () of :
Calculate Projected Maintenance Cost:
(Equivalently, , which is the initial build cost.)
Connect to Software Engineering Concepts:
- This refutes the practitioner myth "Once the program works, our job is done": three-quarters of total effort happens after release.
- Without clean architecture, automated tests, and documentation (Hooker's 4th and 5th principles), repeated changes cause software deterioration, driving maintenance costs even higher.
Total lifecycle cost is , of which () is post-release maintenance. This illustrates why maintainability, documentation, and clean design are critical from day one.
1.3
How to Answer a Past Exam Question: "Explain why software does not wear out like hardware, yet still deteriorates over time. Sketch the failure-rate curves for both."
Structure the Answer in Three Exam-Ready Parts:
- Define the Hardware Bathtub Curve: Explain the three phases—infant mortality (manufacturing flaws), steady-state useful life (low random failures), and wear-out (physical degradation from heat, dust, corrosion, friction).
- Contrast with Idealized Software: State that software is logical, not physical, so environmental stress cannot degrade code. Once early bugs are removed, the idealized failure rate becomes flat.
- Explain Software Deterioration (Actual Curve): Explain that software undergoes continuous change (bug fixes, OS updates, new features). Each change risks introducing side-effect defects, causing failure-rate spikes that gradually raise the baseline until maintenance becomes unsustainable.
Include Neat Labeled Diagrams: Always draw both curves side by side with labeled axes (Failure Rate vs. Time), marking Infant Mortality, Useful Life, and Wear-Out on hardware, and Idealized Curve, Change Spikes, and Actual Deterioration Curve on software.
A complete exam answer contrasts hardware's three-phase physical bathtub curve against software's flat idealized curve and rising actual deterioration curve (caused by side effects introduced during repeated changes), supported by clearly labeled Failure Rate vs. Time sketches.
Exercises
Practice Exercises — Introduction to Software Engineering
Define software and software engineering. Explain Pressman's four-layer technology model of software engineering with a neat block diagram.
Definitions:
- Software comprises computer programs (instructions), data structures, and descriptive documentation needed to operate and maintain the programs.
- Software engineering (IEEE) is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software.
Four Layers of Software Engineering:
- Quality Focus (Bedrock): Organizational commitment to continuous improvement and quality standards.
- Process: Framework defining activities, milestones, deliverables, and quality checkpoints.
- Methods: Technical how-tos covering analysis, modeling, design, coding, and testing.
- Tools: Automated or semi-automated support (IDEs, version control, CI runners) assisting methods and processes.
Software consists of programs, data structures, and documentation; software engineering applies systematic, disciplined, quantifiable engineering practices to it across four stacked layers: Quality Focus (base), Process, Methods, and Tools (top).
Distinguish between hardware and software characteristics with respect to manufacturing, failure rates over time, and component-based construction.
1. Development vs. Manufacturing: Hardware costs are heavily concentrated in physical manufacturing and materials, where assembly defects occur. Software costs are concentrated in engineering/design; duplicating software copies costs almost nothing.
2. Wear-Out vs. Deterioration: Hardware follows a bathtub curve and eventually wears out due to physical stress (heat, vibration, corrosion). Software does not physically wear out, but deteriorates because every modification can inject new defects (side effects).
3. Component Reuse: Hardware systems are routinely assembled from standardized off-the-shelf components (ICs, modules). Although software reuse via libraries and APIs is growing, significant custom development remains common.
Hardware is manufactured, wears out physically (bathtub curve), and relies heavily on off-the-shelf components; software is engineered, does not physically wear out (though it deteriorates under repeated changes), and still involves substantial custom construction.
What is legacy software? Explain four reasons why legacy software must evolve rather than simply being discarded.
Definition of Legacy Software: Legacy software consists of older, mission-critical systems built with outdated tools or architectures that remain essential to core organizational operations, despite convoluted code and scarce documentation.
Four Reasons Legacy Software Evolves:
- Adaptation: Must be modified to operate on newer hardware, OS versions, or database engines.
- Enhancement: Must incorporate new business rules and user features.
- Extension: Must connect with modern web services, mobile apps, or external APIs.
- Re-architecture: Must migrate toward maintainable, scalable architectures when monolithic structures become bottlenecks.
Legacy software is older mission-critical software still essential to business operations. It must evolve through adaptation (new platforms), enhancement (new requirements), extension (interoperability with modern systems), and re-architecture (modernization) because total replacement carries high cost and operational risk.
A software project team currently has developers. Due to pressure from management, additional developers are added mid-project. Calculate:
- The initial and new number of pairwise communication channels.
- The percentage increase in communication channels.
- Identify the management myth illustrated here and state the reality.
Part 1 — Pairwise Communication Channels: Before adding staff ():
After adding developers ():
Part 2 — Percentage Increase:
Part 3 — Management Myth and Reality: This illustrates the myth "If we fall behind schedule, we can add more programmers and catch up." In reality (Brooks's Law), onboarding newcomers interrupts existing developers and triples communication paths ( for only staff), often delaying the project further.
- Communication channels rise from to .
- Percentage increase is .
- Myth: adding programmers to a late project speeds it up; Reality (Brooks's Law): onboarding and quadratic communication overhead usually delay it further.
State Polya's four-step essence of software engineering practice and list David Hooker's seven general principles of software engineering.
Essence of Practice (Four Steps):
- Understand the problem: Identify stakeholders, unknowns, constraints, and sub-problems.
- Plan a solution: Recall similar designs/patterns and structure the architecture before coding.
- Carry out the plan: Implement the design carefully while verifying each piece.
- Examine the result for accuracy: Test thoroughly and validate against user requirements.
Hooker's Seven General Principles:
- The reason it all exists (provide user value).
- KISS (keep it simple, stupid).
- Maintain the vision.
- What you produce, others will consume.
- Be open to the future.
- Plan ahead for reuse.
- Think!
Polya's four steps are Understand the problem, Plan a solution, Carry out the plan, and Examine the result for accuracy. Hooker's seven principles are: Provide user value, KISS, Maintain the vision, Write for others to consume, Be open to the future, Plan ahead for reuse, and Think!