Swarm is book one in the Star Force Series. This is an alien invasion story with a twist. Humans are being recruited by one alien force to fight another. If you pass the recruiting tests you can be in charge of your own space ship. Fail and...well you don't want to fail.
The hero of this book is Kyle Riggs, a professor of computer science. He passes the tests and helps lead earth in a battle against a robot horde who wants to strip our world of all resources. But what price will humans in the Star Force pay to save our planet? Highly recommended.