Skip to content

test_movielens_loading is a bad test #5

Description

@ZacharyRMcKee
def test_load_movielens_data():

    data = load_movielens_data(
        os.path.join('data',  'ml-100k')
    )

    assert (data.shape == (943, 1682))


This only checks to see if the user made the right dimension matrix, without any regard to the validity of the data in the matrix.

Why not something like

let correct_hash = some_hash_value
def test_load_movielens_data():
    data = load_movielens_data(
        os.path.join('data',  'ml-100k')
    )
    assert (some_hash_function(data) == correct_hash)

to guarantee that we parsed the data correctly (This would force the students to cast it to a particular data type (or have the test go through everything and typecast it), i.e., int, float, or string, but this seems like a small price to pay to me).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions