Partition testing is one of the most fundamental and popularly used software testing techniques. It first divides the input domain of the program under test into a set of disjoint partitions, and then creates test cases based on these partitions. Motivated by the theory of software cybernetics, some strategies have been proposed to dynamically select partitions based on the feedback information gained during testing. The basic intuition of these strategies is to assign higher probabilities to those partitions with higher fault-detection potentials, which are judged and updated mainly according to the previous test results. Such a feedback-driven mechanism can be considered as a learning process—it makes decisions based on the observations acquired in the test execution. Accordingly, advanced learning techniques could be leveraged to empower the smart partition selection, with the purpose of further improving the effectiveness and efficiency of partition testing. In this paper, we particularly leverage reinforcement learning to enhance the state-of-the-art adaptive partition testing techniques. Two algorithms, namely RLAPT_Q and RLAPT_S, have been developed to implement the proposed approach. Empirical studies have been conducted to evaluate the performance of the proposed approach based on seven object programs with 26 faults. The experimental results show that our approach outperforms the existing partition testing techniques in terms of the fault-detection capability as well as the overall testing time. Our study demonstrates the applicability and effectiveness of reinforcement learning in advancing the performance of software testing.
Hamlet D, Taylor R. Partition testing does not inspire confidence (program testing). IEEE Trans. Software Engineering, 1990, 16(12): 1402–1411. DOI: 10.1109/32.62448.
Weyuker E J, Jeng B. Analyzing partition testing strategies. IEEE Trans. Software Engineering, 1991, 17(7): 703–711. DOI: 10.1109/32.83906.
Chen T Y, Yu Y T. On the relationship between partition and random testing. IEEE Trans. Software Engineering, 1994, 20(12): 977–980. DOI: 10.1109/32.368132.
Cai K Y, Gu B, Hu H, Li Y C. Adaptive software testing with fixed-memory feedback. Journal of Systems and Software, 2007, 80(8): 1328–1348. DOI: 10.1016/j.jss.2006.11.008.
Ammann P E, Knight J C. Data diversity: An approach to software fault tolerance. IEEE Trans. Computers, 1988, 37(4): 418–425. DOI: 10.1109/12.2185.
Finelli G B. NASA software failure characterization experiments. Reliability Engineering & System Safety, 1991, 32(1/2): 155–169. DOI: 10.1016/0951-8320(91)90052-9.
Pei H, Yin B, Xie M, Cai K Y. Dynamic random testing with test case clustering and distance-based parameter adjustment. Information and Software Technology, 2021, 131:106470. DOI: 10.1016/j.infsof.2020.106470.
Sun C A, Dai H, Liu H, Chen T Y, Cai K Y. Adaptive partition testing. IEEE Trans. Computers, 2019, 68(2): 157–169. DOI: 10.1109/TC.2018.2866040.
Cai K Y. Optimal software testing and adaptive software testing in the context of software cybernetics. Information and Software Technology, 2002, 44(14): 841–855. DOI: 10.1016/S0950-5849(02)00108-8.
Watkins C J C H, Dayan P. Q-learning. Machine Learning, 1992, 8(3): 279–292. DOI: 10.1007/BF00992698.
Tesauro G. Temporal difference learning and TD-gammon. Communications of the ACM, 1995, 38(3): 58–68. DOI: 10.1145/203330.203343.
Mnih V, Kavukcuoglu K, Silver D, Rusu A A, Veness J, Bellemare M G, Graves A, Riedmiller M, Fidjeland A K, Ostrovski G, Petersen S, Beattie C, Sadik A, Antonoglou I, King H, Kumaran D, Wierstra D, Legg S, Hassabis D. Human-level control through deep reinforcement learning. Nature, 2015, 518(7540): 529–533. DOI: 10.1038/nature14236.
Arulkumaran K, Deisenroth M P, Brundage M, Bharath A A. Deep reinforcement learning: A brief survey. IEEE Signal Processing Magazine, 2017, 34(6): 26–38. DOI: 10.1109/MSP.2017.2743240.
Spieker H, Gotlieb A. Adaptive metamorphic testing with contextual bandits. Journal of Systems and Software, 2020, 165:110574. DOI: 10.1016/j.jss.2020.110574.
Ostrand T J, Balcer M J. The category-partition method for specifying and generating fuctional tests. Communications of the ACM, 1988, 31(6): 676–686. DOI: 10.1145/62959.62964.
Grochtmann M, Grimm K. Classification trees for partition testing. Software Testing, Verification and Reliability, 1993, 3(2): 63–82. DOI: 10.1002/stvr.4370030203.
Do H, Elbaum S, Rothermel G. Supporting controlled experimentation with testing techniques: An infrastructure and its potential impact. Empirical Software Engineering, 2005, 10(4): 405–435. DOI: 10.1007/s10664-005-3861-2.
Sun C A, Dai H P, Wang G, Towey D, Chen T Y, Cai K Y. Dynamic random testing of web services: A methodology and evaluation. IEEE Trans. Services Computing, 2022, 15(2): 736–751. DOI: 10.1109/TSC.2019.2960496.
Ma Y S, Offutt J, Kwon Y R. MuJava: An automated class mutation system. Software Testing, Verification and Reliability, 2005, 15(2): 97–133. DOI: 10.1002/stvr.308.
Sun C A, Dai H P, Liu H, Chen T Y. Feedback-directed metamorphic testing. ACM Trans. Software Engineering and Methodology, 2023, 32(1): Article No. 20. DOI: 10.1145/3533314.
Even-Dar E, Mansour Y. Learning Rates for Q-learning. Journal of Machine Learning Research, 2003, 5:1–25.
Sawilowsky S S. New effect size rules of thumb. Journal of Modern Applied Statistical Methods, 2009, 8(2): 597–599. DOI: 10.22237/jmasm/1257035100.
Lv J, Hu H, Cai K Y, Chen T Y. Adaptive and random partition software testing. IEEE Trans. Systems, Man, and Cybernetics: Systems, 2014, 44(12): 1649–1664. DOI: 10.1109/TSMC.2014.2318019.
Lv J, Yin B B, Cai K Y. On the asymptotic behavior of adaptive testing strategy for software reliability assessment. IEEE Trans. Software Engineering, 2014, 40(4): 396–412. DOI: 10.1109/TSE.2014.2310194.
Chen T Y, Kuo F C, Merkel R G, Tse T H. Adaptive random testing: The art of test case diversity. Journal of Systems and Software, 2010, 83(1): 60–66. DOI: 10.1016/j.jss.2009.02.022.
Romdhana A, Merlo A, Ceccato M, Tonella P. Deep reinforcement learning for black-box testing of android apps. ACM Trans. Software Engineering and Methodology (TOSEM), 2022, 31(4): Article No. 65. DOI: 10.1145/3502868.
Lee R, Mengshoel O J, Saksena A, Gardner R W, Genin D, Silbermann J, Owen M, Kochenderfer M J. Adaptive stress testing: Finding likely failure events with reinforcement learning. Journal of Artificial Intelligence Research, 2020, 69:1165–1201. DOI: 10.1613/jair.1.12190.