In Portal 2, player stats will be saved into the Steam leaderboards. In Portal, the stats will be compared to the goal, and if you matched the number of portals / steps / time to the goal (or got less than it), it will get harder and harder. These include completing the map with the: The chambers in the challenge mode are identical to the original campaign versions, only with the implementation of goal-based puzzles.
In Portal 2, the challenge modes can be played via selecting 'Play Challenge Mode' in either single-player or co-op. In Portal, challenge mode test chambers can be found in the game's 'Bonus Maps' menu option. 5.2.1 Portal Stories: Mel test chambers.