mercredi 20 mars 2019

Property-based testing for a chess game

I'm trying to wrap my mind around property-based testing and chess. Currently I represent my chess game as a 2d-array and the only pieces I have implemented are pawns and knights for grokking this.

The pawn and knight represent their moves as the set of allMoves(x,y) \ invalidMoves(board,x,y). So one property I can think of is to test that allMoves(x,y) ∪ invalidMoves(board,x,y) === allMoves. But beyond that I'm not sure what else to test. I assume that I need to set up a simplified oracle model for the chess board but I'm not sure what such a model would be.

Aucun commentaire:

Enregistrer un commentaire