Code Quality

Bug #837154 reported by Joseph Cassman
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mu-chess
Fix Released
High
Unassigned

Bug Description

Need to improve the confidence in the quality of the code. Its accuracy. In particular need to understand assumptions throughout the code. Add comments, function and class contracts, and runtime checks where helpful.

description: updated
Revision history for this message
Joseph Cassman (joichiro-deactivatedaccount) wrote :

As of revision 62 FEN deserialization (i.e. board setup) and move generation are much more reliable. In particular, in the last couple of revisions I have been able to update the code to determine and keep track of which side is in-check. This will eventually effect move generation by determining the algorithm to use (i.e. get-out-of-check versus normal movegen). At the moment, the information is used to analyze move legality.
I am working on an idea to generate an HTML page to show visually the results of movegen. I want to see a board representation of the result of making each move as opposed to just seeing the SAN encoded move text or the FEN encoding of the board. This should make tracking down of elusive bugs much easier. We'll see how it works out.
Overall, most of the code has contracts. I duplicated the contract preconditions using Debug.Assert statements to make it easier to use them in current IDE's.
I cannot see any big changes to the code architecture for this branch. Unless testing shows otherwise I am going to finish it with trying to get movegen on-line.

tags: added: fifteen-twelve
removed: qa
Revision history for this message
Joseph Cassman (joichiro-deactivatedaccount) wrote :

As of revision {82} the HTML generation for move-gen verification is working. The program in [RunMoveGenTestProgram] will take a FEN string and then output a web page that shows all of the boards that result from move generated from this position.

The move-gen code still needs to be improved for cases where a king is in-check. It is a brute-force algorithm. But it could be trimmed up a bit for performance. Right now focusing on accuracy.

Revision history for this message
Joseph Cassman (joichiro-deactivatedaccount) wrote :

Merged into trunk.

Changed in mu-chess:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.