How do I diagnose an occasionally leaking dishwasher?
Several places I can think of, but the best way I can think of to narrow it down is to look for water damage on the dishwasher itself.

Check the seal around the door. In my own kitchen, I'll be gutting and expecting to replace a lot of floor boards myself because the dishwasher feet were adjusted too long and were causing it to be crushed by the counter top. The sides of the dishwasher bowed out, losing the seal with the door gasket, and allowing water to escape.

Check the supply line connections. Look for any signs of moisture at the shutoff and where it connects to the dishwasher.

Check the drain connections, again, at the dishwasher (including around any pump) and where it connects to the DWV system.

If a visual inspection of the dishwasher itself doesn't reveal anything, put a few pieces of newspaper under the dishwasher and run it through a cycle to locate the final spot of the drip (which could travel far from the leak itself). But make sure the newspaper is clear of any electrical connections and stays away from any hot motors (you don't want a short or fire), and take the newspaper out after your test.