Software Testing · Week 2

Paths, Reachability & Test Paths

Ratta nahi — dekh ke samajh. Buttons dabao, graph khud animate hoga.

The Graph — apna playground

n0 n1 n2 n3 n4 n5
Neeche koi button dabao → animation chalegi ⤵
n0 = initial n4 = final · n5 kisi bhi edge se aata nahi (unreachable)

Definitions — ab dimaag me baithengi

Path = vertices ka sequence jahaan har do consecutive vertices ke beech ek edge ho. Toota hua nahi, judaa hua hona chahiye.
Length = path me edges ki count, nodes ki nahi! n0→n1→n3 me 3 nodes par length = 2.
Node reachable = initial node n0 se us node tak koi path maujood ho.
Edge reachable — edge e=(u,v): pehle n0 se u tak path ho, phir edge e ke through v tak jaana ho.
⚠ Sirf u tak pahunchna kaafi nahi! Poora edge traverse hona chahiye tabhi wo edge "reachable" hai.
Test Path = wo path jo ALWAYS initial vertex se START ho aur final vertex pe END ho. Beech se shuru ya beech me khatam ≠ test path.

Feasible vs Infeasible

✅ Feasible path

Koi na koi test case ise execute kar sake. Real input dega jo is raaste pe chalega.

🚫 Infeasible path

Koi bhi test case ise chala hi nahi sakta. Infeasible paths ≈ unreachable elements.
Yaad rakhne ka formula → Path = edges ka chain · Length = #edges · TestPath = init→final ALWAYS