Most of the projects I've worked on required a connector for debugging, programming binary files to a memory, and testing purposes, among other things. The common solution is to solder a connector to the board, usually having around 6 to 10 pins, including UART, JTAG, sometimes SPI or I2C, and power connections.
However, it's important to note that this connector won't be utilized in the final design. This leads to a change on bill of materials (BOM) to remove the connector. If testing is necessary after manufacturing, the connector will have to be soldered again, which can be time-consuming and might seem wasteful. Additionally, the mechanical aspects of the design might not be ready to accommodate this component, requiring the connector to be unsoldered before reusing the board.
A simple yet elegant solution I came across is to incorporate a footprint on the PCB, usually positioned along the border, and establish a direct connection to a debug board. This approach still requires some space for the pins, but it eliminates the need to alter BOMs or perform soldering, ultimately speeding up the testing process.
One type of border connector that can be used is the combicom series from Phoenix Contacts. For this solution, you need to have the same thickness of the board as described on the component's datasheet:
Another alternative is using a cable with a connector from Tag-Connect, which can also be made in-house.