Software Engineering Basics: SDLC, Process Models and Testing
Software engineering is the disciplined way of building software: planning it, designing it, writing it, testing it and maintaining it, so that it is reliable and delivered on time. Papers for programmer, software engineer, IT officer and lecturer posts ask about the phases of the software development life cycle, the main process models, the levels and kinds of testing, version control and open-source licences. This lesson explains each idea with the standard textbook terms that examiners use.
Asked in: PPSC, FPSC, NTS, ETEA, KPPSC, SSC, IBPS and ICS/ECAT computer
The software development life cycle (SDLC)
The SDLC is the series of phases a software project passes through. Most textbooks list: planning and feasibility study, requirements analysis, design, implementation (coding), testing, deployment and maintenance. Names and grouping vary slightly between books, but the order of ideas is the same.
The feasibility study checks whether the project is worth doing: technically (can it be built), economically (do benefits exceed costs) and operationally (will people use it). In requirements analysis the team talks to users and records what the system must do in a Software Requirements Specification (SRS). Functional requirements describe what the system does, such as calculating a fee; non-functional requirements describe qualities such as speed, security and usability.
Design turns the requirements into an architecture, database layout and module structure; good design aims for high cohesion (each module does one clear job) and low coupling (modules depend on each other as little as possible). Implementation is the coding phase. Testing checks the system against the requirements, deployment installs it for users, and maintenance continues for the rest of the software’s life.
- Feasibility → requirements (SRS) → design → coding → testing → deployment → maintenance
- SRS: Software Requirements Specification
- Functional = what it does; non-functional = how well (speed, security)
- Good design: high cohesion, low coupling
Process models: waterfall, prototype, spiral, V-model, agile
The waterfall model is linear and sequential: each phase is finished and signed off before the next begins, and going back is costly. It is simple to manage and suits projects whose requirements are clear and stable, but users see working software only near the end.
The prototype model builds a quick, rough version early so users can see it and clarify unclear requirements before the real system is built. The spiral model, proposed by Barry Boehm, repeats loops of planning, risk analysis, engineering and evaluation, and its defining feature is explicit risk analysis in every loop, which suits large, high-risk projects. The V-model pairs each development phase with a testing phase, such as requirements with acceptance testing and detailed design with unit testing.
Agile development, set out in the Agile Manifesto of 2001, delivers working software in short iterations, welcomes changing requirements and values close collaboration with the customer over heavy documentation. Scrum is a popular agile framework: work is done in fixed time-boxes called sprints, usually two to four weeks long, guided by a product backlog, a product owner and a Scrum Master, with a short daily stand-up meeting.
- Waterfall: sequential, fixed requirements, little going back
- Prototype: early model to clarify requirements
- Spiral (Boehm): iterative loops with risk analysis
- V-model: each development phase paired with a testing phase
- Agile/Scrum: short sprints, changing requirements welcome
Levels of testing
Unit testing checks the smallest testable pieces, such as a single function or class, in isolation; it is normally done by the developers who wrote them. Integration testing then checks that units work correctly together, concentrating on the interfaces and data passed between modules.
System testing checks the complete, integrated system against the whole specification, including non-functional qualities such as performance and security. Acceptance testing is done by or for the customer to decide whether the system meets their needs and can be accepted. Alpha testing is acceptance-style testing by users at the developer’s site; beta testing is done by real users in their own environment before the final release.
Regression testing re-runs earlier tests after a change or bug fix to make sure nothing that used to work has broken. Testing can show the presence of bugs but cannot prove that there are none.
- Unit → integration → system → acceptance
- Unit: single module; integration: interfaces between modules
- System: whole system vs specification; acceptance: customer’s approval
- Alpha: at developer’s site; beta: at users’ sites
- Regression: re-test after changes
Black-box and white-box testing
Black-box testing treats the software as a closed box: tests are designed from the specification, using inputs and expected outputs, with no knowledge of the code inside. Equivalence partitioning divides inputs into groups that should behave alike and tests one value from each; boundary value analysis tests values at and just beyond the edges of a valid range, where errors are most common. For a valid age of 18 to 60, boundary tests use 17, 18, 60 and 61.
White-box (glass-box or structural) testing uses knowledge of the internal code. The tester designs cases so that every statement runs at least once (statement coverage) or every branch of every decision is taken (branch coverage).
Cyclomatic complexity, a white-box measure, gives the number of independent paths through a program, and therefore the minimum number of tests needed to cover them. For a control flow graph it is E − N + 2, where E is the number of edges and N the number of nodes; for a program built from simple decisions it also equals the number of decisions plus one.
Verification asks “are we building the product right?”, checking each stage against its specification, often through reviews and inspections. Validation asks “are we building the right product?”, checking that the finished software meets the user’s real needs.
- Black-box: from specification, code unseen
- White-box: from code structure (statement and branch coverage)
- Boundary values for range a to b: a − 1, a, b, b + 1
- Cyclomatic complexity = E − N + 2 = decisions + 1
- Verification: product built right; validation: right product built
Maintenance
Maintenance is usually the longest and most expensive part of a software system’s life. Corrective maintenance fixes bugs found after release. Adaptive maintenance changes the software so it keeps working in a new environment, such as a new operating system, database version or tax law. Perfective maintenance improves performance or adds features users ask for. Preventive maintenance restructures code to prevent future problems and make it easier to maintain.
- Corrective: fix bugs
- Adaptive: suit a new environment
- Perfective: improve or add features
- Preventive: restructure to avoid future problems
Version control and open-source licences
A version control system records every change to a project’s files, so the team can see who changed what and when, compare versions, return to an earlier state and work in parallel. Git is a distributed version control system: every developer has a full copy of the repository with its history. A commit is a saved snapshot of changes with a message, a branch is a separate line of development, and a merge combines one branch into another; a conflict arises when two people change the same lines differently.
Open-source software is released with its source code under a licence that allows anyone to use, study, modify and share it. Permissive licences such as MIT and Apache 2.0 let others reuse the code, even inside closed-source products, as long as they keep the copyright notice. Copyleft licences such as the GNU GPL require that if you distribute a modified version, you must release it under the same licence with its source code.
Freeware is software given away at no cost but usually without its source code, so it is not open source. Proprietary software keeps the source code closed and restricts use through a licence agreement.
- Git: distributed version control
- Commit = snapshot; branch = parallel line; merge = combine
- Permissive (MIT, Apache): reuse allowed, keep the notice
- Copyleft (GPL): distributed changes must stay under GPL
- Freeware: free of charge, source usually closed
Solved examples
- Arrange these SDLC activities in order: writing code, preparing the SRS, maintenance, feasibility study, testing, designing the database.
- First decide whether the project is worthwhile: feasibility study.
- Then record what the system must do: preparing the SRS.
- Design follows requirements: designing the database.
- Then come writing code and testing, and finally maintenance after deployment.
Answer: Feasibility study → SRS → database design → coding → testing → maintenance - Choose a suitable model: (i) a government payroll system whose rules are fixed and fully documented; (ii) a large defence project with many technical risks; (iii) a start-up app whose features change every few weeks after user feedback.
- (i) Clear, stable requirements suit the sequential waterfall model.
- (ii) High risk calls for the spiral model, which analyses risk in every loop.
- (iii) Frequently changing requirements and regular feedback suit agile, for example Scrum sprints.
Answer: (i) waterfall, (ii) spiral, (iii) agile - Name the testing level: (i) Hamza tests his calculateFee function on its own; (ii) the team checks that the admission module passes the right data to the fee module; (iii) the whole portal is tested for speed with 5,000 users; (iv) the university’s staff try the portal and sign it off.
- (i) A single function tested alone is unit testing.
- (ii) Data passing between two modules is integration testing.
- (iii) The complete system tested against requirements, including performance, is system testing.
- (iv) The customer deciding whether to accept the software is acceptance testing.
Answer: (i) unit, (ii) integration, (iii) system, (iv) acceptance - A form accepts marks from 1 to 100. Using boundary value analysis, which values should Priya test?
- The valid range runs from 1 to 100.
- Test each boundary and the value just outside it: 0 and 1 at the lower end, 100 and 101 at the upper end.
- 1 and 100 should be accepted; 0 and 101 should be rejected.
Answer: 0, 1, 100 and 101 - A function contains two separate if-else decisions one after the other. Its control flow graph has 8 nodes and 9 edges. Find its cyclomatic complexity by both methods.
- Graph formula: E − N + 2 = 9 − 8 + 2 = 3.
- Decision formula: number of decisions + 1 = 2 + 1 = 3.
- So at least 3 independent paths, and 3 test cases, are needed to cover them.
Answer: 3 - Name the type of maintenance: (i) fixing a crash reported by users; (ii) updating a billing system for a new sales-tax rule; (iii) adding a dark mode because users asked for it.
- (i) Removing a bug found after release is corrective maintenance.
- (ii) Changing the software to fit a new external rule is adaptive maintenance.
- (iii) Adding a requested feature is perfective maintenance.
Answer: (i) corrective, (ii) adaptive, (iii) perfective
Exam shortcuts
- Waterfall = sequential, spiral = risk, prototype = unclear requirements, agile = frequent change.
- Testing levels grow outwards: unit (one piece), integration (pieces together), system (whole), acceptance (customer).
- Black-box testers know what the system should do; white-box testers know how the code does it.
- Verification checks the product against its specification; validation checks it against the user’s needs.
- For cyclomatic complexity, counting decisions and adding 1 is the fastest route when no graph is given.
- GPL is the classic copyleft licence; MIT and Apache are permissive.
Common mistakes
- Thinking agile means no planning or no documentation; it means short planned iterations with just enough documentation.
- Mixing up integration testing (between modules) with system testing (the whole product).
- Calling the spiral model simply iterative and forgetting that its defining feature is risk analysis.
- Assuming free software of any kind is open source; freeware usually comes without source code.
- Believing thorough testing can prove a program has no bugs.
Practice MCQs
- In which SDLC activity is the Software Requirements Specification (SRS) mainly prepared?
A) Implementation
B) Maintenance
C) Requirements analysis
D) Deployment
Answer: C) Requirements analysis — The SRS records what the system must do, so it comes out of requirements analysis, before design and coding. Implementation produces code, deployment installs the system, and maintenance happens after release. - Which model finishes each phase completely before the next one begins, with little scope for going back?
A) Spiral model
B) Waterfall model
C) Agile model
D) Prototype model
Answer: B) Waterfall model — The waterfall model flows one way through its phases, like water down steps. The spiral model repeats loops, agile works in short iterations, and the prototype model deliberately revisits requirements after users see an early version. - The defining feature of the spiral model, proposed by Barry Boehm, is:
A) Strictly one pass through each phase
B) Daily stand-up meetings
C) No customer involvement
D) Risk analysis in every loop
Answer: D) Risk analysis in every loop — Each loop of the spiral includes identifying and reducing risks, which makes it suit large, risky projects. A single pass describes waterfall, daily stand-ups belong to Scrum, and the spiral model involves the customer in evaluating each loop. - In Scrum, a fixed time-box of usually two to four weeks in which a usable piece of work is completed is called a:
A) Sprint
B) Milestone
C) Baseline
D) Prototype
Answer: A) Sprint — Scrum organises work into sprints. A milestone is a checkpoint in any project plan, a baseline is an approved reference version of a document or product, and a prototype is an early model built to explore requirements. - Testing a single function on its own, usually by the developer who wrote it, is called:
A) System testing
B) Unit testing
C) Acceptance testing
D) Beta testing
Answer: B) Unit testing — Unit testing checks the smallest pieces of code in isolation. System testing covers the whole product, acceptance testing is the customer’s decision to accept it, and beta testing is done by real users before release. - After separately tested modules are combined, which testing checks the data and calls passing between them?
A) Unit testing
B) Regression testing
C) Integration testing
D) Alpha testing
Answer: C) Integration testing — Integration testing focuses on the interfaces between modules. Unit testing looks at modules one by one, regression testing re-checks old features after a change, and alpha testing is user testing at the developer’s site. - Real users try a nearly finished app in their own homes and report problems before the final release. This is:
A) Beta testing
B) Alpha testing
C) Unit testing
D) White-box testing
Answer: A) Beta testing — Testing by real users in their own environment before release is beta testing. Alpha testing takes place at the developer’s site, unit testing checks individual modules, and white-box testing is designed from the code by testers who can see it. - Neha designs tests only from the requirements, checking inputs against expected outputs without looking at the code. Which approach is this?
A) White-box testing
B) Glass-box testing
C) Code inspection
D) Black-box testing
Answer: D) Black-box testing — Designing tests from the specification alone, with the code unseen, is black-box testing. White-box and glass-box are two names for testing based on the code’s structure, and code inspection is a review of the code itself. - Making sure that every branch of every decision in the code is taken at least once is a goal of:
A) Black-box testing
B) White-box testing
C) Acceptance testing
D) Usability testing
Answer: B) White-box testing — Branch coverage needs knowledge of the program’s internal decisions, so it is a white-box technique. Black-box, acceptance and usability testing judge the software from the outside without examining its branches. - After fixing a bug in the fee module, the team re-runs old tests to make sure features that worked before still work. This is:
A) Regression testing
B) Integration testing
C) Alpha testing
D) Stress testing
Answer: A) Regression testing — Re-testing previously working features after a change is regression testing. Integration testing checks module interfaces, alpha testing is user testing at the developer’s site, and stress testing pushes the system beyond normal load. - Which question does validation answer?
A) Are we building the product right?
B) Is the code formatted properly?
C) Has the code been committed to Git?
D) Are we building the right product?
Answer: D) Are we building the right product? — Validation checks that the finished product meets the user’s real needs: the right product. Building the product right is verification, while formatting and committing are routine tasks, not the definition of validation. - In Git, a saved snapshot of changes recorded together with a message describing them is called a:
A) Branch
B) Merge
C) Commit
D) Clone
Answer: C) Commit — A commit records a snapshot of the project with a message. A branch is a separate line of development, a merge joins branches, and a clone is a full copy of a repository. - Which licence requires that anyone who distributes a modified version of the software must release it under the same licence, with its source code?
A) GNU GPL
B) MIT licence
C) Apache licence 2.0
D) Freeware licence
Answer: A) GNU GPL — The GPL is a copyleft licence: distributed changes must stay under the GPL. MIT and Apache 2.0 are permissive and allow reuse in closed-source products, and freeware is free of charge but usually comes without source code at all. - A field accepts ages from 18 to 60 inclusive. Which set of values does boundary value analysis test?
A) 18, 39 and 60
B) 0, 18, 60 and 100
C) 19, 30, 45 and 59
D) 17, 18, 60 and 61
Answer: D) 17, 18, 60 and 61 — Boundary value analysis tests each limit and the value just outside it: 17 and 18 at the bottom, 60 and 61 at the top. The other sets miss the just-outside values, use values far from the limits, or stay entirely inside the range. - A program’s control flow graph has 11 edges and 9 nodes. What is its cyclomatic complexity?
A) 2
B) 4
C) 20
D) 3
Answer: B) 4 — Cyclomatic complexity = E − N + 2 = 11 − 9 + 2 = 4. 2 is just E − N, 20 adds edges and nodes, and 3 comes from adding 1 instead of 2.
Questions
Which SDLC model is the best?
None is best for every project. Waterfall suits fixed requirements, spiral suits high-risk projects, prototyping suits unclear requirements, and agile suits projects where requirements change often.
What is the difference between testing and debugging?
Testing runs the software to find failures. Debugging is the developer’s work of locating the cause of a failure in the code and fixing it.
Is open-source software always free of cost?
Usually it can be obtained free, but open source is about freedom to use, study, modify and share the source code. Companies may still charge for support or services around it.
What is the difference between alpha and beta testing?
Alpha testing is done by users or testers at the developer’s site, under the developer’s eye. Beta testing is done by real users in their own environment, just before the final release.