问题
What I'm trying to do is test a Swift file frequently after making tiny changes to the file. The file may contain one or more structs and classes.
I don't care about a concept of an "app" because this is purely an academic exercise to practice some new concepts I've learned. I just want to test the file and don't care about the app and anything related to the app.
You may be asking why? Speed. I want it to be really fast to test, right now it takes a few seconds for the most trivial example. I see it does a lot of work to build the targets:

回答1:
You should try a Swift Playground.
Here is the description at developer.apple.com/swift:
Interactive Playgrounds
Playgrounds make writing Swift code incredibly simple and fun. Type a line of code and the result appears immediately. If your code runs over time, for instance through a loop, you can watch its progress in the timeline assistant. The timeline displays variables in a graph, draws each step when composing a view, and can play an animated SpriteKit scene. When you’ve perfected your code in the playground, simply move that code into your project. Some uses for playgrounds include:
Design a new algorithm, watching its results every step of the way
Create new tests, verifying they work before promoting into your test suite
Experiment with new APIs to hone your Swift coding skills
来源:https://stackoverflow.com/questions/28128169/how-can-i-test-swift-files-in-xcode-using-xctest-without-having-to-build-the-ent