Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.
Join our LinkedIN Community.
Use the following BibTeX entry to cite this work:
@INPROCEEDINGS{DVMB2023, author={Doorn, Niels and Vos, Tanja and MarĂn, Beatriz and Barendsen, Erik}, booktitle={2023 IEEE Conference on Software Testing, Verification and Validation (ICST)}, title={Set the right example when teaching programming: Test Informed Learning with Examples (TILE)}, year={2023}, volume={}, number={}, pages={269-280}, doi={10.1109/ICST57152.2023.00033} }
Write a program that reads a character from the keyboard and
determines with the function is_digit
from the previous exercise
if it is one of the digits from 0 to 9. Write the program in such a
way that it can be used to read several different characters from
the keyboard until the user writes the word end.
An example of a test session you can execute manualy via the shell could be:
>>> %Run
Write a character or 'end' to finish: 4
4 is a digit from 0 to 9
Write a character or 'end' to finish: 56
56 is not a digit from 0 to 9
Write a character or 'end' to finish: z
z is not a digit from 0 to 9
Write a character or 'end' to finish: dfg
dfg is not a digit from 0 to 9
Write a character or 'end' to finish: 0
0 is a digit from 0 to 9
Write a character or 'end' to finish: end
>>>
Insist that the students test their programs by giving them example
test runs.