Students typically do not put much effort into writing test cases when an assignment simply requires that some test cases be written. An argument is made for a code-wrecking approach to provide students with the motivation to write more test cases. HoliCoW (holistic code-wrecker) is a tool written in JavaScript and NodeJS that can generate program versions containing off-by-one errors. Student test cases written using Mocha, a JavaScript test framework, can then be exercised against these different program versions. Ideally, all the injected errors should be detected. Students who know their test cases are to be evaluated this way should write more test cases. An initial analysis suggests that students do indeed write two to three times more test cases when HoliCoW is used, but the investigators stress that this result is preliminary and that research is ongoing.
How much of the assignment grade was based on test suite quality is not stated. This is unfortunate, as instructors know that student behavior is heavily influenced by the marking scheme. Even more unfortunate is the fact that the investigators seem to have ignored the considerable literature that already exists on mutation testing and automatic test suite generation. MUTANDIS is an existing mutation testing tool for JavaScript. JSEFT is an existing automatic test suite generation tool for JavaScript. Wouldn’t it be better for students to understand and apply automatic test suite generation?
Because of the above criticisms, this short paper will be of interest only to those working on the mutation testing of JavaScript code.