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

#file union_test_pytest_output.txt

============================= test session starts ==============================
platform darwin -- Python 3.7.9, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /Users/tanjavos/Dropbox/1-PROJECTS/6-QPED/TILE/files-parsers-nifty/pytests-for_testing_reports
plugins: cov-2.12.1
collected 8 items

union_test.py F..F..FF                                                   [100%]

=================================== FAILURES ===================================
____________________ test_union[1-input10-input20-output0] _____________________

testcase = 1, input1 = [], input2 = [], output = ()

    @pytest.mark.parametrize("testcase, input1, input2, output",[
    (1, [], [], ()),   #Cardinalidad
    (2, [], [1,2,3], [1,2,3]),   #Cardinalidad
    (3, [1,2,3], [], [1,2,3]),   #Cardinalidad
    (4, [1,1], [], [1]),   #Cardinalidad
    (5, [], [1,1], [1]),   #Cardinalidad
    (6, ["hola", 2, 3, "abc"], ["hola", "hola", "de"], ["hola", 2, 3, "abc", "de"]), #Dominio, Estructura
    (7, [1,1,2,2,3,3], [], [1,2,3]),   #Orden (de parametros), Estructura
    (8, [3,4,5,6,6], [3,4,5,6,6], [3,4,5,6]), #Orden (duplicados al final de la lista)
    ])
    
    def test_union(testcase, input1, input2, output):
>       assert union(input1, input2) == output,\
               "caso {0}".format(testcase)
E       AssertionError: caso 1
E       assert [] == ()
E         Use -v to get the full diff

union_test.py:23: AssertionError
____________________ test_union[4-input13-input23-output3] _____________________

testcase = 4, input1 = [1, 1], input2 = [], output = [1]

    @pytest.mark.parametrize("testcase, input1, input2, output",[
    (1, [], [], ()),   #Cardinalidad
    (2, [], [1,2,3], [1,2,3]),   #Cardinalidad
    (3, [1,2,3], [], [1,2,3]),   #Cardinalidad
    (4, [1,1], [], [1]),   #Cardinalidad
    (5, [], [1,1], [1]),   #Cardinalidad
    (6, ["hola", 2, 3, "abc"], ["hola", "hola", "de"], ["hola", 2, 3, "abc", "de"]), #Dominio, Estructura
    (7, [1,1,2,2,3,3], [], [1,2,3]),   #Orden (de parametros), Estructura
    (8, [3,4,5,6,6], [3,4,5,6,6], [3,4,5,6]), #Orden (duplicados al final de la lista)
    ])
    
    def test_union(testcase, input1, input2, output):
>       assert union(input1, input2) == output,\
               "caso {0}".format(testcase)
E       AssertionError: caso 4
E       assert [1, 1] == [1]
E         Left contains one more item: 1
E         Use -v to get the full diff

union_test.py:23: AssertionError
____________________ test_union[7-input16-input26-output6] _____________________

testcase = 7, input1 = [1, 1, 2, 2, 3, 3], input2 = [], output = [1, 2, 3]

    @pytest.mark.parametrize("testcase, input1, input2, output",[
    (1, [], [], ()),   #Cardinalidad
    (2, [], [1,2,3], [1,2,3]),   #Cardinalidad
    (3, [1,2,3], [], [1,2,3]),   #Cardinalidad
    (4, [1,1], [], [1]),   #Cardinalidad
    (5, [], [1,1], [1]),   #Cardinalidad
    (6, ["hola", 2, 3, "abc"], ["hola", "hola", "de"], ["hola", 2, 3, "abc", "de"]), #Dominio, Estructura
    (7, [1,1,2,2,3,3], [], [1,2,3]),   #Orden (de parametros), Estructura
    (8, [3,4,5,6,6], [3,4,5,6,6], [3,4,5,6]), #Orden (duplicados al final de la lista)
    ])
    
    def test_union(testcase, input1, input2, output):
>       assert union(input1, input2) == output,\
               "caso {0}".format(testcase)
E       AssertionError: caso 7
E       assert [1, 1, 2, 2, 3, 3] == [1, 2, 3]
E         At index 1 diff: 1 != 2
E         Left contains 3 more items, first extra item: 2
E         Use -v to get the full diff

union_test.py:23: AssertionError
____________________ test_union[8-input17-input27-output7] _____________________

testcase = 8, input1 = [3, 4, 5, 6, 6], input2 = [3, 4, 5, 6, 6]
output = [3, 4, 5, 6]

    @pytest.mark.parametrize("testcase, input1, input2, output",[
    (1, [], [], ()),   #Cardinalidad
    (2, [], [1,2,3], [1,2,3]),   #Cardinalidad
    (3, [1,2,3], [], [1,2,3]),   #Cardinalidad
    (4, [1,1], [], [1]),   #Cardinalidad
    (5, [], [1,1], [1]),   #Cardinalidad
    (6, ["hola", 2, 3, "abc"], ["hola", "hola", "de"], ["hola", 2, 3, "abc", "de"]), #Dominio, Estructura
    (7, [1,1,2,2,3,3], [], [1,2,3]),   #Orden (de parametros), Estructura
    (8, [3,4,5,6,6], [3,4,5,6,6], [3,4,5,6]), #Orden (duplicados al final de la lista)
    ])
    
    def test_union(testcase, input1, input2, output):
>       assert union(input1, input2) == output,\
               "caso {0}".format(testcase)
E       AssertionError: caso 8
E       assert [3, 4, 5, 6, 6] == [3, 4, 5, 6]
E         Left contains one more item: 6
E         Use -v to get the full diff

union_test.py:23: AssertionError
=========================== short test summary info ============================
FAILED union_test.py::test_union[1-input10-input20-output0] - AssertionError:...
FAILED union_test.py::test_union[4-input13-input23-output3] - AssertionError:...
FAILED union_test.py::test_union[7-input16-input26-output6] - AssertionError:...
FAILED union_test.py::test_union[8-input17-input27-output7] - AssertionError:...
========================= 4 failed, 4 passed in 0.07s ==========================