Software Verification & Validation

Assignment Report — Scott Weeden (sweeden@ttu.edu) — February 15, 2026

Summary

54
Total Tests
100%
Statement Coverage
100%
Branch Coverage
0
Test Failures

Part 1: LangGraph Vague Spec Agent

A LangGraph agent classifies specifications as vague or precise, transforms vague ones, and generates test cases.

Agent Workflow

Classify
Specification
Vague?
YES →
Transform to
Precise
NO →
Generate
Test Case
END

Five Test Inputs (All Expected: VAGUE)

#Input SpecificationCategoryWhy Vague
1"The system shall allow for fast, easy data entry"Software DevUndefined "fast" and "easy"
2"Install high-quality flooring"ConstructionNo material/brand/standard defined
3"The application must be secure"PerformanceNo security protocols/compliance specified
4"The report will include, as appropriate, investigation findings"Reporting"As appropriate" leaves scope open
5"The project will be completed in a timely manner"TimelineNo specific deadline

File: part1_vague_spec_agent.py

Part 2A: Shopping Cart Testing

Step 1-2: Installation & Existing Test Execution

Repository: shopping-cart-unit-tests by AutomationPanda. Contains orders.py (60 stmts) with 29 existing tests.

$ python -m pytest tests/test_orders.py -v
29 passed in 0.10s

Step 3: Initial Statement Coverage

93%

Missing lines 86-89: DynamicallyPricedItem.get_latest_price() (HTTP API call)

Step 4: Equivalence Partitioning — 20 Test Designs

Equivalence Classes

EC#SourcePartitionValid/Invalid
EC1calculate_total.subtotalsubtotal = 0Valid (boundary)
EC2calculate_total.subtotalsubtotal > 0Valid
EC3calculate_total.subtotalsubtotal < 0Invalid
EC4calculate_total.shippingshipping = 0Valid (boundary)
EC5calculate_total.shippingshipping > 0Valid
EC6calculate_total.shippingshipping < 0Invalid
EC7calculate_total.discountdiscount = 0Valid (boundary)
EC8calculate_total.discount0 < disc ≤ sub+shipValid
EC9calculate_total.discountdisc > sub+shipValid (clamped)
EC10calculate_total.discountdiscount < 0Invalid
EC11calculate_total.tax_percenttax = 0Valid (boundary)
EC12calculate_total.tax_percent0 < tax < 1Valid
EC13calculate_total.tax_percenttax < 0Invalid
EC14Item.unit_priceprice = 0Valid (boundary)
EC15Item.unit_priceprice > 0Valid
EC16Item.quantityqty = 0Valid (boundary)
EC17Item.quantityqty = 1 (default)Valid
EC18Item.quantityqty > 1Valid
EC19Order.items0 items (empty)Valid (boundary)
EC20Order.items1 itemValid
EC21Order.itemsmultiple itemsValid
EC22Order.rewardtotal < 1000Valid (no bonus)
EC23Order.rewardtotal ≥ 1000Valid (bonus +10)
EC24DynItem.quantityqty = 1 (default)Valid
EC25DynItem.quantityqty > 1Valid

20 Functional Test Cases

TC#Source .pyEP ClassesV/I?Test InputsExpected OutputStatus
TC01orders.pyEC1,EC5,EC8,EC12Vsub=0,ship=15,disc=5,tax=0.1011.00PASS
TC02orders.pyEC2,EC4,EC7,EC12Vsub=50,ship=0,disc=0,tax=0.0854.00PASS
TC03orders.pyEC2,EC5,EC8,EC11Vsub=100,ship=10,disc=20,tax=090.00PASS
TC04orders.pyEC2,EC5,EC9,EC12Vsub=20,ship=5,disc=50,tax=0.100.00PASS
TC05orders.pyEC3Isub=-10,ship=5,disc=3,tax=0.05ValueErrorPASS
TC06orders.pyEC6Isub=50,ship=-5,disc=3,tax=0.05ValueErrorPASS
TC07orders.pyEC10Isub=50,ship=5,disc=-10,tax=0.05ValueErrorPASS
TC08orders.pyEC13Isub=50,ship=5,disc=3,tax=-0.05ValueErrorPASS
TC09orders.pyEC1,EC4,EC7,EC11Vsub=0,ship=0,disc=0,tax=00.00PASS
TC10orders.pyEC2,EC5,EC8,EC12Vsub=10000,ship=500,disc=1000,tax=0.1510925.00PASS
TC11orders.pyEC14,EC18VItem("free",0,5)total=0PASS
TC12orders.pyEC15,EC17VItem("book",29.99)total=29.99PASS
TC13orders.pyEC15,EC18VItem("pen",1.50,10)total=15.00PASS
TC14orders.pyEC15,EC16VItem("eraser",2.50,0)total=0PASS
TC15orders.pyEC19VOrder(5,0,0.10), no itemssub=0,total=5.50PASS
TC16orders.pyEC20VOrder(10,5,0.07)+Item(25,2)sub=50,total=58.85PASS
TC17orders.pyEC21VOrder(0,0,0.05)+3 itemssub=10,total=10.50PASS
TC18orders.pyEC22VOrder+Item(99.99,1)points=99PASS
TC19orders.pyEC23VOrder+Item(1000,1)points=1010PASS
TC20orders.pyEC24,EC25VDynItem(101)+DynItem(202,4)49.99, 40.00PASS

Steps 5-8: Execution & Coverage Progression

Step 5: EP Tests — 20/20 Passed

$ python -m pytest tests/test_ep_functional.py -v
20 passed in 0.04s

Step 6: Coverage After EP Tests

93% (unchanged)

EP tests exercise existing code paths — the 4 uncovered lines (86-89) require HTTP mock.

Step 7: Structural Tests Added

5 structural tests mock requests.get to exercise get_latest_price().

$ python -m pytest tests/test_structural.py -v
5 passed in 0.03s

Step 8: Final Coverage

100%
Name        Stmts   Miss  Branch  BrPart  Cover
-------------------------------------------------
orders.py      60      0      14       0   100%
-------------------------------------------------
54 passed in 0.10s

Coverage Progression

StageTestsStatement CoverageMissing Lines
Original tests only2993%86-89
+ 20 EP functional tests4993%86-89
+ 5 structural tests54100%None

Part 2B: LangSmith Tracing

The Quiz 1 agent was implemented with LangSmith tracing via @traceable decorators and environment configuration.

Expected Chains per Execution (Vague Input)

ChainTypeLLM Calls
quiz1_vague_spec_pipelineTop-level pipeline
classify_specificationNode1
transform_to_preciseNode1
generate_test_caseNode1
Total3

File: part2b_langsmith_tracing.py

Deliverable Files

🐍
part1_vague_spec_agent.py Part 1
LangGraph agent for vague specification detection & test case generation
🧪
shopping_cart/tests/test_ep_functional.py Part 2A
20 EP functional tests
🔬
shopping_cart/tests/test_structural.py Part 2A
5 structural tests for 100% coverage
📡
part2b_langsmith_tracing.py Part 2B
LangSmith-traced version of Quiz 1
📄
Assignment_Report.md
Complete report in Markdown format