Reinforcement Learning algorithms find more and more application in fields where complex tasks need to be solved. The automation of production systems is one of those fields. Normally, programming a control system defines the automation strategy. Previous contributions by the authors have shown that a so-called agent can learn automation strategies for production systems using a Reinforcement Learning setup. However, the development of the reward function for the agent can be challenging and needs Reinforcement Learning domain knowledge. This paper introduces a novel approach in combining Test-Driven Development with Reinforcement Learning in order to solve the problem of a suitable reward function. In the presented approach predefined test cases are used to derive rewards for the agent. The use of an automated test framework allows for continuous learning sequences until all test cases are passed. An application example of a robot cell is used to demonstrate the novel approach and verify its suitability and usability. The first application shows promising results for further examination towards more application scenarios.