Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Testing the correctness of a chess program

Author: Matthias Gemuh

Date: 07:58:04 04/20/04

Go up one level in this thread


On April 20, 2004 at 10:47:09, James Murphy wrote:

>Hi,
>
>I have written a two player chess program in Java and I am in the process of
>evaluating it i.e. performing tests and measures on how well it accomplishes its
>objectives. Since one of the objectives of the program is to play chess, an
>obvious evaluation would be to porve that the program actually does play chess.
>To do this, I would have to establish some correctness properties of a
>chess-playing program (for a particular input, a certain output is exptected)
>and prove that my program holds true for them. I believe the correctness
>properties of a chess-playing program are:
>
>1) Pieces can only move and capture in certain ways; illegal moves are not
>permissible
>2) Check requires a player to move out of check
>3) Game terminations (checkmate/stalemate) should be correctly detected
>
>Can anyone suggest anymore if there are any?
>
>There are two ways to prove a chess program is correct; testing and formal
>proofs. Full testing is impractical as not every input can be tested against
>every output because it would take too long (10^38 seconds I think. Not sure if
>thats right). Therefore equivalance testing is used where we say that if a piece
>passes a move test, it will pass for a similar range of values on the chess
>board. If it fails, it will also fail for a range of values on the chessboard.
>This will therefore prove that the program is correct.
>
>To increase our confidence in these test, formal proofs could also be used. A
>formal proof requires a little more work to construct however. Does anyone have
>any advice on how to construct a formal  proof for a chess program. I have some
>idea but I'm not totally clear where to start on it. I guess I must have to
>reason about the code or something using induction perhaps. All help
>appreciated.
>
>Also if any of my reasoning above is incorrect I would also appreciate your
>corrections/additions.
>
>Thanks




Does your engine get these perfts right ?

//> r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -
//> Depth Perft(Depth) Total Nodes
//> 1               48          48
//> 2             2039        2087
//> 3           97,862      99,949
//> 4        4,085,603   4,185,552
//> 5      193,690,690 197,876,242
//> 6    8,031,647,685
//>

//> 8/PPP4k/8/8/8/8/4Kppp/8 w - -
//> Depth Perft(Depth) Total Nodes
//> 1 18 18
//> 2 290 308
//> 3 5044 5352
//> 4 89,363 94,715
//> 5 1,745,545 1,840,260
//> 6 34,336,777 36,177,037
//> 7 749,660,761 785,837,798

//> 8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - -
//> Depth Perft(Depth) Total Nodes
//> 1 14 14
//> 2 191 205
//> 3 2,812 3,017
//> 4 43,238 46,255
//> 5 674,624 720,879
//> 6 11,030,083 11,750,962
//> 7 178,633,661 190,384,623








This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.