Users engaged in information search often reformulate or modify their queries. This paper reports on an investigation of how task type and task situation influence users' query reformulation behavior. A controlled experiment was conducted with 48 participants, each working on six web search tasks classified into three types according to the task structure: Simple, Hierarchical and Parallel. We developed a taxonomy of query reformulation and used an automated method to detect the reformulations. Our results showed that Specialization was most frequently used in Simple tasks, and Word Substitution was most frequently used in Parallel tasks. After visiting and saving a useful web page, Generalization was less likely to be used while New query was more likely to be used. We also found that the effectiveness of each query reformulation type varied in different task types. The results of this study demonstrate the effect of task type on users' query reformulation behavior and have implications for the design of query suggestions that are offered to users during searching.