When Alan Tetervin looks out from his living room window, he sees his neighbor's apartment door just 14 feet away. And it makes him so angry, he says, that he's moving out of Montgomery County, searching for a place where apartments are not allowed.

"I'm going," vowed Tetervin, a normally calm man who runs a small car-importing business in Rockville. His large house is separated by a narrow driveway from the house next door. The apartment built in his neighbor's basement opens onto the driveway, and Tetervin said it's a safety hazard and a nuisance.

"I went nuts," he said. "I had been so totally invaded."

Tetervin is not alone. The little apartments that people add to their houses or make by converting part of the house to an apartment -- sometimes called "granny flats" -- seem innocent enough, but until December 1983 they were illegal. Since the county legalized them in an effort to bring them under government control, the apartments have been raising tempers, and pitting neighbor against neighbor.

"It's a dreadful state of affairs," complained former Glen Echo mayor Frank Corder, who protested to authorities about several accessory apartments, as they are officially known. "Those who value the single-family character of our neighborhood are just hamstrung. There's nowhere we can go."

Supporters of the accessory apartments insist they are a valuable resource as the county seeks to ease its housing shortage. Lawyer William C. Jackson, who owns the apartment that angers Tetervin, said his apartment gives him a badly needed $280 a month and gives his tenant -- a young county worker saving money to go to nursing school -- an inexpensive place to live.

"It's really been a boon for her," he said. "It's inexpensive and it's nice, yet she can save money and not have the problems that you have in high-rises."

But Corder and other opponents of accessory apartments said such apartments bring transients into stable neighborhoods, use up valuable parking spaces on narrow streets and often provide inadequate, unsafe housing.

Since such apartments were legalized, they charge, county restrictions on lot size, window size, ownership, parking and application times have been weakened or ignored. County lawyers said they agree with critics that code enforcement officers have been following written guidelines that are less stringent than the county's building codes -- a matter they said they are examining.

Defenders of the apartment program, however, said many of the restrictions in the codes were not necessary. "Many of these things were real nice apartments," chief of code inspection Melvin E. Tull said. "So we changed the law." Tull said county laws, backed by inspections, still ensure that substandard apartments will be eliminated.

By the end of December, the latest date for which statistics are available, 81 applications in the county had been approved, 12 denied and 123 were still pending -- figures leading critics to charge that apartments are being approved almost automatically. Residents seeking a license for their accessory apartments must file applications and be approved by the county's Board of Appeals, which handles zoning exemptions. Neighbors critical of the apartment may lodge protests with the board.

Most of the apartments that have been approved were in inner-Beltway areas: 29 in Bethesda and Chevy Chase, 33 in Silver Spring and Rockville, 14 in Wheaton and only five in the rest of the county.

"In terms of the numbers, it's going great guns," said Tull, who noted that Fairfax County has received just one application since it embarked on a much more limited accessory apartment program last year.

Marilyn Piety, president of the Allied Civic Group, an organization of about 50 civic associations in eastern Montgomery County, said she is convinced the program was out of control from the time it started. "It became clear they were approving anything that came in the door."

The Allied Civic Group recently filed suit against the county in a test case over an accessory apartment in Silver Spring, charging that it is unsafe, that regulations were not enforced and that the Board of Appeals did not follow proper legal procedures.

County Councilman William E. Hanna Jr., who sponsored the accessory apartment law, attacks its opponents vigorously. "It's a big success story," he said. He complained that the apartment opponents have a fear of "undesirables." While accessory apartment dwellers are likely to be less prosperous than their neighbors, "there's nothing wrong with being poor," he said.

Responds Piety, "Just because people are poor and need housing . . . that's no reason to give people firetraps, no reason to put them in substandard, unsafe housing."

Tull said his inspectors have been busy until recently inspecting apartments for which applications have been made. Now, he said, they will devote more time to finding unlicensed apartments and taking action against them.

Council member Rose Crenca, Piety and other critics complain that the county Board of Appeals, which decides individual applications, has been guilty of bad judgment. Doris Lipschitz, president of the board, refused to discuss the accusations.

Among cases they cite:

* The board of appeals approved an accessory apartment on Dowlais Drive near Rockville, declaring that two off-street parking spaces were provided. Photographs submitted by the applicant clearly show one car filling the only parking space and a second car parked on the lawn.

* In another case, the board approved an attic apartment on Maple Avenue in Takoma Park, although it lacked the separate entrance required by law. Case records showed the owners were "opposed to making this change." Inspectors pointed out the oversight a few days after the apartment was approved; it was noted in the records, but the approval remained intact.

"Those are precisely the kinds of apartments we think ought not to be continued," said Carlton Iddings, a city councilman from Takoma Park, which objected to the attic apartment.

Takoma Park officials, who unsuccessfully tried to help Tetervin in his efforts, are particularly worried about accessory apartments. A survey in the late 1970s showed there were almost 200 illegal apartments in an area less than a mile square. The city successfully sued the county, demanding it enforce its ban on accessory apartments. Hanna's bill followed.

"On paper it makes sense," said council member Rose Crenca, who opposed Hanna's bill and says the restrictions it provided are not being enforced. "In actual practice, from what I have seen, it causes chaos and less than acceptable living conditions."

But Ferrara, the county's housing director, insists the program has "brought a number of illegal acccessory apartments -- that existed, evidently, for a long time in the county -- under some form of control."