They all become part of the transaction, but everything in those addresses is sent and the change is returned to a fresh address.
Close. However, instead of addresses, it is previously received transactions that have to be spent in their entirety. eg, if you received
BTC3 in one transaction and
BTC4 in another transaction to the same address, each of those amounts would be treated separately (eg, you could send
BTC2 and receive
BTC1 change) even though they are at the same address.
So if I have 7 BTC in one address and 11 BTC in another and I buy something that costs 14 BTC, both addresses are emptied and 4 BTC is sent to fresh address in the wallet, 4 BTC that is mine but can't be spent until the confirmations are done, correct?
This is something that varies between wallets. While some work as you describe, others (including Bitcoin-Qt) do not actually require confirmations before change can be spent. There is no technical reason to wait for confirmations before sending coins, however unconfirmed transactions usually can't be trusted to not be double-spent. But since change is sent from yourself, to yourself, it is always trustworthy (unless you're trying to rip
yourself off).
But will that eventually end up with a bunch of addresses that all have tiny amounts building up?
No. Think about what would happen if you
did have a bunch of tiny amounts built up, and tried to spend them. Say you have
BTC10 in ten lots of
BTC1, and you want to send
BTC4.5. You would take 5 of those
BTC1 (and the recipient receives a single
BTC4.5, so the individual
BTC1 units don't exist anymore) and you would get a single
BTC0.5 in change. About half of your "dust" is suddenly gone. The more "dust" you have, the more likely it is that a future transaction you send will consume a large chunk of it in this way.