{"title":"Testing Java monitors through deterministic execution","authors":"C. Harvey, P. Strooper","doi":"10.1109/ASWEC.2001.948498","DOIUrl":null,"url":null,"abstract":"Java is a popular, modern programming language that supports monitors. However, monitor implementations, like other concurrent programs, are hard to test due to the inherent non-determinism. The paper presents a method for testing Java monitors, which extends the work of P. Brinch Hansen (1978) on testing Concurrent Pascal monitors. A monitor is tested by executing a concurrent program in which the processes are synchronised by a clock to make the sequence of interactions deterministic and reproducible. The method is extended to account for the differences between Concurrent Pascal monitors and Java monitors, and to provide additional coverage of the implementation under test. Tool support and documentation in the form of a test plan are also provided. The method is illustrated in detail on an asymmetric producer-consumer monitor, which is the same example that was used to illustrate the original method. The application of the method to the readers and writers problem is also discussed.","PeriodicalId":360336,"journal":{"name":"Proceedings 2001 Australian Software Engineering Conference","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2001-08-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"23","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings 2001 Australian Software Engineering Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ASWEC.2001.948498","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 23
Abstract
Java is a popular, modern programming language that supports monitors. However, monitor implementations, like other concurrent programs, are hard to test due to the inherent non-determinism. The paper presents a method for testing Java monitors, which extends the work of P. Brinch Hansen (1978) on testing Concurrent Pascal monitors. A monitor is tested by executing a concurrent program in which the processes are synchronised by a clock to make the sequence of interactions deterministic and reproducible. The method is extended to account for the differences between Concurrent Pascal monitors and Java monitors, and to provide additional coverage of the implementation under test. Tool support and documentation in the form of a test plan are also provided. The method is illustrated in detail on an asymmetric producer-consumer monitor, which is the same example that was used to illustrate the original method. The application of the method to the readers and writers problem is also discussed.