A high-spirited Sen. Edward M. Kennedy, buoyed by Tuesday's slim victory in the Pennslyvania presidential primary, plunged yesterday into campaigning on the streets of Washington with campaign aides looking forward to the District of Columbia's May 6 primary as an important test of his strength among blacks.

As part of a full morning of activities highlighting his support of programs for the elderly, a grinning Kennedy took his message ot the Roosevelt apartment complex for senior citizens on 16th Street NW.

Kennedy told the receptive crowd of more than 150 residents, most of them black, that increased Social Security benefits, health care, and housing assistance for the elderly should not be lost to government budget cuts.

"I think we can battle the problems of inflation more fairly than on the backs of the elderly people of this nation," Kennedy said. "Senior citizens should be entitled to live in peace, dignity and security during their golden years."

Earlier, Kennedy took much the same message to a conference of senior citizens' groups sponsored by the National Council on the Aging at the Hyatt Regency Hotel on Capitol Hill.

Kennedy indicated that "quality of life" issues including treatment of the elderly, would be a focus of his Washington campaign.

Kennedy and President Carter are vying for 19 delegates to the Democratic National Convention in the May 6 primary, 13 of whom will be chosen in the primary. The importance of the contest seemed to be fading in recent months as Kennedy lost a string of primaries to Carter in other states, but Kennedy's slim triumph in Pennsylvania appears to have made the D.C. primary a more significant race. p

More than three-fourths of the city's registered voters are Democrats, and more than three-fourths of the city's Democrats are black.

Campaign strategists for both Kennedy and President Carter have acknowledged that the D.C. primary may provide an important indication of what black voters are thinking.

"I think it will be a very good gauge," said Anita Bonds, Kennedy's District of Columbia campaign coordinator. "A lot of black people in urban areas look to D.C. for guidance."

Bonds said she believed inflation would be the biggest issue in the local campaign, and said the Kennedy organization is making an effort to reach "the alert, liberal voter who is concerned about the all-mighty pocketbook."

Bonds, who was deputy director of Mayor Marion Barry's successful 1978 campaign, said she expects 45,000 of Washington's nearly 200,000 registered Democrats to vote in the primary.

Only around 33,000 persons voted in the 1976 D.C. Democratic primary. Bonds said she anticipated a larger turnout because of the controversial referendum to legalize gambling that in on this year's ballot.

Bonds said the Kennedy campaign has the most active workers in Wards 1 (Adams-Morgan, Mount Pleasant, and LeDroit Park), 2 (Dupont Circle, Shaw, Foggy Bottom and Southwest) and 5 (most of Northeast Washington west of the Anacostia River).

Ward 1 has a large number of voters who are young and liberal, while in Ward 2, the prominent political force is the city's gay community, whose leading political organization already has endorsed the Kennedy campaign.

In Ward 5, Kennedy has the support of some key community leaders, but also is expected to do well there because Del. Walter E. Fauntroy, who has endorsed the Massachusetts senator's campaign, is believed to have strong support in the ward.

Jannette Hoston Harris, Carter's campaign coordinator, said the Carter forces plan to concentrate their efforts in Words 3, 4, 5 and 7. Voter registration and turnout usually are highest in those wards.

Ward 3 is the mostly middle-class and largely white area of the city west of Rock Creek Park. Wards 4, 5 and 7 are the predominately black outer ring of the District of Columbia stretching from the eastern boundary of Rock Creek Park to Anacosta in Far Southeast.

She said the Carter campaign has not developed a profile of the typical Carter voter because issue will bring a cross-section of citizens to the polls who might normally have not turned out.

"The little man and the little woman are going to come out to vote one way or the other on gambling," Harris said. "Church people will come out. It won't necessarily just be the people who vote on a regular basis."