Question
What was Aperture science really going for, with those "test chambers"? Was it an experiment in human cognition, like a rat maze? Were they testing the portal device? GlaDOS's AI? Cubes and buttons? And what does it all have to do with shower curtains or Pentagon defense contracts?
Answer
As far as I can tell from the dialogue in the games and the lore surrounding the games, is that the testing was fulfilling a multitude of purposes, most notably testing:
- the portal gun
- human reactions and behavior in certain situations
- GLaDOS
- the turrets
- the gels, repulsion, propulsion and portal conduction surface gel
The shower curtains come into play early in Cave Johnson's career as CEO of Aperture. Before Aperture Science, it was named Aperture Fixtures and had contracts with military organizations to make shower curtains.
The portal technology was originally used as a shower curtain (presumably because the water would enter one portal and exit another, inside the same shower, preventing the water from leaving the shower area.)
What the portal technology was later being repurposed for, in the form of a gun as their dispenser, is still unknown - presumably the purpose will be revealed in the next installation of Half Life, whether that be episode 3 or a full sequel as Half Life 3, in the form of the Aperture Science research vessel, the Borealis, which became a major plot point towards the end of Half Life 2 episode 2.
Check more discussion of this question.