Build the cable and port decision tree, and test it on the awkward cases

applied · 75 min · Objective 3.2

Task

Produce a decision tree that takes a symptom and returns which of the four negotiations failed, and test it against cases chosen so that the obvious answer is wrong.

Steps

  1. Write lab/usbtree/tree.csv with header node,question,yes_goes_to,no_goes_to,conclusion implementing a decision tree with at least eight nodes.
  2. Write lab/usbtree/cases.txt with six symptom descriptions, at least two of which are awkward -- a device that works on one port and not another, or a dock that worked until a firmware update.
  3. Walk each case through the tree and record the path in lab/usbtree/walks.csv with header case,path,conclusion,confirmed_how.
  4. Confirm at least three conclusions by experiment with your own equipment, and record the observation rather than the expectation.
  5. Record in lab/usbtree/gaps.md every case the tree could not resolve and what node would have to be added -- a tree that resolves everything has not met a hard case.

Verify

awk -F, 'NR>1 && NF>=5 {n++} END {print n" tree node(s)"}' lab/usbtree/tree.csv
grep -c . lab/usbtree/cases.txt
awk -F, 'NR>1 && NF>=4 {n++} END {print n" case(s) walked"}' lab/usbtree/walks.csv
awk -F, 'NR>1 && $4!="" && tolower($4)!="not confirmed" {n++} END {print n+0" confirmed by experiment"}' lab/usbtree/walks.csv
grep -c . lab/usbtree/gaps.md

Eight or more nodes, six cases walked, three or more confirmed by experiment, and a gaps file that is not empty. An empty gaps file means either the cases were too easy or the tree has a node that guesses.

Notes

The confirmation step is what separates this from a paper exercise. A conclusion you have not tested is a hypothesis, and this course's whole argument is that a hypothesis and a finding are different things.

This is an independent study companion for CompTIA A+ Core 1 220-1201 and is not produced by or endorsed by CompTIA.