The input space of a system must be modeled before combinatorial testing can be applied to this system. The effectiveness of combinatorial testing to a large extent depends on the quality of the input space model. In this paper we introduce an input space modeling methodology for combinatorial testing. The main idea is to consider the process of input space modeling as two steps, namely, input structure modeling and input parameter modeling. The first step tries to capture the structural relationship among different components in the input space. The second step tries to identify parameters, values, relations and constraints for individual components. We also suggest strategies about how to perform unit and integration testing based on the input space structure. We applied the proposed methodology to two real-life programs. We report our experience and results that demonstrate the effectiveness of the proposed methodology.