Answers.Body: <p>I glanced at your code:</p>
  
  <ul>
  <li>You should test your code with <strong>perft</strong>. Google it if you're not sure what it is.</li>
  <li>Please make sure your code works before coding the engine search. If you unable to generate moves properly, nothing in your search will work.</li>
  <li>Consider to use an array rather than a switch statement for piece values.</li>
  <li>Consider to code your squares as an integer, not as a C++ class</li>
  <li>Consider to collapse your WHITE and BLACK implementation together. C++ template would do that for you. Please take a look at Stockfish codebase if you're unsure.</li>
  <li>I don't see you're making <strong>en passant</strong> in the code. Are you sure you have that covered?</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T02:40:33.663Z
Answers.Text: Thank you @SmallChess for your glancing .
  The third point is an performance matter right ?
  for switching the logic from enumerated BLACK and WHITE to template color why is it better 
  and yes I ignored En-passant for now (to-do).
Answers.UserDisplayName: Omar Hamed
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T04:57:10.983Z
Answers.Text: @HemedO.Khaled Very important for you to add en-passant. The performance points are good but not critical for you right now.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T12:48:09.733Z
Answers.Text: @HemedO.Khaled Please consider accepting this nice answer if you feel it has covered your main concerns.
Answers.UserDisplayName: user929304
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-01-22T02:30:51.307Z
Answers.LastActivityDate: 2019-09-21T14:08:46.997Z
Answers.LastEditDate: 2019-09-21T14:08:46.997Z
Answers.UserDisplayName: SmallChess
Answers.Body: <p>Is there a good way to test an incomplete chess engine? Yes, but nothing of what I'm going to say is chess-specific but really just good software development practice. Write <a href="https://en.wikipedia.org/wiki/Unit_testing" rel="nofollow noreferrer">unit tests</a>. This means test each "unit" of your program in isolation. The most common unit is a function. For example, let's say your program has a function to check whether a position is a checkmate. Set up a bunch of positions which you already know whether they are checkmate or not, call your function with each position, and verify that it returns the expected result. Keep those tests around and run them automatically as part of your development cycle. That way you'll notice immediately if you broke something by accident.</p>
  
  <p>You can even write the test before actually writing the function that you want to test. That is called <a href="https://en.wikipedia.org/wiki/Test-driven_development" rel="nofollow noreferrer">test-driven development</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-22T10:45:11.090Z
Answers.LastActivityDate: 2019-09-22T10:45:11.090Z
Answers.UserDisplayName: itub
Body: <p>As I mentioned in previous questions I'm currently following <a href="http://www.chessbin.com/" rel="nofollow noreferrer">this tutorial</a> for building my chess engine.</p>
  
  <p>The code was written in C#, but mine is in C++ and I'm in  the phase of finalizing the board / piece / moves / valid moves representations without testing the logic just making sure the syntax is ok.</p>
  
  <p>So I'm confused as to what should I do now, just continue writing without testing or there is a good way to test an incomplete chess engine?</p>
  
  <p><a href="https://github.com/hamedomarkhaled/thePrestigeChessEngine" rel="nofollow noreferrer">Here</a> you can take look at what I have done so far and your comments / recommendations are appreciated  </p>
  
Tags: <engines><software><programming>
Title: Tips for debugging and progressing a chess engine's implementation
ThreadText: # Tips for debugging and progressing a chess engine's implementation
  
  (Asked by: username_0 on 2018-01-22)
  
  As I mentioned in previous questions I'm currently following [this tutorial](http://www.chessbin.com/) for building my chess engine.
  
  The code was written in C#, but mine is in C++ and I'm in the phase of finalizing the board / piece / moves / valid moves representations without testing the logic just making sure the syntax is ok.
  
  So I'm confused as to what should I do now, just continue writing without testing or there is a good way to test an incomplete chess engine?
  
  [Here](https://github.com/hamedomarkhaled/thePrestigeChessEngine) you can take look at what I have done so far and your comments / recommendations are appreciated
  
  **Tags:** engines, software, programming
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-01-22. Score: 3 | Accepted answer
  
  I glanced at your code:
  
  * You should test your code with **perft**. Google it if you're not sure what it is.
  * Please make sure your code works before coding the engine search. If you unable to generate moves properly, nothing in your search will work.
  * Consider to use an array rather than a switch statement for piece values.
  * Consider to code your squares as an integer, not as a C++ class
  * Consider to collapse your WHITE and BLACK implementation together. C++ template would do that for you. Please take a look at Stockfish codebase if you're unsure.
  * I don't see you're making **en passant** in the code. Are you sure you have that covered?
  
  > **Comments:**
  > **username_0**: Thank you @username_1 for your glancing . The third point is an performance matter right ? for switching the logic from enumerated BLACK and WHITE to template color why is it better  and yes I ignored En-passant for now (to-do).  
  > **username_1**: @HemedO.Khaled Very important for you to add en-passant. The performance points are good but not critical for you right now.  
  > **username_2**: @HemedO.Khaled Please consider accepting this nice answer if you feel it has covered your main concerns.  
  
  ---
  
  ### Answer by username_3 on 2019-09-22. Score: 1
  
  Is there a good way to test an incomplete chess engine? Yes, but nothing of what I'm going to say is chess-specific but really just good software development practice. Write [unit tests](https://en.wikipedia.org/wiki/Unit_testing). This means test each "unit" of your program in isolation. The most common unit is a function. For example, let's say your program has a function to check whether a position is a checkmate. Set up a bunch of positions which you already know whether they are checkmate or not, call your function with each position, and verify that it returns the expected result. Keep those tests around and run them automatically as part of your development cycle. That way you'll notice immediately if you broke something by accident.
  
  You can even write the test before actually writing the function that you want to test. That is called [test-driven development](https://en.wikipedia.org/wiki/Test-driven_development).
  
  
  ---
  
  