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} }
Implement a program that calculates the interest produced from a total accumulated capital of an amount c, invested at an interest r (as a percentage) during t days. The formula used to calculate interest is:
\[I=\frac{c \times r \times t}{360 \times 100}\]To test your program you can try with the following test cases:
test case ID | inputs | expected output | ||
---|---|---|---|---|
\(c\) | \(r\) | \(t\) | ||
1 | 10000 | 5.5% | 360 | 550 euros |
2 | 25000 | 60% | 45 | 1875 euros |
3 | 0 | 50% | 200 | 0.0 |
4 | -2000 | 45% | 2 | -5.0 |
5 | 12.345 | 56.78% | 900 | 17.0 |
Instead of sample executions for them to check, we add a table with
test cases. This teaches them what test cases are made up of:
- identifier
- inputs
- expected outputs