This work develops tools to quantify and optimize performance metrics for bipedal walking, toward enabling improved practical and autonomous operation of two-legged robots in real-world environments. While speed and energy efficiency of legged locomotion are both useful and straightforward to quantify, measuring robustness is arguably more challenging and at least as critical for obtaining practical autonomy in variable or otherwise uncertain environmental conditions, including rough terrain. The intuitive and meaningful robustness quantification adopted in this thesis begins by stochastic modeling of disturbances such as terrain variations, and conservatively defining what a failure is, for example falling down, slippage, scuffing, stance foot rotation, or a combination of such events. After discretizing the disturbance and state sets by meshing, step-to-step dynamics are studied to treat the system as a Markov chain. Then, failure rates can be easily quantified by calculating the expected number of steps before failure. Once robustness is measured, other performance metrics can also be easily incorporated into the cost function for optimization.For high performance and autonomous operation under variations, we adopt a capacious framework, exploiting a hierarchical control structure. The low-level controllers, which use only proprioceptive (internal state) information, are optimized by a derivative-free method without any constraints. For practicability of this process, developing an algorithm for fast and accurate computation of our robustness metric was a crucial and necessary step. While the outcome of optimization depends on capabilities of the controller scheme employed, the convenient and time-invariant parameterization presented in this thesis ensures accommodating large terrain variations. In addition, given environment estimation and state information, the high-level control is a behavioral policy to choose the right low-level controller at each step. In this thesis, optimal switching policies are determined by applying dynamic programming tools on Markov decision processes obtained through discretization. For desirable performance in practice from policies that are formed using meshing-based approximation to the true dynamics, robustness of high-level control to environment estimation and discretization errors are ensured by modeling stochastic noise in the terrain information and belief state while solving for behavioral policies