Exercise 1: Adding the Parameter-List Smell to the Debt Ranking — Possible Solution ==================================================================== THE FOURTH SMELL ------------------------------ Long parameter list (Step 3): severity 2 (shipping/discount, the two adjacent same-typed positions that could be silently swapped), changed 6 times over the tracked period CALCULATION ------------------------------ interest = (severity - 1) * changes = (2 - 1) * 6 = 6 FULL RESULTS (all four smells) ------------------------------ Shipping if/elif chain: severity 4, changed 9x -> 27 Duplicated total calc: severity 2, changed 12x -> 12 Discount if/elif chain: severity 3, changed 4x -> 8 Long parameter list (Step 3): severity 2, changed 6x -> 6 Full ranking, highest interest first: 27: Shipping if/elif chain 12: Duplicated total calc 8: Discount if/elif chain 6: Long parameter list (Step 3) The parameter-list smell ranks last of the four - not because it isn't a real bug risk (Step 3's own finding showed it silently produced a wrong total), but because this formula only measures duplication-style severity (extra effort or extra risk per touch) multiplied by how often that specific code actually gets touched, and the signature itself changes relatively rarely compared to the pricing and shipping rules built on top of it. WHY THIS WORKS AS AN ANSWER ------------------------------ This extends the chapter's own three-item ranking with a fourth, confirming the formula generalizes cleanly to a smell type (parameter design) that wasn't one of Chapter 9's own original examples, as long as a comparable "severity" measure can be defined for it. It also reinforces the chapter's own point: a smell can be a real, serious bug risk (Step 3's silent $40.00-instead-of-$41.00 result) without being the highest-priority item by interest, because interest specifically measures repeated cost, not worst-case severity.