Robotic swarms are expected to perform tasks efficiently by task allocation. However, in most cases of designing robotic swarms with task allocation, the designer has to decompose the task into subtasks and predefine each of them. This paper reports that autonomous specialization has emerged without a priori knowledge of task decomposition using an evolutionary robotics approach. The experiments are performed in simulations and address the path formation task. The robot specialized its behavior according to the spatial position of whether the robot is traveling inner or outer side of the path.