In the software maintenance and development process, the software bug detection is an essential problem because it related with the complete software successes. So, the earlier software bug detection is essential to enhance the software efficiency, reliability, software quality and software cost. Moreover, the efficient software bug prediction is a critical as well as challenging operation. Hence, the efficient software bug prediction model is developed in this article. To achieve this objective, optimized long short-term memory is developed. The important stages of the proposed model is preprocessing, feature selection and bug detection. At first the input bug dataset is preprocessed. In preprocessing, the duplicate data instances are removed from the dataset. After the preprocessing, the feature selection is done by Adaptive Golden Eagle Optimizer (AGEO). Here the traditional GEO algorithm is altered by means of opposition-based learning (OBL). Finally, the proposed approach utilizes a long short-term memory (LSTM) based recurrent neural network (RNN) for bug prediction. Long Short-Term Memory (LSTM) network is a type of recurrent neural network. The promise and NASA dataset are considered as the input for bug prediction. the performance of proposed approach is analysed based on various metrics namely, accuracy, F- measure, G-measure and Matthews Correlation Coefficient (MCC).