Temporary PCB connections for testing
Headers are pretty cheap and make a lot of sense over a wide range of quantities, down to 1 piece. A 5 x 2 header takes up very little space, even less in 2mm pitch. The connections usually end up free of flux so they don't crud up the mating connector.  





For really high volume, you can use a fixture with spring-loaded 'pogo' pins which can be cheaper per unit, but the fixture has to be designed and manufactured. The below is one size of pogo pin, illustrating a few types of ends. Some are designed to contact 'dots' on the PCB, some to go into holes and some to contact the wire soldered through a through-hole. See this answer for more info. 



One advantage of the pogo pins is that you don't need to bring all the connections to one small area- you can put probe points anywhere on the board, and sometimes outside the finished board on the tooling strips or other sacrificial bits of PCB. 

You can get pre-wired sockets for the pogo pins which makes it really easy to maintain the fixture- when the pin gets crudded up or breaks or wears out, just plug in a new one of the correct type. 

Example fixture from here using kit parts plus some custom bits made for the board. See also the sparkfun tutorial that @Brendan linked to in the comments for budget approaches useful for small boards. 





As another option, for around 10 pins, there is the Tag-Connect set of products, which don't require a fixture, only a special footprint on the PCB with unplated holes (usually little cost). It does require a bit of PCB area and the space around it for the latches takes more if you want them to stay on by themselves. I have used them for programming connectors and they work okay. If the pins or the cable wears out, throw it out and buy another one.