







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








How to use this guide. Software engineering exams mix "compare and justify" questions (which process model suits this project?) with calculation questions (function points, COCOMO, PERT, cyclomatic complexity, velocity). This guide covers both. Section 1 compares the main life-cycle models and when to use each. Section 2 explains Agile, Scrum, Kanban and XP. Section 3 covers testing levels, types and test-design techniques. Section 4 is a real Git session, including a merge conflict and its resolution. Section 5 works through the estimation methods. The Git output and test-run output are real (they were produced by running the commands), and every estimate was computed with a script written for this guide.
What software engineering is. Software engineering applies a systematic, disciplined and measurable approach to developing, operating and maintaining software. It exists because informal programming does not scale: large projects that skip process tend to run late, go over budget, or deliver something nobody asked for.
Contents
Software process models compared Agile, Scrum, Kanban and XP Software testing: levels, types and techniques Version control with Git Project estimation and scheduling Summary table Practice questions and answers
Every model contains the same generic activities: communication and requirements , planning , modelling and design , construction (coding and testing) and deployment and maintenance. What differs is the order , how often the activities repeat, and how much is fixed up front.
1.1 Waterfall (linear sequential)
Phases run strictly in order: requirements โ design โ implementation โ testing โ deployment โ maintenance. Each phase ends with a signed-off document, and going back is expensive.
Use when: requirements are stable and fully understood, the technology is familiar, and there are contracts or regulations that demand documentation (for example a payroll update to meet a new tax law). Weakness: the customer sees working software only near the end, so misunderstood requirements are found late, when they are most expensive to fix.
1.2 V-Model (verification and validation)
The V-Model is a Waterfall in which every development phase on the left arm is paired with a test level on the right arm. The test is planned when its paired phase is done.
Requirements analysis ------------------------------> Acceptance testing System design ----------------------------------> System testing Architectural design -----------------------> Integration testing Module (detailed) design --------------> Unit testing \ / ------ Coding ------
It suits safety-critical systems (medical devices, automotive, aviation) where every requirement must be traceable to a test. It is as inflexible as Waterfall.
1.3 Incremental and iterative models
Incremental: the system is delivered in pieces. Increment 1 delivers the core features; each later increment adds more. Users get value early, and the riskiest or most important features can go first. Iterative: the whole system is built roughly, then refined in repeated cycles. Each iteration improves on the previous version. Prototyping: a quick model of the user interface or a tricky feature is built so that users can react to it. A throwaway prototype is discarded once requirements are clear; an evolutionary prototype is refined into the final product. Prototyping is useful when users cannot state their requirements clearly. RAD (Rapid Application Development): short time-boxes, heavy user involvement, reusable components and code generators, aimed at delivering in weeks rather than months.
1.4 Spiral model
Barry Boehm's spiral model is risk-driven. Each loop of the spiral passes through four quadrants: (1) determine objectives, alternatives and constraints; (2) identify and resolve risks , often by building a prototype; (3) develop and test the next level of the product; (4) plan the next loop. The radius of the spiral represents cumulative cost. It suits large, high-risk projects, but needs real risk-assessment expertise and is too heavy for small projects.
1.5 Choosing a model
Model Requirements Customer involvement Risk handling Delivery Best fit
Waterfall Fixed, clear At start and end Poor (risks found late)
Once, at the end
Small, well- understood, regulated projects V-Model Fixed, clear At start and end Strong verification, little flexibility
Once Safety-critical systems Incremental Core known, details later
At every increment
Good: high-priority parts first
In increments Products that can be split into features Prototyping Unclear Very high Good for requirements risk
Prototype, then system
New user interfaces, unsure users Spiral Evolving Each loop Excellent (explicit risk analysis)
Each loop Large, high-risk, expensive systems Agile (Scrum, XP)
Expected to change
Continuous Good: short feedback loops
Every 1โ weeks
Fast-changing business software
Worked decision. A bank wants a mobile app; its features will change as competitors release theirs, and it wants something in users' hands within two months. Agile (Scrum) fits best, because requirements are expected to change and early, frequent delivery is required. The same bank needs a module to report transactions to the central bank in a format fixed by regulation. Waterfall or the V-Model fits, because the requirements are fixed, documented and must be traceable to tests.
The actual line stays above the ideal line, so the team is behind schedule all sprint and finishes with 4 points undone. Those items return to the Product Backlog and are not counted in the velocity. Flat sections (days 0โ1 and 3โ4) usually mean blocked work or stories that are not being closed, and are a topic for the Daily Scrum.
2.3 Kanban and XP
Kanban visualises work on a board with columns such as To do โ In progress โ Testing โ Done. It has no sprints: work is pulled continuously. Its key rule is a work-in-progress (WIP) limit for each column, so the team finishes work before starting more. Kanban measures lead time (request to delivery) and cycle time (start of work to delivery). It suits support and maintenance teams with a steady flow of unpredictable requests.
Extreme Programming (XP) focuses on engineering practices: pair programming , test-driven development , continuous integration , refactoring , small releases , simple design , collective code ownership , coding standards , an on-site customer and a sustainable 40-hour week. Many Scrum teams adopt XP practices.
Scrum Kanban XP Cadence Fixed sprints Continuous flow Short iterations (1โ2 weeks) Roles Product Owner, Scrum Master, Developers
None required Customer, coach, programmers Change during an iteration
Avoided (protect the Sprint Goal)
Allowed at any time Allowed if work is swapped for equal size Main metric Velocity, burndown Lead time, cycle time, WIP
Velocity
Emphasis Project management framework
Flow and visual management
Engineering practices
DevOps extends Agile past development into operations: automated continuous integration (every commit is built and tested), continuous delivery/deployment , infrastructure as code and monitoring, so that small changes reach users safely and often.
3. Software testing: levels, types and techniques
Key terms. A developer makes an error (mistake), which puts a fault/defect/bug into the code, which may cause a failure (wrong behaviour) when it runs. Verification asks "are we building the product right?" (does it meet its specification; reviews, inspections, static analysis). Validation asks "are we building the right product?" (does it meet the user's real needs; acceptance testing). Testing can show the presence of defects, never their absence, and exhaustive testing is impossible except for trivial programs, so tests must be chosen carefully.
3.1 Testing levels
Level What is tested Who Typical technique Unit One function, method or class in isolation (dependencies replaced by stubs or mocks )
Developers White-box; automated frameworks (unittest, JUnit, pytest)
Integration Interfaces and data flow between modules
Developers / testers
Top-down (needs stubs), bottom-up (needs drivers ), sandwich or big-bang System The complete, integrated system against the requirements
Independent test team
Black-box; functional and non-functional testing Acceptance Whether the customer will accept the system
Users / customer
Alpha testing (at the developer's site) and beta testing (real users in their own environment); UAT
3.2 Testing types
Type Purpose Functional Does each feature do what the requirements say? Performance / load / stress
Response time under normal load; behaviour at expected peak; breaking point beyond peak Security Resistance to attacks (injection, broken authentication, data exposure) Usability Can real users complete tasks easily? Compatibility Different browsers, devices, operating systems Regression Re-running existing tests after a change to check nothing that used to work is now broken Smoke A quick check of the most important functions to decide whether a build is stable enough to test further Sanity A narrow check that one specific fix or change works Static testing Finding defects without running code: reviews, walkthroughs, inspections, linters
3.3 Black-box test design
Black-box techniques derive tests from the specification, without looking at the code. Specification used below: " grade(score) accepts whole-number scores from 0 to 100. 75โ100 returns A, 60โ returns B, 0โ59 returns F. Any other score is rejected with an error."
Equivalence partitioning divides inputs into classes the program should treat the same way, and tests one value from each:
Partition Range Valid? Representative Expected P1 score < 0 Invalid โ5 Error P2 0โ59 Valid 30 F P3 60โ74 Valid 67 B P4 75โ100 Valid 88 A P5 score > 100 Invalid 120 Error
Boundary value analysis (BVA) recognises that defects cluster at the edges (for example > written instead of >= ). It tests each boundary and its neighbours. Two-value BVA tests the value on each side of every boundary: โ1, 0, 59, 60, 74, 75, 100, 101 , eight tests that catch every off-by-one error at these boundaries.
Decision tables list combinations of conditions and the action for each, which helps with business rules. Example: a free delivery is given if the order is over KSh 2,000 or the customer is a member, but never for bulky items.
Rule 1 2 3 4 5โ Order > 2,000 Y Y N N โ Member Y N Y N โ Bulky item N N N N Y Free delivery Yes Yes Yes No No
Other black-box techniques include state transition testing (tests that cover each valid and invalid transition of a state machine, such as an account locking after three wrong PINs) and use case testing.
3.4 A real unit test
The function, written to the specification above:
Cyclomatic complexity V(G), from McCabe, counts the independent paths through the code and gives the minimum number of tests for basis-path coverage. It can be computed three ways that give the same answer:
V(G) = E โ N + 2P, where E = edges, N = nodes and P = connected components (1 for a single function). V(G) = number of binary decisions (predicates) + 1. V(G) = number of enclosed regions of the flow graph + 1.
Worked example. In grade above, the predicates are score < 0 , score > 100 (the or makes two separate predicates), score >= 75 and score >= 60. V(G) = 4 + 1 = 5. Five basis paths need five tests at minimum, for example โ1 (error via the first predicate), 101 (error via the second), 80 (A), 65 (B) and 30 (F). A flow graph with 9 edges and 7 nodes in one component has V(G) = 9 โ 7 + 2 = 4. Functions with V(G) above about 10 are usually considered hard to test and good candidates for refactoring.
Quality metrics. Defect density = defects รท size, such as 18 defects in 12 KLOC = 1.5 defects per KLOC. Defect removal efficiency (DRE) = defects found before release รท (before + after release): 90 found in testing and 10 reported by users gives DRE = 90 รท 100 = 90%.
4. Version control with Git
A version control system (VCS) records every change to a set of files so that you can see who changed what and why, return to any earlier version, and let many people work in parallel. Centralised systems (such as Subversion) keep the history on one server. Git is distributed : every clone contains the full history, so most operations are local and fast and work offline.
Git's three areas. Files move from the working tree (the files you edit) to the staging area / index ( git add chooses what goes into the next commit) to the repository ( git commit saves a permanent snapshot). Each commit has a unique SHA-1 hash, an author, a message and a pointer to its parent commit(s). A branch is just a movable pointer to a commit, and HEAD points to the branch you are on.
Command What it does git init / git clone URL Create a new repository / copy an existing one, history included git status Show changed, staged and untracked files git add FILE Stage changes for the next commit git commit -m "msg" Save the staged snapshot with a message git log --oneline --graph Show history compactly, with branch structure git diff Show unstaged changes ( --staged for staged ones) git switch -c NAME (or git checkout -b NAME )
Create a branch and move to it
git merge BRANCH Join another branch's history into the current branch git rebase BRANCH Replay your commits on top of another branch for a linear history (never rebase commits others have already pulled) git remote add origin URL , git push , git pull , git fetch
Link to and synchronise with a remote repository
git restore FILE Discard unstaged changes to a file git revert COMMIT Make a new commit that undoes an earlier one (safe on shared branches) git reset Move the branch pointer back (rewrites history; use only on local work) git stash Shelve uncommitted work temporarily git tag v1.0 Name a commit, typically a release
4.1 A real session: branching and a merge conflict
Two lines of work start from the same commit. On a feature branch a developer adds a B grade and moves the A boundary to 80; meanwhile, on main , the A boundary is moved to 75. Both changed line 2, so Git cannot merge them automatically. This is the real output:
$ git status --short ?? grades.py $ git add grades.py $ git commit -q -m "Add grade function" $ git switch -q -c feature/b-grade $ git diff diff --git a/grades.py b/grades.py index 25719e6..745dd83 100644 --- a/grades.py +++ b/grades.py @@ -1,4 +1,6 @@ def grade(score):
Reading the conflict. Git marks the clashing region: the lines between <<<<<<< HEAD and ======= are the current branch's version ( main ), and the lines between ======= and >>>>>>> feature/b-grade are the incoming branch's version. The parts both branches agree on, including the new B band, were merged automatically. To resolve it, edit the file to the correct final content (here: keep 75 and keep the B band), delete the markers, then run git add and git commit. The final graph shows the merge
5.2 Effort: basic COCOMO
Boehm's basic COCOMO estimates effort E (person-months) and development time D (months) from size in KLOC:
E = a ร KLOC^b, D = c ร E^d, average staff = E รท D.
Mode Description a b c d Organic Small, experienced team, familiar problem 2.4 1.05 2.5 0. Semi-detached Medium size, mixed experience 3.0 1.12 2.5 0. Embedded Tight hardware, regulatory or real-time constraints 3.6 1.20 2.5 0.
Worked example: a 32 KLOC project.
Mode Effort E (PM) Duration D (months) Average staff Organic 2.4 ร 32^1.05 = 91.3 2.5 ร 91.3^0.38 = 13.9 91.3 รท 13.9 โ 6. Semi-detached 145.5 14.3 10. Embedded 230.4 14.3 16.
Because b > 1, effort grows faster than size (a diseconomy of scale : more people means more communication). Intermediate COCOMO multiplies E by an effort adjustment factor built from 15 cost drivers (reliability required, team capability, tool useโฆ). COCOMO II replaces the modes with scale factors and can start from function points.
Brooks's law: "Adding manpower to a late software project makes it later." New people need training, and the number of communication channels among n people is n(n โ 1) รท 2: 5 people have 10 channels, 10 people have 45.
5.3 Three-point (PERT) estimation and the critical path
For each activity, estimate optimistic (o) , most likely (m) and pessimistic (p) durations.
Expected time tโ = (o + 4m + p) รท 6; variance ฯยฒ = ((p โ o) รท 6)ยฒ.
Worked example (durations in weeks):
Activity Depends on o m p tโ ฯยฒ A Requirements โ 2 4 6 4 0. B Database design A 3 5 13 6 2. C UI prototype A 1 2 3 2 0. D Build UI C 4 6 8 6 0. E Integration B, D 2 3 4 3 0. F Deployment E 1 1 7 2 1.
Forward pass (earliest start ES and earliest finish EF = ES + tโ) and backward pass (latest finish LF and latest start LS = LF โ tโ); slack (float) = LS โ ES :
Activity ES EF LS LF Slack A 0 4 0 4 0 B 4 10 6 12 2 C 4 6 4 6 0 D 6 12 6 12 0 E 12 15 12 15 0 F 15 17 15 17 0
The critical path is the chain of zero-slack activities: A โ C โ D โ E โ F = 17 weeks. Any delay on it delays the project; B can slip up to 2 weeks without harm. The path variance is 0.444 + 0.111 + 0.444 + 0.111 + 1.000 = 2.111, so ฯ = โ2.111 โ 1.45 weeks. The probability of finishing within 19 weeks: z = (19 โ 17) รท 1.45 โ 1.38, giving P โ 0.92 (92%) from the normal table.
Gantt charts show the same activities as bars on a timeline and are good for tracking progress; network diagrams (as above) show dependencies and the critical path. Agile estimation works differently: story points and velocity (section 2.2) forecast how many sprints a backlog needs, and the forecast is updated every sprint.
Method Input Output Strength Weakness Expert judgement / Delphi
Experience; anonymous rounds until estimates converge
Effort Fast; uses real experience
Subjective
Analogy A similar past project Effort, duration Grounded in real data Needs a truly similar project LOC + COCOMO Estimated KLOC Effort, duration, staff
Well-calibrated equations
KLOC hard to know early Function points Counted user functions Size (then effort)
Language- independent; possible early
Counting takes training
PERT o, m, p per activity Duration with probability
Expresses uncertainty Only as good as the three guesses Story points + velocity
Relative estimates, past velocity
Sprints needed Self-correcting each sprint
Points cannot be compared across teams
6. Summary table
Topic Key points to remember Waterfall / V-Model Sequential; stable requirements; V pairs each phase with a test level Incremental / prototyping / RAD
Deliver in pieces; prototypes clarify unclear requirements; RAD time-boxes
Spiral Risk-driven loops: objectives โ risk analysis โ develop โ plan Agile Manifesto Individuals, working software, collaboration, responding to change Scrum 3 accountabilities (PO, SM, Developers), 5 events, 3 artifacts with commitments (Product Goal, Sprint Goal, Definition of Done) Velocity Points done per sprint; sprints needed = remaining points รท velocity, rounded up Kanban / XP WIP limits, lead and cycle time / pair programming, TDD, CI, refactoring Error, fault, failure Human mistake โ defect in code โ wrong behaviour at run time Verification vs validation Built right (specification) vs right product (user needs) Test levels Unit โ integration (stubs, drivers) โ system โ acceptance (alpha, beta) Black-box techniques Equivalence partitioning, boundary values, decision tables, state transitions White-box techniques Statement โ branch โ path coverage; V(G) = E โ N + 2P = predicates + 1 TDD Red โ Green โ Refactor Git areas Working tree โ add โ staging area โ commit โ repository Merge conflicts <<<<<<< , ======= , >>>>>>> markers; edit, add , commit Function points UFP from EI, EO, EQ, ILF, EIF weights; FP = UFP ร (0.65 + 0.01 ร TDI) Basic COCOMO E = aยทKLOC^b, D = 2.5ยทE^d; organic 2.4/1.05/0. PERT tโ = (o + 4m + p) รท 6; ฯยฒ = ((p โ o) รท 6)ยฒ; critical path has zero slack Brooks's law Channels = n(n โ 1) รท 2; adding people late makes the project later
7. Practice questions
A hospital needs software for a radiotherapy machine. The requirements are fixed, and every requirement must be shown to be tested. Which process model fits, and why? Give two differences between incremental and iterative development.
9. Verification checks the product against its specification : "are we building the product right?" (reviews, inspections, unit tests). Validation checks it against the user's real needs : "are we building the right product?" (acceptance testing, beta tests). 10. A stub stands in for a lower-level module that is called but not yet written; it is needed in top-down integration. A driver calls the module being tested in place of a higher-level module that does not exist yet; it is needed in bottom-up integration. 11. Partitions: under 18 (invalid) , 18โ65 (valid) , over 65 (invalid) , plus non-numeric input (invalid). Boundary values: 17, 18, 65, 66 (three-value BVA adds 19 and 64). 12. Regression testing re-runs existing tests after a change to make sure nothing that worked before is now broken; it can be large. Smoke testing is a quick, shallow check of the main functions of a new build to decide whether it is stable enough for further testing. 13. V(G) = 14 โ 11 + 2 = 5. There are 5 linearly independent paths, so at least 5 test cases are needed for basis-path coverage. A value of 5 means moderate complexity. 14. Statement coverage can be reached without ever taking a decision's false branch. Example: if x > 0: y = 1 followed by print(y). The single test x = 5 runs every statement (100% statement coverage), but the false outcome of x > 0 is never tested, so branch coverage is only 50%. That missed case is where y would be undefined. 15. Edit the file โ git add โ git commit โ git push. 16. Between <<<<<<< HEAD and ======= is the current branch's version; between ======= and >>>>>>> feature is the incoming version. Edit the file to the correct final content and remove all three markers, then git add the file and git commit to create the merge commit. ( git merge --abort cancels the merge instead.) 17. Use git revert on shared/pushed history : it adds a new commit that undoes the change, so nobody else's history is rewritten. git reset moves the branch pointer backward and rewrites history, so use it only on local commits that have not been pushed. 18. UFP = 4 ร 4 + 3 ร 7 + 2 ร 4 + 2 ร 7 + 1 ร 7 = 16 + 21 + 8 + 14 + 7 = 66. VAF = 0.65 + 0.30 = 0.95. FP = 66 ร 0.95 = 62.7 โ 63. 19. E = 2.4 ร 20^1.05 โ 55.8 person-months. D = 2.5 ร 55.8^0.38 โ 11.5 months. Staff โ 55.8 รท 11.5 โ 4.8, so about 5 people. 20. tโ = (3 + 4 ร 5 + 13) รท 6 = 36 รท 6 = 6 days. ฯยฒ = ((13 โ 3) รท 6)ยฒ = (10 รท 6)ยฒ โ 2.78 ; ฯ โ 1. days. Since 5 days is below the expected 6 days (z โ โ0.6), finishing in 5 days is less than 50% likely (about 27%).
This guide is an original study aid written for revision. All projects, figures and code were invented for it; the Git session and unit-test run are real outputs, and every estimate was computed with the script written for this guide.