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} }
Design a function (mySplit
) that gets a string and returns a list of all its words in lowercase. The returned list must not contain repeating words. You can’t use Python’s default split
. For example, with the string:
>>> mySplit('A phrase made up of words. Another phrase with other words.')
['a', 'phrase', 'made', 'up', 'of', 'words', 'another', 'with', 'other']
>>> mySplit('Hi! Helloooo HI')
['hi', 'helloooo']
To design your set of tests that you have to run automatically with pytest, think about these cases:
the string is empty
the string has punctuation marks, like ,;.:-¿?+*()!¡
the string ends with a point
the string does not end with a point
the string has numbers
que the string has repeated words, but some are capitalized and
some are not (for example: 'HEllo hello heLlo'
the string has more than 1 space between words
etc.