I use bitcoin core version 0.16.0
Can i change my bitcoin.conf file, so that i can get bitcoins in testnet from mining?
You might want to read this article written by James Loop, one of the knowledgeable people in crypto community:
https://medium.com/@lopp/how-to-solo-mine-on-bitcoin-s-testnet-6073c917b495You should be able to run the bitcoin client locally and create the blockchain only for you from scratch. This might be a good idea if you want to play with code as then you control mining, difficulty etc.