| Diagram | Pick in Dia |
|---|---|
| Use case | UML: Actor, Use case; Box tool for system boundary; Line for association; Dependency + stereotype include / extend |
| Class | UML: Class (Attributes / Operations tabs), Generalization (hollow triangle at parent), Association (name + multiplicity), Aggregation / Composition = Association > Type |
| DFD | Flowchart: Ellipse (process), Box (entity); Gane and Sarson: Data Store; Line with end arrow + T label |
| Activity | UML: State Term (start / end, tick Is final), Activity, Branch (diamond), Fork (bar), Transition (Guard = [Yes]) |
| State | UML: State Term, State, Transition (Trigger = event) |
| Flow graph | Flowchart: Ellipse (small numbered circles), Line with end arrow, Box for the node list |
Members search, reserve, borrow and return books; the librarian issues / returns books and manages books and members; fine is charged for late return.
Actors: Member, Librarian (Admin optional). Classes: Person, Member, Librarian, Book, Loan, Fine.
Instructors create courses and upload lectures, admin approves, students pay and enroll, watch lectures, take quizzes and download certificates.
Actors: Student, Instructor, Admin, Payment Gateway. Classes: User, Student, Instructor, Course, Lecture, Enrollment, Payment, Quiz.
| Method | Formula |
|---|---|
| Edges and nodes | V(G) = E - N + 2 |
| Predicate (decision) nodes | V(G) = P + 1 |
| Regions | V(G) = closed regions + 1 (outer) |
def largest(a, b, c):
if a > b: # node 2
if a > c: # node 3
m = a # node 4
else:
m = c # node 5
else:
if b > c: # node 6
m = b # node 7
else:
m = c # node 8
return m # node 9
tests = [("TC1", 5, 3, 2, 5), ("TC2", 5, 3, 7, 7), ("TC3", 2, 6, 3, 6), ("TC4", 2, 6, 9, 9)]
for tc, a, b, c, exp in tests:
got = largest(a, b, c)
print(tc, (a, b, c), "expected", exp, "actual", got, "PASS" if got == exp else "FAIL")E = 11, N = 9, predicate nodes P = 3 (2, 3, 6) > V(G) = 11 - 9 + 2 = 4 = P + 1 = 4 = regions 4
| Test | Independent path | Input | Expected |
|---|---|---|---|
| TC1 | 1-2-3-4-9 | a=5, b=3, c=2 | 5 |
| TC2 | 1-2-3-5-9 | a=5, b=3, c=7 | 7 |
| TC3 | 1-2-6-7-9 | a=2, b=6, c=3 | 6 |
| TC4 | 1-2-6-8-9 | a=2, b=6, c=9 | 9 |
def even_sum(n):
i, s = 1, 0 # node 1
while i <= n: # node 2
if i % 2 == 0: # node 3
s = s + i # node 4
i = i + 1 # node 5
return s # node 6
tests = [("TC1", 0, 0), ("TC2", 1, 0), ("TC3", 4, 6)]
for tc, n, exp in tests:
got = even_sum(n)
print(tc, "n =", n, "expected", exp, "actual", got, "PASS" if got == exp else "FAIL")E = 7, N = 6, P = 2 (2, 3) > V(G) = 7 - 6 + 2 = 3 = P + 1 = 3. A loop is one decision.
| Test | Independent path | Input | Expected |
|---|---|---|---|
| TC1 | 1-2-6 (loop skipped) | n=0 | 0 |
| TC2 | 1-2-3-5-2-6 (odd only) | n=1 | 0 |
| TC3 | 1-2-3-4-5-2-... -6 (even added) | n=4 | 6 |
def binary_search(a, key):
low, high = 0, len(a) - 1 # node 1
while low <= high: # node 2
mid = (low + high) // 2 # node 3
if a[mid] == key: # node 4
return mid # node 5
elif key < a[mid]: # node 6
high = mid - 1 # node 7
else:
low = mid + 1 # node 8
return -1 # node 9 (node 10 = end)
tests = [("TC1", [], 5, -1), ("TC2", [1, 3, 5], 3, 1), ("TC3", [3], 1, -1), ("TC4", [3], 7, -1)]
for tc, a, k, exp in tests:
got = binary_search(a, k)
print(tc, a, "key", k, "expected", exp, "actual", got, "PASS" if got == exp else "FAIL")E = 12, N = 10, P = 3 (2, 4, 6) > V(G) = 12 - 10 + 2 = 4 = P + 1 = 4
| Test | Independent path | Input | Expected |
|---|---|---|---|
| TC1 | 1-2-9-10 | a=[], key=5 | -1 |
| TC2 | 1-2-3-4-5-10 | a=[1,3,5], key=3 | 1 |
| TC3 | 1-2-3-4-6-7-2-9-10 | a=[3], key=1 | -1 |
| TC4 | 1-2-3-4-6-8-2-9-10 | a=[3], key=7 | -1 |
COCOMO = COnstructive COst MOdel by Barry Boehm (1981). It estimates effort (person-months), time (months), people and cost from the size of the software in KLOC (thousand lines of code).
| Mode | Project type | a | b | c | d |
|---|---|---|---|---|---|
| Organic | Small, simple, experienced team (LMS, OMS) | 2.4 | 1.05 | 2.5 | 0.38 |
| Semi-detached | Medium size, mixed team (Online Course) | 3.0 | 1.12 | 2.5 | 0.35 |
| Embedded | Complex, strict hardware / real-time limits (ATM, flight control) | 3.6 | 1.20 | 2.5 | 0.32 |
Effort E = a x (KLOC)^b person-months (PM) Duration D = c x (E)^d months People P = E / D Cost = E x salary per person-month
| Example | LMS: 8 KLOC, organic | OMS: 12 KLOC, organic | Online Course: 20 KLOC, semi-detached |
|---|---|---|---|
| Effort E | 2.4 x 8^1.05 = 21.30 PM | 2.4 x 12^1.05 = 32.61 PM | 3.0 x 20^1.12 = 85.96 PM |
| Duration D | 2.5 x 21.30^0.38 = 7.99 months | 2.5 x 32.61^0.38 = 9.40 months | 2.5 x 85.96^0.35 = 11.88 months |
| People P | 21.30 / 7.99 = 2.67 (~3) | 3.47 (~4) | 7.23 (~7) |
| Cost at Rs 50,000 / PM | Rs 10.65 lakh | Rs 16.31 lakh | Rs 42.98 lakh |
| Type | What it adds |
|---|---|
| Basic | Only size (KLOC) and mode. Quick rough estimate. |
| Intermediate | E = a x KLOC^b x EAF. EAF (effort adjustment factor) = product of 15 cost drivers (product, hardware, personnel, project attributes, e.g. reliability, team experience, tools). a = 3.2 / 3.0 / 2.8. |
| Detailed | Applies cost drivers to each phase (design, code, test) separately. |
COCOMO II (1995): newer version with 3 sub-models: application composition (object points), early design, post-architecture. Uses KLOC or function points.
1. Count: EI (inputs), EO (outputs), EQ (inquiries), ILF (internal files), EIF (external files) 2. UFP = sum of count x weight (average weights: EI 4, EO 5, EQ 4, ILF 10, EIF 7) 3. Rate 14 general system characteristics 0-5, add them = sum Fi 4. VAF = 0.65 + 0.01 x sum Fi 5. FP = UFP x VAF LMS: EI 5, EO 3, EQ 3, ILF 3, EIF 1 UFP = 5x4 + 3x5 + 3x4 + 3x10 + 1x7 = 84 sum Fi = 38 -> VAF = 0.65 + 0.38 = 1.03 FP = 84 x 1.03 = 86.52
In the lab: open Exp4_Cost_Estimation.xlsx (SE_Lab_Files.zip) in LibreOffice Calc, change KLOC / mode / counts, everything recalculates. Or run cost.py.
| Software | Used in | How | File in SE_Lab_Files.zip |
|---|---|---|---|
| Dia Diagram Editor | Exp 1, 5, 6, 7, 10 (process model, use case, class, DFD, activity, state, flow graph) | Ubuntu: Activities > Dia (sudo apt install dia). File > Open the .dia file. File > Export > PNG | 1_Dia/*.dia |
| GanttProject | Exp 3 project plan / Gantt chart (ProjectLibre can import the same plan) | Project > Open > .gan file. Chart tab shows the bars; Resources tab shows people. Project > Export > PNG / PDF | 2_GanttProject/*.gan (+ .csv: Project > Import) |
| LibreOffice Calc / MS Excel | Exp 4 cost estimation, Exp 8 RMMM table, Exp 10 test case format | Open the .xlsx; formulas calculate automatically. Change KLOC / counts and everything updates | 3_Calc/*.xlsx |
| LibreOffice Writer / MS Word | Exp 1 problem statement, Exp 2 SRS (IEEE 830) | Open the .docx and edit the project name | 4_Writer/*.docx |
| Git + GitHub | Exp 9 version control | Terminal: run the commands in git_commands.txt one by one | 5_Git/git_commands.txt |
| Python 3 | Exp 4 calculator, Exp 10 test programs | Terminal: python3 file.py | 6_Python/*.py |
Full folder (all .dia, .gan, .xlsx, .docx, .py, git commands): SE_Lab_Files.zip (sent in chat). Office Management System full guide with every experiment: optezum.live/oms.