The barrier coverage of a wireless sensor network is an important surveillance application of Internet of Things. Barrier coverage guarantees that all intruders traversing the protected region are detected by a chain of connected sensors. However, when the sensors are randomly deployed, barrier gaps may occur due to deployment randomness or insufficient sensors. How to locate the barrier gaps and mend them is an important aspect in the network. In this paper, we study the barrier gap problem in weak barrier coverage and strong barrier coverage ...