
Random testing can eliminate subjectiveness in constructing test data and increase the diversity of test data. However, one difficult problem is to construct test oracles that decide test results---test failures or successes. Assertions can be used as test oracles and are most effective when they are derived from formal specifications such as OCL constraints. Random testing, if fully automated, can reduce the cost of testing dramatically. We propose an automated testing approach for Java programs by combining random testing and OCL. The key idea of our approach is to use OCL constraints as test oracles by translating them to runtime checks written in AspectJ. We implement our approach by adapting existing frameworks for translating OCL to AspectJ and assertion-based random testing. We evaluate the effectiveness of our approach through case studies and experiments. The results are encouraging in that our approach can detect errors in both implementations and OCL constraints and provide a practical means for using OCL.
random testing, 000, pre and postconditions, runtime assertion checking, AspectJ, Computer Engineering, Object Constraint Language, 004
random testing, 000, pre and postconditions, runtime assertion checking, AspectJ, Computer Engineering, Object Constraint Language, 004
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 5 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Top 10% | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
