Adaptive testing can generate questions according to learners' competence level. In general, an adaptive testing system gives an ability value to each testee by evaluating the testee's understanding of a subject. A subject is usually comprised of many kinds of knowledge. For example, the subject, English, contains reading, grammar, vocabularies, writing, listening and etc. This research aims to develop an adaptive testing system based on Particle Swarm Optimization (PSO) and integrating with knowledge structure. The system decides the difficulty of the next question according to the correctness of the previous answer. The experimental results show that the system can dynamically generate questions correlated highly with learners' competence level.