Test Informed Learning with Examples

Logo

Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.

Menu

LinkedIN Community

Join our LinkedIN Community.

Cite this work

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}
}

Convert a letter to upper case

Write a function lower_to_upper which receives as a parameter a lowercase letter and returns that same character, uppercase. To do this you must use the functions chr y ord. If the letter does not belong to the lowercase alphabet, it must be returned the same letter.

Remember that:

This is the last time we give you the pytests that you can use to test your function. From now on you will have to do it yourself.

@pytest.mark.parametrize("testcase, input, expected_output",[(1, 'a', 'A'), (2, 'z', 'Z'), (3, 'ñ', 'Ñ'), (4, '\*', '\*'), (5, 'Q', 'Q'), (6, ' ] )

def test_lower_to_upper(testcase, input, expected_output): 
    assert lower_to_upper(input) == expected_output, "case 0".format(testcase)
Insist that the students test their programs by giving them example
pytests.