Software Engineering
सॉफ्टवेयर इंजीनियरिंग
Unit overview: the topics below, with their summaries, are the syllabus for this unit. The comprehensive note further down covers every topic in full — explanations, definitions, worked examples, tables, exam points and practice questions — and the short revision note after it is only a quick recap. Standalone one-topic learning pages are not built yet — every topic on this page is covered in the notes and the practice questions below, and each topic card links to those sections.
Premium chapters for this unit
SDLC models → premium chapter · free preview · ~22 min · 4 practice questions
Testing & quality → premium chapter · free preview · ~22 min · 4 practice questions
Estimation & project management → premium chapter · free preview · ~24 min · 4 practice questions
Topics checklist — with weightage (platform estimate from past-question frequency, not an NTA guarantee)
SDLC models
High weightageWaterfall, agile, spiral, RAD — when each fits.
Testing & quality
High weightageBlack/white-box, unit/integration, CMM, ISO.
Estimation & project management
MediumCOCOMO, function points, risk management.
Comprehensive unit note · ~21 min read
Software engineering is the discipline of building software that is correct, usable, maintainable, and delivered on time and within budget, rather than merely writing code that runs once. A small program written for one user can be produced informally, but a system used by thousands of people, changed over years, and maintained by people who did not write it, needs a process. Without that process, requirements drift, defects are found late when they are most expensive to fix, and nobody can say with confidence what the system does, what it costs, or when it will be ready. This unit follows a software system through its life. It starts with the life-cycle models that organise work, from the sequential waterfall to iterative, risk-driven, and agile approaches, and asks when each model fits and when it fails. It then examines requirements, the foundation of everything that follows: how needs are elicited from stakeholders, written into a software requirements specification, and separated into what the system must do and the qualities it must show while doing it. Design follows, with principles for dividing a system into modules that are loosely coupled and highly cohesive, and with diagrams that describe data flow and object structure before code is written. Testing and quality form the second half of the unit. Testing is not a single activity at the end but a ladder from unit tests of one module, through integration and system tests, to acceptance tests against the customer's needs. Black-box techniques test behaviour from the specification, white-box techniques test the code structure itself, and measures such as cyclomatic complexity give a number for how hard a module is to test. Quality assurance wraps all of this in reviews, standards, and maturity models. Finally, the unit covers estimation and project management: how size is measured in lines of code and function points, how effort and schedule are predicted with COCOMO, and how risks, critical paths, and schedules are managed so a project finishes rather than merely starts.
Learning objectives
- Compare waterfall, V-model, incremental, spiral, RAD, prototyping, and agile models and select a model for a given project situation.
- Distinguish functional from non-functional requirements and describe the contents and qualities of a good SRS.
- Apply coupling and cohesion principles and read basic DFD and UML diagrams.
- Distinguish testing levels and black-box from white-box techniques, and apply equivalence partitioning, boundary value analysis, and basis-path testing.
- Compute cyclomatic complexity from a flow graph or predicate count and interpret coverage measures.
- Describe CMM levels, ISO 9000, reviews, and software quality assurance activities.
- Compute unadjusted and adjusted function points and apply basic and intermediate COCOMO estimation.
- Explain risk management steps and PERT and CPM scheduling, including critical path and slack.
Overview: what this unit covers
Read this unit as the story of one project. First the team chooses a life-cycle model and agrees what to build, which is the SDLC and requirements part. Then it designs the system in modules, which is the design part. Then it builds and tests the system level by level, checks its quality against standards, and manages the whole effort with estimates, schedules, and risk plans. The examination rewards the ability to match a situation to a model, a defect to a testing level, and a number to an estimation formula, so practise those three kinds of judgement as you read.
SDLC models
The software development life cycle is the sequence of phases through which software passes: requirements, design, implementation, testing, deployment, and maintenance. A life-cycle model organises these phases and decides when each is revisited. The waterfall model runs the phases strictly in sequence, with each phase completed and reviewed before the next begins. Its strength is clarity and documentation, which suits small projects with stable, well-understood requirements. Its weakness is rigidity: returning to an earlier phase is expensive, and the customer sees working software only late, when changes are costly. The V-model extends the waterfall by pairing each development phase with a matching test phase: requirements pair with acceptance testing, system design with system testing, detailed design with integration testing, and coding with unit testing. Testing is therefore planned early even though it is executed late, which catches mismatches between a phase and its verification earlier than a plain waterfall does.
The incremental model delivers the system in pieces. A first increment provides core functionality, and later increments add features, so users get working software early and feedback shapes later increments. It suits projects where requirements are partly known and early delivery matters, but it needs a stable architecture from the start or later increments become hard to integrate. The spiral model is risk-driven: each loop around the spiral passes through planning, risk analysis, engineering, and evaluation, and the radius grows as the product grows. Risk analysis is its defining feature, so it suits large, high-risk, or unprecedented projects, at the cost of complexity and the need for risk expertise. Rapid application development, or RAD, compresses delivery with prototypes, reusable components, and close user involvement in short cycles, but it needs users who can commit time and a system that can be modularised. Prototyping builds a throwaway or evolutionary mock-up to clarify unclear requirements, especially user interfaces, before committing to full development; it reduces requirement risk but can mislead users into thinking the prototype is nearly the finished product.
Agile methods replace big upfront planning with short, adaptive iterations. The Agile Manifesto values individuals and interactions, working software, customer collaboration, and responding to change over processes, comprehensive documentation, contract negotiation, and following a plan. Scrum organises work into sprints, usually a few weeks long, with a product backlog of desired features, a sprint backlog for the current sprint, a daily stand-up meeting, a sprint review, and a retrospective. Its roles are the product owner, who owns priorities, the Scrum master, who protects the process and removes obstacles, and the development team, which delivers the increment. Extreme Programming, or XP, pushes good practices to extremes: pair programming, test-driven development, continuous integration, small releases, simple design, and refactoring. It suits small teams with changing requirements and an available customer, but it is harder to scale to very large or safety-critical systems. Selecting a model is a judgement question: stable requirements and a fixed contract favour waterfall or the V-model, unclear requirements favour prototyping or spiral, early delivery favours incremental or agile, and high risk favours spiral. A good answer names the model and the project feature that justifies it, not merely the model name.
Requirements engineering turns stakeholder needs into an agreed specification. Elicitation gathers needs through interviews, questionnaires, observation, workshops, and studying existing documents. Analysis resolves conflicts, checks feasibility, and prioritises. The result is written in a software requirements specification, or SRS, which should be correct, unambiguous, complete, consistent, verifiable, modifiable, and traceable. A requirement is verifiable if a test can decide whether it is met; a vague requirement such as fast response fails that test, while response within two seconds for a stated load passes it. Functional requirements state what the system must do, such as allowing a teacher to upload marks. Non-functional requirements state qualities and constraints, such as performance, security, usability, reliability, and portability. Confusing the two is a common error: a statement about speed or security is non-functional even when it describes an important behaviour.
Testing & quality
Design translates requirements into a structure that can be built. Two principles govern module design. Coupling measures how strongly modules depend on each other; low coupling is desired, because a change in one module then affects few others. The scale runs from content coupling, the worst, where one module reaches inside another, through common and control coupling, to stamp, data, and message coupling, the loosest, where modules communicate only through parameters or messages. Cohesion measures how closely the parts of one module belong together; high cohesion is desired. The scale runs from coincidental cohesion, the weakest, where parts are grouped arbitrarily, through logical, temporal, and procedural cohesion, to communicational, sequential, and functional cohesion, the strongest, where every part contributes to one well-defined task. A design with low coupling and high cohesion is easier to understand, test, and change, and the examination frequently asks which end of each scale is desirable.
Data flow diagrams describe movement of data, not control flow. A context diagram shows the whole system as one process with external entities and data flows. Lower levels decompose processes, showing data stores, flows, and transformations in more detail, while balancing requires that flows entering and leaving a decomposition match the parent diagram. The unified modelling language, or UML, describes object-oriented systems: a class diagram shows classes, attributes, operations, and relationships such as association, aggregation, and inheritance; a use case diagram shows actors and the goals they achieve with the system; a sequence diagram shows messages between objects over time; and a state diagram shows how one object changes state in response to events. A question that asks what a diagram shows is answered by naming its elements, not by describing the system in general.
Testing verifies that the software meets its specification and validates that it meets the user's real needs. Unit testing checks one module in isolation, often with drivers that call the module and stubs that stand in for modules it calls. Integration testing checks modules together, top-down using stubs, bottom-up using drivers, or with a sandwich approach that combines both. System testing checks the whole system against its requirements, including performance, security, and recovery testing. Acceptance testing is performed by or for the customer, with alpha testing at the developer site and beta testing at user sites. Regression testing re-runs earlier tests after a change to check that nothing that worked before has broken.
Black-box testing derives tests from the specification without looking at the code. Equivalence partitioning divides inputs into classes that should behave alike and tests one representative from each class, plus invalid classes. Boundary value analysis tests values at and just either side of input boundaries, because defects cluster at edges. White-box testing derives tests from the code structure. Statement coverage requires every statement to execute; branch coverage requires every branch outcome; path coverage requires every path, which is usually infeasible for loops. Basis-path testing uses cyclomatic complexity to find the number of independent paths that must be tested. For a flow graph with E edges, N nodes, and P connected components, cyclomatic complexity is V(G) = E - N + 2P. For a single program it also equals the number of predicate nodes plus one. A higher value means more decision logic, harder testing, and usually a module that should be split. Test-driven development reverses the usual order by writing a failing test first, then the smallest code that passes it.
Quality assurance is wider than testing: it is the planned set of activities that give confidence the product meets quality standards. Reviews and inspections find defects by reading, without executing the code; a formal inspection follows defined roles and checklists, while a walkthrough is a less formal peer review. The capability maturity model describes five levels: initial, where processes are ad hoc; repeatable, where basic project management is in place; defined, where processes are documented and standardised; managed, where processes are measured; and optimising, where improvement is continuous and feedback-driven. ISO 9000 is a family of quality-management standards centred on documented processes, customer focus, and continual improvement; it certifies the quality system, not the quality of any single product. Software quality assurance therefore combines process standards, reviews, testing, measurement, and defect tracking, rather than relying on testing alone at the end. How it is examined: expect a coupling or cohesion ordering question, a testing-level scenario, a boundary or equivalence case, and a cyclomatic complexity number.
Estimation & project management
Estimation begins with size. Lines of code, or LOC, counts source lines, but it is language-dependent, it penalises concise code, and it cannot be counted before the code exists. Function points measure size from the user's view, counting what the system does rather than how it is coded. Five function types are counted: external inputs, external outputs, external inquiries, internal logical files, and external interface files. Each is rated simple, average, or complex with a standard weight, and the weighted sum is the unadjusted function point count. Fourteen general system characteristics, such as data communications, performance, and reusability, are each rated from zero to five, and their sum adjusts the count: the complexity adjustment factor is 0.65 plus 0.01 times the total degree of influence, and adjusted function points equal unadjusted function points times that factor. Because function points are counted from requirements, they can be estimated far earlier than lines of code, and they allow comparison across languages, although the ratings still involve judgement.
COCOMO, the constructive cost model, converts size into effort and schedule. The basic model for an organic project, small and familiar with a small experienced team, uses effort in person-months as 2.4 times size in thousands of lines of code raised to the power 1.05, and development time in months as 2.5 times effort raised to the power 0.38. Semidetached and embedded projects use larger coefficients and exponents, reflecting greater complexity and tighter constraints. The intermediate model multiplies the basic effort by effort adjustment factors for product, hardware, personnel, and project attributes, such as required reliability and analyst capability. The advanced or detailed model applies those factors phase by phase. Average staffing is effort divided by development time, and COCOMO results are estimates with wide uncertainty, not promises; a computed figure should be reported with its assumptions, especially the project mode and the size figure.
Project management turns the estimate into a plan and keeps it on track. A work breakdown structure divides the project into manageable tasks. Scheduling uses networks of activities: the critical path method finds the longest path through the network, which fixes the shortest possible project duration, and any delay on the critical path delays the whole project. Activities off the critical path have slack, or float, which is the amount they can slip without delaying the project. PERT handles uncertainty with three estimates per activity: optimistic, most likely, and pessimistic time. The expected time is optimistic plus four times most likely plus pessimistic, all divided by six, and the variance is the square of pessimistic minus optimistic divided by six. A Gantt chart then displays tasks against calendar time, showing overlaps, milestones, and progress.
Risk management is a separate discipline, not an afterthought. Risk identification lists what could go wrong, from requirement change to staff loss to new technology. Risk analysis assesses probability and impact, often ranking risks in a table. Risk planning prepares responses: avoidance removes the risk, mitigation reduces probability or impact, transfer moves it to another party, and acceptance prepares a contingency plan. Risks are then monitored through the project, because a risk that was minor at the start can become critical later. Configuration management supports all of this by controlling versions of code, documents, and builds, so that a change is tracked, reviewed, and reversible, and the team always knows which version is the current baseline. How it is examined: expect a function-point sum with an adjustment factor, a COCOMO effort or schedule computation with the mode stated, a PERT expected-time calculation, and a critical-path or slack judgement from a small network.
Key definitions
- SDLC: The software development life cycle: the sequence of phases from requirements through design, implementation, testing, deployment, and maintenance.
- SRS: A software requirements specification: the agreed document stating what the system must do and the qualities it must show, written so each requirement can be tested.
- Functional requirement: A requirement stating a service or behaviour the system must provide, such as allowing a user to submit a form.
- Non-functional requirement: A requirement stating a quality or constraint, such as performance, security, usability, reliability, or portability.
- Coupling: The degree of interdependence between modules; low coupling is desired so a change affects few modules.
- Cohesion: The degree to which the parts of a single module belong together; high cohesion is desired so a module serves one well-defined purpose.
- Unit testing: Testing one module in isolation, often using drivers to call it and stubs to stand in for modules it calls.
- Regression testing: Re-running earlier tests after a change to check that previously working behaviour has not broken.
- Cyclomatic complexity: A measure of the number of independent paths through a program, computed from its flow graph or from its predicate count.
- Equivalence partitioning: A black-box technique that divides inputs into classes expected to behave alike and tests one representative from each class.
- Boundary value analysis: A black-box technique that tests values at and just either side of an input boundary, where defects are most likely.
- Function point: A unit of software size measured from the user view by counting inputs, outputs, inquiries, and files, adjusted for general system characteristics.
- Critical path: The longest path through a project activity network; its length fixes the shortest possible project duration.
- Slack (float): The amount an activity can slip without delaying the project, available only to activities off the critical path.
- Risk mitigation: A planned action that reduces the probability or the impact of an identified risk.
Formulas
- Cyclomatic complexity V(G) = E - N + 2P, where E is edges, N is nodes, and P is connected components
- Cyclomatic complexity V(G) = Number of predicate nodes + 1 (for a single program)
- Complexity adjustment factor = 0.65 + 0.01 x Total degree of influence
- Adjusted function points = Unadjusted function points x Complexity adjustment factor
- COCOMO basic organic effort = 2.4 x (KLOC)^1.05 person-months
- COCOMO basic organic development time = 2.5 x (Effort)^0.38 months
- PERT expected time = (Optimistic + 4 x Most likely + Pessimistic) / 6
- PERT variance = ((Pessimistic - Optimistic) / 6)^2
Worked examples
Example 1: A flow graph has 12 edges and 10 nodes and is a single connected program. It contains 3 predicate nodes. Find its cyclomatic complexity by both methods.
By the graph formula, V(G) = E - N + 2P = 12 - 10 + 2 x 1 = 4. By the predicate method, V(G) = number of predicate nodes + 1 = 3 + 1 = 4. Both methods agree at 4, so basis-path testing needs 4 independent paths. The agreement is a useful check: if the two methods disagree, an edge, node, or predicate has been miscounted.
Example 2: A system has these function counts: external inputs 3 simple and 1 average; external outputs 2 average and 1 complex; external inquiries 2 simple; internal logical files 2 average; external interface files 1 simple. The total degree of influence over the 14 characteristics is 35. Find the adjusted function points.
Use standard weights. External inputs: 3 x 3 + 1 x 4 = 9 + 4 = 13. External outputs: 2 x 5 + 1 x 7 = 10 + 7 = 17. External inquiries: 2 x 3 = 6. Internal logical files: 2 x 10 = 20. External interface files: 1 x 5 = 5. Unadjusted function points = 13 + 17 + 6 + 20 + 5 = 61. Complexity adjustment factor = 0.65 + 0.01 x 35 = 0.65 + 0.35 = 1.00. Adjusted function points = 61 x 1.00 = 61.
Example 3: Estimate effort and development time for a 32 KLOC organic project using basic COCOMO, and find the approximate average staffing.
Effort = 2.4 x (32)^1.05. Now 32^1.05 = 32 x 32^0.05, and 32^0.05 is about 1.19, so 32^1.05 is about 38.05. Effort is about 2.4 x 38.05 = 91.3 person-months. Development time = 2.5 x (91.3)^0.38. Since 91.3^0.38 is about 5.55, development time is about 2.5 x 5.55 = 13.9 months. Average staffing is effort divided by time, about 91.3 / 13.9 = 6.6 people, so roughly 7 people on average. The result assumes the organic mode and the 32 KLOC size estimate; changing either changes the answer.
Example 4: An activity has optimistic time 4 days, most likely time 7 days, and pessimistic time 16 days. Find its PERT expected time and variance.
Expected time = (Optimistic + 4 x Most likely + Pessimistic) / 6 = (4 + 28 + 16) / 6 = 48 / 6 = 8 days. Variance = ((Pessimistic - Optimistic) / 6)^2 = ((16 - 4) / 6)^2 = (12 / 6)^2 = 2^2 = 4 days squared. The expected time of 8 days, not the most likely 7 days, is the value used in PERT scheduling, and the variance of 4 measures the uncertainty around it.
SDLC models compared
| Model | Best when | Main risk |
|---|---|---|
| Waterfall | Requirements are stable and well understood | Late feedback; change is expensive |
| V-model | Verification against each phase matters | Still rigid if requirements change |
| Incremental | Early delivery of core features matters | Needs a stable architecture early |
| Spiral | Project is large or high-risk | Complex; needs risk expertise |
| Agile and Scrum | Requirements change and feedback is frequent | Hard to scale; needs an available customer |
Testing levels compared
| Level | What is tested | Typical technique |
|---|---|---|
| Unit | One module in isolation | Drivers and stubs |
| Integration | Modules working together | Top-down, bottom-up, or sandwich |
| System | The complete system against requirements | Performance, security, recovery tests |
| Acceptance | Fitness for the customer need | Alpha testing, then beta testing |
Black-box versus white-box testing
| Aspect | Black-box | White-box |
|---|---|---|
| Based on | Specification and requirements | Code structure and flow graph |
| Needs code | No | Yes |
| Typical techniques | Equivalence partitioning, boundary value analysis | Statement, branch, and path coverage; basis-path testing |
CMM maturity levels
| Level | Name | Meaning |
|---|---|---|
| 1 | Initial | Processes are ad hoc and chaotic |
| 2 | Repeatable | Basic project management is in place |
| 3 | Defined | Processes are documented and standardised |
| 4 | Managed | Processes are measured quantitatively |
| 5 | Optimising | Continuous improvement driven by feedback |
Diagrams (described)
V-model pairing: Requirements <-> Acceptance testing; System design <-> System testing; Detailed design <-> Integration testing; Coding <-> Unit testing; testing is planned with each phase even though it runs later.
DFD levels: Context diagram (system as one process, external entities, data flows) -> Level 1 decomposition (processes, data stores, flows) -> deeper levels, with input and output flows balanced at each decomposition.
Spiral loop: each cycle passes through Planning -> Risk analysis -> Engineering -> Evaluation, and the radius grows as the product and its cost grow.
PERT network flow: list activities and dependencies -> draw the network -> find the longest path (critical path) -> compute slack for non-critical activities -> read the project duration from the critical path length.
Exam points
- Waterfall suits stable requirements; spiral is defined by risk analysis in every loop.
- In Scrum, the product owner owns priorities, the Scrum master protects the process, and work runs in sprints with a daily stand-up.
- A requirement is verifiable only if a test can decide whether it is met; vague speed claims fail this test.
- Performance, security, and usability requirements are non-functional even when they matter most to users.
- Good design means low coupling and high cohesion; content coupling is worst and functional cohesion is best.
- Alpha testing happens at the developer site; beta testing happens at user sites.
- Boundary value analysis tests at and just either side of a boundary; equivalence partitioning tests one representative per class.
- Cyclomatic complexity equals edges minus nodes plus twice the components, and also equals predicate nodes plus one.
- CMM level 3 is defined, level 4 is managed, and level 5 is optimising; level 1 is initial.
- ISO 9000 certifies the quality system and its documented processes, not any single product.
- Function points are counted from requirements and allow comparison across languages; LOC cannot be counted before coding.
- Any delay on the critical path delays the project; only non-critical activities have slack.
Common mistakes
- Mistake: calling a performance requirement functional because users care about it. Correction: what the system does is functional; how well, how fast, or how securely it does it is non-functional.
- Mistake: saying high coupling is good. Correction: low coupling and high cohesion are desired; high coupling means a change ripples through many modules.
- Mistake: testing only valid inputs in equivalence partitioning. Correction: each partition needs an invalid class too, tested with a representative invalid value.
- Mistake: using branch coverage when the question asks for statement coverage. Correction: statement coverage needs every statement to run; branch coverage needs every branch outcome, which is stronger.
- Mistake: reading CMM level 2 as defined. Correction: level 2 is repeatable, level 3 is defined, level 4 is managed, level 5 is optimising.
- Mistake: applying organic COCOMO coefficients to an embedded project. Correction: the mode changes the coefficients and exponent, so name the mode before computing.
- Mistake: scheduling with the most likely time in PERT. Correction: PERT schedules with the expected time, which weights the most likely estimate four times but still includes optimistic and pessimistic values.
- Mistake: thinking agile means no documentation or planning. Correction: agile values working software over comprehensive documentation, but it still plans, in sprints, backlogs, reviews, and retrospectives.
Practice questions from this note (original practice — not official PYQs)
Checking login…
Quick revision: Choose the model by the project: stable requirements point to waterfall or the V-model, unclear requirements to prototyping, high risk to spiral, early delivery to incremental, and changing requirements with frequent feedback to agile and Scrum. Remember Scrum roles in one line: product owner owns priorities, Scrum master protects the process, team delivers the sprint increment. Requirements split cleanly: functional says what the system does, non-functional says how well, with the SRS correct, unambiguous, complete, consistent, verifiable, modifiable, and traceable. Design aims low: low coupling, with data coupling loosest, and high cohesion, with functional cohesion strongest. Testing climbs unit, integration, system, acceptance, with regression re-running old tests after every change; black-box uses equivalence classes and boundary values, white-box uses statement, branch, and path coverage, and cyclomatic complexity equals edges minus nodes plus twice the components, or predicates plus one. Quality climbs CMM initial, repeatable, defined, managed, optimising, with ISO 9000 certifying the system, not a single product. Estimation counts function points from requirements and adjusts by 0.65 plus 0.01 times total influence, while COCOMO turns size into effort and schedule by project mode. Scheduling finds the critical path, gives slack only off it, and in PERT uses expected time, not the most likely time.
Unit revision note (quick recap)
Software engineering is about building the right system, on time, and keeping it working as requirements change. Process choice is a risk decision.
Learning objectives
- Choose an SDLC model by risk and clarity
- Explain testing levels and types
- Estimate with COCOMO/function points
Key concepts
- Spiral model: Risk-driven cycles of prototyping and review; best when requirements are unclear and risk is high.
- Waterfall: Sequential phases; fits stable, well-understood requirements.
- Black-box testing: Tests from specifications and inputs/outputs, without code knowledge.
- White-box testing: Tests from internal structure: statements, branches, paths.
Worked examples
- A startup app with changing requirements → agile/spiral, not waterfall. A payroll system with fixed rules → waterfall can fit.
Exam points
- Unit < integration < system < acceptance, in that order.
- CMM levels: initial, managed, defined, quantitatively managed, optimising.
Common mistakes
- Testing to prove the software works — testing finds faults; it cannot prove absence of faults.
Quick revision: SDLC models, requirements, design, testing, quality, estimation, project management.
Practice questions from the whole unit bank (34 in the bank)
This unit's practice bank — the note above has its own smaller practice set drawn from the same bank, so a question can appear in both lists. The list below shows the free sample or the full bank depending on your plan.
Checking login…
Related tests
Unit test for this unit (34 bank questions, 41 min) · Full Mock — CS Paper 2 (100 questions) · Combined 150-question mock (180 min). All +2 per correct, no negative marking.
Revision summary
SDLC models, requirements, design, testing, quality, estimation, project management.
After revising, take the unit test above, then check your unit-wise report on the Dashboard to find weak topics.