There are several glitches including animals, but they all relate to keeping animals inside an enclosure.
I expected fence and cobblestone wall to be sufficient to keep animals penned
WHAT ACTUALLY HAPPENED
However, I found that it was not so. Somehow, there are often animals appearing outside the fences, animals that were previously inside the fences (by fences, from here on in this report I am meaning cobblestone walls and normal fences).
I realize that the animal mobs do spawn randomly (or so I think) inside a map, but I then tested the problem with sheep. Unlike cows, pigs, etc (which do naturally spawn), sheep only spawn with several basic colours of wool. The first problems that I spotted involved white, black, and pink sheep. At first I was confused, but then I realized that white and black sheep can naturally spawn, so I attributed the "problem" to this. However, the pink sheep still confused me, so I looked it up. I discovered that pink sheep do actually spawn, though rarely. Therefore, I ignored the problem, until it happened again. This time, the newly appeared sheep was lime green, and incidentally, my lime green sheep that had originally been in the enclosure was no longer penned. Instead, it had somehow gotten out of the enclosure, which was comprised of cobblestone wall around the entire space, with no other blocks at the same height as it adjacent to it on either side for at least 10 blocks. This made me realize that there is in fact a glitch that allows animals to somehow go through walls. For my brother, the problem is even worse--entire populations of animals are disappearing from his underground farm, and animals are habitually appearing in the wrong pens (coloured sheep as well as other animals).
I do have some possible explanations for this. A habitual site in Minecraft is seeing an animal with their head fully stuck into a cobblestone wall or fence. Even worse, I often see animals that are halfway through a cobblestone wall or fence. It is my theory that when they are in this state (partially through a wall), and if another mob bumps into them, they will somehow go through the wall/fence.
Another explanation is that somehow, the animal "hit-box" (if I can call it that) does not properly interact with fences, cobblestone walls, and even some natural blocks, thereby allowing the mob to pass through occasionally.
OTHER EXAMPLES OF GLITCH
I have also noticed that every problem before mentioned also likely occurs with barriers made of solid rock. I have laid a vertical wall of cobblestone that is three (3) blocks high, which is far higher than any farm animal can jump. However, I have had animals escape from this enclosure, with no possible way out at all. It should be noted that they may be dying for some reason, and I have no reason/proof to suppose that they are being pushed through it.
In case you think that this is just a "teleportation" glitch (or something to that effect), I have actually witnessed an animal being pushed through both a fence and cobblestone wall. In one case, the animal wandered into the fence, and its head became partially through the fence. Soon, another animal came along, and bumped into it. This knocked it even farther into the fence. When the same animal bumped into the "stuck" animal, the "stuck" animal was pushed entirely through the fence. However, it should be noted that this is the only time that I actually physically seen a sheep go through fence (I have physically seen it happen with cobblestone wall several times), but it has supposedly happened a couple of other times.
The second instance occurred in another of my pens. I was in the process of dying sheep, and was currently about to dye several sheep orange. I walked over to a white sheep grazing by a cobblestone wall, and right-clicked it. However, I was out of range, and it wandered off. I ran closer, and accidentally hit it, just as I right-clicked it. It changed to orange, and also got partially "stuck" in the wall. Remembering what had happened earlier, I tried bumping it myself. Sure enough, it popped through the wall. Unsure whether it had actually went through the wall, or simply disappeared, I looked over the wall and saw an orange sheep.
This is where this report may become a little unrealistic. I hardly know anything about programming, but I did take a small course. Could you set the "hit-box" of animals (and other mobs) so that when they come in contact with another mob (or block), a collision event occurs? The collision event would likely state something to the effect of "if another mob's "hit-box" collides with the current mob's "hit-box," cause the mobs to glance off of each other." What I am trying to say is, couldn't you add to the code so that when two mobs collide, they don't intersect with each other at all? And more importantly, couldn't you do the same thing for fence and other blocks, so that if a mob collided with a fence (or other block), they wouldn't be able to get any farther, and that they wouldn't appear to be inside the wall.
I realize that the head of the sheep may not be included in its "hit-box," but I wonder if it would be possible to fix the problem in another way. I fully realize that I know nothing about programming, but I hope that you can fix this problem.
STEPS TO REPLICATING THE GLITCH
As far as I can tell, there are no steps to replicating this. It only happens very, very rarely (and can be hard to notice). I apologize for this, but I can't figure out a way to make sure that it happens.
I realize that this is a very long report, and I do apologize. However, I felt it was best to totally describe the bug, or glitch. I realize that there may be no way to fix it, but I hope that there is. If you could let me know what you think about the problem and correct me if I have something wrong(my e-mail is "email@example.com"), I would really appreciate it. I really like all the work you have done with Minecraft, and I hope that you can fix this problem, because (truth be told) it is very, very frustrating depending on the situation (when I am trying to keep different wool colours separate).
Thanks a lot,