BAB V HASIL DAN PEMBAHASAN
5.1 Proses dan Hasil Prediksi Dataset Petstore
5.1.2 Hasil Prediksi
Berdasarkan hasil yang didapatkan setelah menjalankan program algoritma naive bayes, maka hasil yang didapatkan adalah sebagai berikut.
Gambar 5.1. Output Prediksi Petstore Dengan Dataset Ant-1.7
UIN Syarif Hidayatullah Jakarta
Gambar 5.2. Output Prediksi Petstore Dengan Dataset Ant-1.7 (Lanjutan)
Gambar 5.3. Output Prediksi Petstore Dengan Dataset Lucene-2.4
UIN Syarif Hidayatullah Jakarta
Gambar 5.4. Output Prediksi Petstore Dengan Dataset Lucene-2.4 (Lanjutan)
Gambar 5.5. Output Prediksi Petstore Dengan Dataset Log4j-1.2
UIN Syarif Hidayatullah Jakarta
Gambar 5.6. Output Prediksi Petstore Dengan Dataset Log4j-1.2 (Lanjutan)
Dari hasil output diatas, dapat kita representasikan pada tabel dibawah ini
Tabel 5.2. Hasil Prediksi Cacat Petstore
Module Name Defect Prediction1 Prediction2 Prediction3
Jpetstore6Application 0 0 0 0
DataSourceConfig 0 0 0 0
ServiceConfig 0 0 0 0
Account 0 1 1 1
Banner 1 0 0 0
BillingDetails 0 0 0 0
Cart 1 0 0 0
CartItem 0 0 0 0
Category 0 0 0 0
Item 0 1 1 1
LineItem 0 0 0 0
Order 0 1 1 1
OrderDetails 0 0 1 1
UIN Syarif Hidayatullah Jakarta
UIChangeCartItemQuantityEvent 0 0 0 0
UIEventBus 0 0 1 0
UIN Syarif Hidayatullah Jakarta
Berdasarkan tabel diatas, Dari hasil prediksi menggunakan algoritma naive bayes dengan 3 dataset yang berbeda, hanya 1 module defect yang hasil prediksinya juga defect. Module tersebut adalah AccountForm. Sedangkan terdapat 44 module tidak defect yang hasil prediksinya juga tidak defect. Jadi, dari hasil prediksi dengan ketiga dataset tersebut, hanya 45 module yang memiliki hasil prediksinya benar dan sama. Hanya 3 module yang hasil prediksi dari ketiga dataset tersebut sama, namun hasilnya salah atau tidak sesuai dengan kenyataan dataset asli. 17 module lainnya setiap training dataset memiliki hasil yang berbeda.
Hasil prediksi dengan dataset Ant-1.7 menghasilkan 58 module yang diprediksi benar atau sama dengan dataset asli. Dari 58 module tersebut, hanya 1 modul defect yang di prediksi defect oleh algoritma naive bayes, yaitu module AccountForm. Disamping itu, terdapat 7 module yang hasil prediksinya salah. 4 module yang sebenarnya defect, tetapi hasil prediksi menunjukkan bahwa module tersebut tidak defect. Module tersebut yaitu Banner, Cart,
UIN Syarif Hidayatullah Jakarta
CatalogService, dan OrderService. 3 module lainnya di prediksi defect namun kenyataannya module tersebut tidak defect. Module tersebut yaitu Account, Item, dan Order.
Hasil prediksi dengan dataset Log4j-1.2 menghasilkan 47 module yang hasil prediksinya benar atau sama dengan dataset asli.
Dari 47 module tersebut, hanya 3 modul defect yang di prediksi defect oleh algoritma naive bayes, yaitu CatalogService, OrderService, dan AccountForm. Disamping itu, terdapat 18 module yang hasil prediksinya salah atau tidak sesuai dengan dataset asli. 16 module diantaranya di prediksi defect, namun pada dataset asli, module tersebut tidak defect. 2 module lainnya di prediksi tidak defect, tetapi module tersebut pada kenyataanya adalah defect. Module tersebut yaitu Banner dan Cart.
Hasil prediksi dengan dataset Lucene-2.4 mengasilkan 54 prediksi module yang benar. Namun, hanya 1 module defect yang di prediksi benar, yaitu module AccountForm. Disamping itu, hasil prediksi 11 module lainnya adalah salah. Terdapat 4 module yang sebenaranya defect, tetapi di prediksi tidak defect. Module tersebut yaitu, Banner, Cart, CatalogService, dan OrderService. 7 module lainnya di prediksi defect, tetapi module tersebut tidak defect.
5.2. Perhitungan Peforma Klasifikasi
Untuk menghitung tingkat performa prediksi yang dilakukan oleh algoritma naive bayes dengan 3 jenis dataset yang berbeda, pertama, kita
UIN Syarif Hidayatullah Jakarta
memetakkan hasil prediksi tersebut dengan confusion matrix seperti pada tabel di bawah ini:
Tabel 5.3. Confusion Matrix Menggunakan Dataset Ant-1.7 Predicted Positive Predicted Negative
Actual Positive 1 4
Actual Negative 3 57
Tabel 5.4. Confusion Matrix Menggunakan Dataset Lucene-2.4 Predicted Positive Predicted Negative
Actual Positive 1 4
Actual Negative 7 53
Tabel 5.5. Confusion Matrix Menggunakan Dataset Log4j-1.2 Predicted Positive Predicted Negative
Actual Positive 3 2
Actual Negative 16 44
Setelah kita memetakkan hasil klasifikasi naive bayes dengan confusion matrix, maka kita dapat menghitung nilai dari akurasi, precision, recall, dan false alarm. Contoh kita mengambil hasil prediksi naive bayes dengan data training Ant-1.7. Berikut merupakan cara perhitungannya dan tabel hasil performa prediksi dari ke tiga jenis dataset training:
UIN Syarif Hidayatullah Jakarta
Tabel 5.6. Hasil Performa Prediksi Yang Di Hasilkan Dataset
Name
Accuracy Score
Precision Score
Recall Score
False Alarm Score
Ant-1.7 89.23% 25% 20% 5%
Log4j-1.2 72.30% 16,67% 60% 26,67%
Lucene-2.4 83.07% 12,5% 20% 11,67%
Ketika menggunakan Ant-1.7 sebagai dataset training, tingkat akurasi, precision, recall, dan false alarm adalah 89.23%, 25%, 20%, 5%. Lalu, pada dataset Log4j-1.2, hasil tingkat akurasi, precision, recall, dan false alarm adalah 72.30%, 16.67%, 60%, 26.67%. Kemudian, pada dataset Lucene-2.4,
UIN Syarif Hidayatullah Jakarta
hasil tingkat akurasi, precision, recall, dan false alarm adalah 83.07%, 12.5%, 20%, 11.67%.
BAB VI
KESIMPULAN DAN SARAN 6.1. Kesimpulan
Berdasarkan hasil penelitian yang telah penulis jelaskan, maka dapat ditarik kesimpulan yaitu:
1. Algoritma Naïve Bayes dapat diterapkan pada kasus prediksi cacat pada perangkat lunak web petstore menggunakan data lintas proyek atau cross-project defect prediction.
2. Hasil prediksi defect menggunakan code review hanya mendeteksi 5 modul yang defect. Disamping itu, hasi prediksi cacat pada perangat lunak menggunakan algoritma naive bayes dengan dataset Lucene-2.4 dan Log4j-1.2 sebagai dataset training menghasilkan 8 module defect dan 19 module defect. Namun, ketika memprediksi
UIN Syarif Hidayatullah Jakarta
defect/cacat dengan dataset Ant-1.7 sebagai dataset training, hanya menghasilkan 4 module defect dan hasil tersebut lebih sedikit dari yang didapatkan dengan dataset Ant-1.7, Log4j-1.2, dan code review.
3. Secara keseluruhan, tingkat akurasi naive bayes dengan tiga dataset yang berbeda (Ant-1.7, Lucene-2.4, Log4j-1.2) sebesar 72.30% - 89.23% dan memiliki tingkat false alarm yang cukup rendah, sekitar 5% - 11.67%. Namun, tingkat precision dan recall rendah, kecuali recall score ketika menggunakan dataset Log4j-1.2 sebagai data training memiliki hasil yang cukup bagus, yaitu 60%. Selain itu menghasilkan recall sebesar 20%. Kemudian, tingkat precision yang dihasilkan sekitar 12.5% - 25%.
6.2. Saran
1. Menggunakan algoritma machine learning yang lain dalam memprediksi cacat pada perangkat lunak. Lalu menggunakan aplikasi lain yang dijadikan sebagai prediksi cacat atau menggunakan software metric yang sesuai dengan karakteristik dari aplikasi yang diuji
2. Menggunakan teknik pengujian perangkat lunak yang lain atau AI-Based Software Testing untuk membandingkan hasilnya dengan cross-project defect prediction
3. Menggunakan dataset yang lain dan yang memiliki data yang sangat banyak atau large-scale untuk mendapatkan performa klasifikasi yang bagus, terutama untuk mendapatkan nilai precision dan recall yang tinggi.
UIN Syarif Hidayatullah Jakarta
DAFTAR PUSTAKA
Aggarwal, K. K., Singh, Y., Kaur, A., & Malhotra, R. (2006). Empirical study of object-oriented metrics. Journal of Object Technology, 5(8), 149–173.
https://doi.org/10.5381/jot.2006.5.8.a5
Aleem, S., Capretz, L. F., & Ahmed, F. (2015). Benchmarking Machine Learning Techniques for Software Defect Detection. International Journal of Software Engineering & Applications (IJSEA), 6(3), 11–23.
https://doi.org/10.5121/ijsea.2015.6302
Arora, I., Tetarwal, V., & Saha, A. (2015). Open issues in software defect prediction. In Procedia Computer Science (Vol. 46, pp. 906–912).
https://doi.org/10.1016/j.procs.2015.02.161
Brink, H., Richards, J. W., & Fetherolf, M. (2017). Real World Machine Learning.
(S. Kline, A. Scherer, O. Booth, O. Harlovic, & K. Sullivan, Eds.). Shelter
UIN Syarif Hidayatullah Jakarta
Island, New York, USA: Manning Publications Co.
Deep Singh, P., & Chug, A. (2017). Software defect prediction analysis using machine learning algorithms. In 2017 7th International Conference on Cloud Computing, Data Science & Engineering - Confluence (pp. 775–781). IEEE.
https://doi.org/10.1109/CONFLUENCE.2017.7943255
Drabick, R. (2003). Best Practices for the Formal Software Testing Process: A Menu of Testing Tasks. Dorset House. Retrieved from
https://books.google.co.id/books?id=bVcUAAAAQBAJ&printsec=frontcove r&dq=software+testing+life+cycle&hl=en&sa=X&ved=0ahUKEwjavtXwtJ_
XAhULRY8KHU7zDcMQ6AEIMjAC#v=onepage&q=software testing life cycle&f=false
Gayathri, M., & Sudha, A. (2014). Software Defect Prediction System using Multilayer Perceptron Neural Network with Data Mining. International Journal of Recent Technology and Engineering, (32), 2277–3878.
Giang, L. T., Kang, D., & Bae, D.-H. (2010). Software Fault Prediction Models for Web Applications. 2010 IEEE 34th Annual Computer Software and Applications Conference Workshops, 51–56.
https://doi.org/10.1109/COMPSACW.2010.19
Haghpanah, A., & Taheri, M. (2017). A non-parametric mixture of Gaussian naive Bayes classifiers based on local independent features. Artificial Intelligence and Signal Processing Conference (AISP), (1), 209–212.
He, P., Li, B., Zhang, D., & Ma, Y. (2014). Simplification of Training Data for Cross-Project Defect Prediction, 10.
He, Z., Peters, F., Menzies, T., & Yang, Y. (2013). Learning from open-source projects: An empirical study on defect prediction. International Symposium on Empirical Software Engineering and Measurement, 45–54.
https://doi.org/10.1109/ESEM.2013.20
Jain, M. M., & Richariya, P. V. (2012). An Improved Techniques Based on Naive Bayesian for Attack Detection. International Journal of Emerging
Technology and Advanced Engineering Website: Www.ijetae.com, 2(1), 324–
331.
UIN Syarif Hidayatullah Jakarta
Jamil, M. A., Arif, M., Sham, N., Abubakar, A., & Ahmad, A. (2016). Software Testing Techniques: A Literature Review.
https://doi.org/10.1109/ICT4M.2016.40
JetBrains. (2014). Touring Plugins: Software Metrics. Retrieved August 23, 2017, from https://blog.jetbrains.com/idea/2014/09/touring-plugins-issue-1/
JetBrains. (2016). MetricReloaded :: JetBrains Plugin Repository. Retrieved August 22, 2017, from
https://plugins.jetbrains.com/plugin/93-metricsreloaded
Kaczanowski, T. (2012). Practical unit testing with testNG and Mockito (First Edit). kaczanowscy.pl.
Kawata, K., Amasaki, S., & Yokogawa, T. (2015). Improving relevancy filter methods for cross-project defect prediction. Proceedings - 3rd International Conference on Applied Computing and Information Technology and 2nd International Conference on Computational Science and Intelligence, ACIT-CSI 2015, 2–7. https://doi.org/10.1109/ACIT-ACIT-CSI.2015.104
Kayarvizhy, N. (2016). Systematic Review of Object Oriented Metric Tools.
International Journal of Computer Applications, 135(2), 8–13.
Kirk, M. (2017). Thoughtful Machine Learning with Python. (M. Loukides, S.
Cutt, & N. Adams, Eds.) (First Edit). Sebastopol, California, USA: O’Reilly Media, Inc.
Kumaresh, S., R, B., & Sivaguru, M. (2014). Software Defect Classification using Bayesian Classification Techniques. International Journal of Computer Applications, 16–20.
Kumudha, P., & Venkatesan, R. (2016). Cost-Sensitive Radial Basis Function Neural Network Classifier for Software Defect Prediction. The Scientific World Journal, 2016. https://doi.org/10.1155/2016/2401496
Lal, H., & Pahwa, G. (2017). Code Review Analysis of Software System using Machine Learning Techniques. 11th International Conference on Intelligent Systems and Control (ISCO), 8–13.
Ma, Y., Luo, G., Zeng, X., & Chen, A. (2012). Transfer learning for
cross-company software defect prediction. Information and Software Technology,
UIN Syarif Hidayatullah Jakarta
54(3), 248–256. https://doi.org/10.1016/j.infsof.2011.09.007
Malhotra, R. (2015). A systematic review of machine learning techniques for software fault prediction. Applied Soft Computing Journal, 27, 504–518.
https://doi.org/10.1016/j.asoc.2014.11.023
Menzies, T., Kocagüneli, E., Minku, L., Peters, F., & Turhan, B. (2015). Sharing Data and Models in Software Engineering. (T. Green & L. Lawrence, Eds.).
Massachussets, USA: Elsevier.
https://doi.org/http://dx.doi.org/10.1016/B978-0-12-417295-1.00020-5 Mesquita, D. P. P., Rocha, L. S., Gomes, J. P. P., & Rocha Neto, A. R. (2016).
Classification with reject option for software defect prediction. Applied Soft Computing Journal, 49(December), 1085–1093.
https://doi.org/10.1016/j.asoc.2016.06.023
Misirli, A. T., Bener, A., & Kale, R. (2011). AI-Based Software Defect Predictors:
Applications and Benefits in a Case Study. Proceedings of the Twenty-Second Innovative Applications of Artificial Intelligence Conference, 32(2), 57–68.
Retrieved from
http://search.proquest.com/docview/878154176/5C88BAE8A14F49DCPQ/4 96?accountid=10218%5Cnfiles/3602/Misirli et al. - 2011 - AI-Based
Software Defect Predictors Applications .pdf%5Cnfiles/3704/496.html Nam, J. (2014). Survey on Software Defect Prediction. Master’s Thesis. Retrieved
from http://www.cse.ust.hk/~jcnam/files/PQE_Survey_JC.pdf
Nam, J., Fu, W., Kim, S., Menzies, T., & Tan, L. (2017). Heterogeneous Defect Prediction. IEEE Transactions on Software Engineering, 5589(c), 1–23.
https://doi.org/10.1109/TSE.2017.2720603
Nam, J., & Kim, S. (2015). CLAMI: Defect prediction on unlabeled datasets.
Proceedings - 2015 30th IEEE/ACM International Conference on Automated Software Engineering, ASE 2015, 452–463.
https://doi.org/10.1109/ASE.2015.56
Pandas. (2016). pandas: powerful Python data analysis toolkit. Retrieved August 29, 2017, from https://pandas.pydata.org/pandas-docs/stable/
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., …
UIN Syarif Hidayatullah Jakarta
Duchesnay, É. (2012). Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12, 2825–2830. https://doi.org/10.1007/s13398-014-0173-7.2
Poon, W. N., Bennin, K. E., Huang, J., Phannachitta, P., & Keung, J. W. (2017).
Cross-Project Defect Prediction Using a Credibility Theory Based Naive Bayes Classifier. 2017 IEEE International Conference on Software Quality, Reliability and Security (QRS), 434–441.
https://doi.org/10.1109/QRS.2017.53
Radjenović, D., Heričko, M., Torkar, R., & Živkovič, A. (2013). Software fault prediction metrics: A systematic literature review. Information and Software Technology, 55(8), 1397–1418. https://doi.org/10.1016/j.infsof.2013.02.009 Rahman, F., & Devanbu, P. (2013). How, and why, process metrics are better.
Proceedings - International Conference on Software Engineering, 432–441.
https://doi.org/10.1109/ICSE.2013.6606589
Rao, S., & Kumar, R. (2016). Generalized regression neural network for software defect estimation. The IIOAB Journal, 7.
Raschka, S., & Mirjalili, V. (2017). Python Machine Learning. (F. Pohlmann, C.
Nelson, M. Sangwan, B. Rai, & N. Shetty, Eds.) (Second Edi). Birmingham, UK: Packt Publishing Ltd.
Ryu, D., & Baik, J. (2016). Effective multi-objective naïve Bayes learning for cross-project defect prediction. Applied Soft Computing Journal, 49, 1062–
1077. https://doi.org/10.1016/j.asoc.2016.04.009
Scikit-Learn. (2017). User Guide: Scikit-Learn. Retrieved August 29, 2017, from http://scikit-learn.org/stable/user_guide.html
Singh, P., Verma, S., & Vyas, O. P. (2013). Cross Company and within Company Fault Prediction using Object Oriented Metrics. International Journal of Computer Applications, 74(8), 975–8887.
Sommerville, I. (2016). Software Engineering: Global Edition. (M. Horton, M.
Hirsch, M. Goldstein, C. Bell, M. Borthakur, B. Roy, & J. Holcomb, Eds.) (Tenth Edit). Essex, England: Pearson Education Limited. Retrieved from http://iansommerville.com/software-engineering-book/
UIN Syarif Hidayatullah Jakarta
Stephens, R. (2015). Beginning Software Engineering. (B. Hochgurtel, R. Elliot, A. O. Tuiton, & S. D. Phillips, Eds.). Indianapolis, Indiana: John Wiley &
Sons, Inc. https://doi.org/10.1002/9781119209515
Suri, P. R., & Singhani, H. (2015). Object Oriented Software Testability ( OOSTe ) Metrics Analysis. International Journal of Computer Applications
Technology and Research, 4(5), 359–367.
https://doi.org/10.7753/IJCATR0405.1006
Tosun, A., Bener, A., Turhan, B., & Menzies, T. (2010). Practical considerations in deploying statistical methods for defect prediction: A case study within the Turkish telecommunications industry. Information and Software Technology, 52(11), 1242–1257. https://doi.org/10.1016/j.infsof.2010.06.006
Wang, T., & Li, W. (2010). Naïve Bayes Software Defect Prediction Model. Ieee, (2006), 0–3. https://doi.org/10.1109/CISE.2010.5677057
Yu, Q., Jiang, S., & Zhang, Y. (2017). A feature matching and transfer approach for cross-company defect prediction. Journal of Systems and Software.
https://doi.org/10.1016/j.jss.2017.06.070
Zheng, J. (2010). Cost-sensitive boosting neural networks for software defect prediction. Expert Systems with Applications, 37(6), 4537–4543.
https://doi.org/10.1016/j.eswa.2009.12.056
UIN Syarif Hidayatullah Jakarta
LAMPIRAN
Lampiran 1- Source Code Defect Prediction Naive Bayes
UIN Syarif Hidayatullah Jakarta
(Lanjutan)
UIN Syarif Hidayatullah Jakarta
(Lanjutan)
UIN Syarif Hidayatullah Jakarta
(Lanjutan)
UIN Syarif Hidayatullah Jakarta
Lampiran 2- Jadwal Presentasi Di IWBIS 2018
UIN Syarif Hidayatullah Jakarta
Lampiran 3- Dataset Petstore
UIN Syarif Hidayatullah Jakarta
UIN Syarif Hidayatullah Jakarta
(Lanjutan)
UIN Syarif Hidayatullah Jakarta
Lampiran 4- Dataset Ant-1.2
UIN Syarif Hidayatullah Jakarta
Lampiran 5- Dataset Lucene-2.4
UIN Syarif Hidayatullah Jakarta
(Lanjutan)
Lampiran 6- Dataset Log4j-1.2
UIN Syarif Hidayatullah Jakarta
(Lanjutan)
UIN Syarif Hidayatullah Jakarta
Lampiran 7- Tampilan Home Petstore
Lampiran 8- Tampilan Kategori Birds
UIN Syarif Hidayatullah Jakarta
Lampiran 9- Tampilan Login
Lampiran 10 - Tampilan Register
UIN Syarif Hidayatullah Jakarta
Lampiran 11 - Tampilan Rincian Binatang
Lampiran 12 - Tampilan Cart
UIN Syarif Hidayatullah Jakarta
Lampiran 13 - Tampilan Confirm Order
Lampiran 14 - Tampilan Help