If it looks like a duck, swims like a duck and quacks like a duck, then it probably is a duck.
That inductive reasoning (known as "the duck test") doesn't hold true for yellow bugs with black spots.
A yellow ladybug (ladybird beetle) and a cucumber beetle look a little alike--at first glance. They're both yellow. They both have black spots.
But they're worlds apart. One is a beneficial insect. The other is a pest.
We spotted a spotted cucumber beetle (family Cerambycidae) on our sunflower plant last summer. It's a common insect in California. It eats all kinds of flowers and leaves. It's often seen on plants in the squash family. Figures. We had a squash plant in our garden. (Notice the "had.")
Ladybugs (family Coccinellidae) aren't always the classic reddish-orange color and they don't always have spots. They can be mellow yellow! But they're your buddies. They feast on aphids, mealybugs, mites, and other soft-bodied insects.
I figure that between these two insects, the ladybugs are the bright spots in the garden.