What grade are you in? I know most schools allow I believe 11th and 12th graders (Sometimes earlier) to take AP courses at community colleges if you show that you have the knowledge to do so.
As for testing out of a college course I am not sure, first you would probably need to be in AP courses first then talk to your professor about testing out of the class. Sometimes they will allow it sometimes they won't.
So really we can't answer much for you. So you best bet would be to talk to your schools principal about AP courses and then if you qualify talk to the community college about testing out of courses.
Most likely not, though there is certain cases where people have though they usually were geniuses and held a 4.0+ GPA and showed exceptional skills. Like I said talk to your principal and he should know. Though I wouldn't get your hopes up if you are still in middle school.
My high school doesn't have a computer science class. I figured that at most computer science classes they teach some design, theory, java, python, maybe some computer architecture, all stuff that I can easily learn. That is why I wish I could just go and take a test for the credits, but it looks like that isn't happening.
I also don't feel like waking up early to take the train to community college to learn stuff I already know or can easily self teach.