A Property Based Approach for Testing Machine Learning Models.
Software Testing; Property-Based Testing; Machine Learning Model Testing.
Recently, due to several technological advances, machine learning based software systems have gone mainstream. As a result of their widespread adoption, software testers are striving to come up with approaches to enhancing the quality and reliability of these solutions. Nonetheless, machine learning based systems pose unique testing challenges that differ from traditional software systems. Consequently, researchers have started exploring ways to adapt existing software testing techniques for machine learning based systems. To cope with the challenges of testing machine learning based systems, we propose an approach that builds on two test adequacy criteria based on decision tree models to generate property-based test cases for better evaluating machine learning models. Specifically, the proposed approach builds on two test adequacy criteria to leverage the internal structure of decision tree models. Thus, these decision tree based criteria are used to guide the selection of test inputs. This selection process is further refined by rendering the information about decisions into rules that dictate the behavior of the model. In order to explore the problem space more thoroughly, these rules are then turned into properties. To automate our approach, we developed a proof-of-concept tool that turns rules into executable code: properties. To evaluate our approach and the implementation thereof, we carried out an experiment using 21 datasets. We evaluated the effectiveness of test inputs in terms of the difference in model’s behavior between the test input and the training data. The experiment results would seem to suggest that our property-based approach is suitable for guiding the generation of effective test data.