Class ChessQueensAllTest

java.lang.Object
topics.backtracking.nqueens.ChessQueensAllTest

class ChessQueensAllTest extends Object

Test Suite for ChessQueensAll

Validates the exhaustive backtracking algorithm for the N-Queens problem. Employs assertions to verify the exact number of valid combinatorial arrangements across various board dimensions.

Author:
vicegd
  • Constructor Details

    • ChessQueensAllTest

      ChessQueensAllTest()
  • Method Details

    • setup

      @BeforeAll static void setup()
      Initializes context and resources prior to executing the test suite.
    • teardown

      @AfterAll static void teardown()
      Cleans up resources after the entire test suite has finished execution.
    • shouldFindTwoSolutionsOn4x4Board

      @Test void shouldFindTwoSolutionsOn4x4Board()

      Scenario: A 4x4 chessboard.

      Expected Outcome: Mathematical proofs dictate exactly 2 valid non-threatening arrangements for 4 queens.

    • shouldFindTenSolutionsOn5x5Board

      @Test void shouldFindTenSolutionsOn5x5Board()

      Scenario: A 5x5 chessboard.

      Expected Outcome: The algorithm must traverse the state space and discover exactly 10 valid arrangements.

    • shouldFindNoSolutionsOn3x3Board

      @Test void shouldFindNoSolutionsOn3x3Board()

      Scenario: A 3x3 chessboard.

      Expected Outcome: It is geometrically impossible to place 3 non-threatening queens on a 3x3 board. The result must be 0.