One test of the structure of a phoneme is the behavior. And one place we can observe the behaviour is in language games and errors.
I've mentioned my friends' Horse Latin speech disguise. The rules are simple you follow the first consonant of every syllable with -ibe (rhyming with bribe). So hot is hibe-ot; cold is kibe-old. banana is bribe-a-nibe-a-nibe-a.*
Let me back up. It's not fair to say that the -ibe follows the first consonant. It actually follows any onset cluster. So TRee becomes TRibe-ee instead of Tibe-Ree.
This hasn't told us anything about phonemic structure. But imagine a similar game that doesn't take the onset cluster but just the first consonant sound. In that language game tree would be tibe-ree and fly would by fibe-ly. And if we were analyzing the data when this game is applied to an unknown language we might find an clue to phonemic structure if we heard the disguised form of a made-up word like choom. Our question would be about that ch onset. Assuming that the pronunciation is appropriate to an Anglicised spelling convention we would know that the word is pronounced ʧum (rhyming with room).
But what of that affricate onset? Is it a single phoneme or two? Well if we know the rules of the language game we simply ask a speaker to disguise the word. And we know that the speaker will break apart any onset clusters. So if the disguise is chibe-oom [ʧaɪbum] we have some evidence that the ʧ is a single consonant sound because it's being treated that way. If the disguise is tibe-shoom [taɪb.ʃum] we see that the t and ʃ are being split which is evidence that they are seen as separate sounds and not a single phonemic affricate. Evidence. Not proof. More testing is required.
Now speech errors:
We look for similar effects. When someone offers up a spoonerism we see some evidence of how segments are organized. Sometimes whole clusters get switched so FLank STeak becomes STank FLake (I dated one once). But sometimes the speech error effects a change of only the first segment of a cluster. So Brew Clubber becomes Crew Blubber. One thing you might expect to notice in English is that an affricate isn't split because it's a single consonant sound. It should behave like one and not split into the two segments: t and ʃ.
But don't count on such clean data. Language is performed by people. And people hate to be contained.
My nieces love to eat at Schlotzsky's. But they have trouble pronouncing it. One of the slogans: "Funny Name. Serious Sandwich." How funny is the name? [ʃlatskiz]: That onset cluster ʃl is rare in English. It's usually found in words borrowed from Yiddish (or a few from German). One of my friends simply solved the phonotactic dilemma by epenthesis. "Sha-lote-skees" he said.
My nieces are much more impressive. They replace the ʃl cluster with a more comfortable cluster: sl. So what happens to the ʃ? They just move it over to the place formerly occupied by the s. Between the t and the k.
That complicates things. Because this makes for an odd repair. They've replaced a somewhat awkward (in English) cluster ʃl with an easier one sl. But they've completely mucked up the other cluster. The next cluster would normally be an easy onset sk on the 2nd syllable following a coda t closing off the first syllable.** But their repair makes it an almost unheard of onset ʃk. Ah but wait: there's no problem if the ʃ attaches to the preceding coda instead. So now you have a coda ʧ and a simplified onset k. And there's no constraint violation and you didn't have to resort to such an inelegant repair as epenthesis. These kids have thought about this carefully.***
[ʃlat.skiz] → [slaʧ.kiz] when you let kids work their magic.
* A word about stress and vowels: typically the stress of the original form changes and the new form gets penultimate stress: i.e. on the the last '-ibe'. Vowels tend to get neutralized to ə. Some high vowels like i or u might retain their quality. But others like æ and o are neutralized unless it's the final vowel. So you get bibe-oat for boat but bibe-a-tiber for boater.
** I propose this is a coda t and onset sk because I like onset maximization.
*** Not really. That's what makes phonology so interesting.