This paper investigates the lot size, reorder point inventory model involving variable lead time with partial backorders, where the production process is imperfect. The options of investing in process quality improvement and setup cost reduction are included, and lead time can be shortened at an extra crashing cost. The objective is to simultaneously optimize the lot size, the reorder point, the process quality, the setup cost, and the lead time. We first assume that lead-time demand follows a normal distribution and develop an algorithm to find the optimal solution. Then, we relax the assumption of normality to consider a distribution-free case where only the mean and standard deviation of lead-time demand are known. We apply the minimax distribution-free procedure to solve this problem. Furthermore, two numerical examples are given to illustrate the results. Scope and purpose In past two decades, the Japanese successful experience of using just-in-time (JIT) production has received a great deal of attention. The underlying goal of JIT is to eliminate waste, which can be achieved through various efforts, such as shortening lead time, reducing setup cost, and improving quality. In a recent paper, Moon and Choi (Comput. Oper. Res. 25 (1998) 1007) studied the lead time reduction problem on a lot size, reorder point (continuous review ( Q, r)) inventory model in which the quality issue is ignored and the setup cost is fixed. In this article, we extend Moon and Choi's model to include the possible relationship between quality and lot size. We also investigate the joint effects of quality improvement and setup cost reduction in which the lot size, reorder point, process quality, setup cost, and lead time are decision variables.