Service

1. Refactor the findPort function: clearly separate the finding logic for int type and string type

2. Refactor the findPort test: use table driven test approach

You can use 0 as a sentinel if you want