The balding, bearded man who sat at the witness stand in federal court here for four days last week testified in terms more suited to Lee Iacocca than James Bond.

He spoke of "product" and "sales pitches," "raises" and "money flow" as he testified against a man he called his best friend, retired Navy communications expert Jerry Alfred Whitworth.

But in his matter-of-fact way, at times seeming impatient at having to explain the obvious, admitted spy John Anthony Walker Jr. provided a remarkable, firsthand portrait of the espionage ring he ran like a business for nearly 18 years.

To an audience that included Whitworth's wife, the prosecutor's mother and an array of reporters and spectators in Judge John P. Vukasin Jr.'s crowded 17th-floor courtroom here, Walker described the sometimes exotic, often mundane realities of life as a Soviet spy.

He recounted meetings with his Soviet contacts in locations ranging from a Zayre department store in Northern Virginia, where he carried a Time magazine to identify himself, to a clandestine nighttime rendezvous in Casablanca, Morocco.

Most of Walker's face-to-face meetings with the Soviets were held in Vienna, Austria, where Walker said he and his Soviet contact would walk outdoors in bitter cold to avoid the risk of their conversations being bugged.

The climate was so harsh, Walker said, that he wore electrically heated socks to keep warm.

"That's so you wouldn't get cold feet on your face-to-face meetings?" Assistant U.S. Attorney William S. Farmer asked to laughter from spectators.

"That's correct," Walker replied.

Walker said he had convinced the Soviets to bring him in from the cold by arranging for a "safe house" where they could meet, "instead of walking the streets and freezing to death."

But the Norfolk private detective and retired Navy chief warrant officer never got to see the promised safe house in Czechoslovakia: He was arrested last May 20, four months before the next planned meeting.

Walker described the elaborate "procedures" for meeting and communicating with his Soviet contacts, and the extreme lengths to which he and the Soviets went to maintain secrecy.

Walker and Whitworth, for example, would discuss "spy business" outdoors, Walker said, to avoid the possibility of having the FBI listen in on their conversations with sophisticated audio devices.

Yet at the same time, Walker was amassing a pile of receipts and travel records, keeping a meticulous catalogue of his payments to Whitworth, and a detailed calendar on which he listed his planned meetings with his Soviet contacts along with dental appointments and his mother's birthday.

"This is not a spy calendar," he told Farmer, somewhat testily. "It's a planning calendar. It just happens to have spy entries on it."

Some of the security measures appeared to have backfired. In order to keep the identities of his "suppliers" secret, Walker said, the Soviets assigned each of them an initial.

But Walker said he could never remember which initial belonged to which individual, and so kept an index card listing the assignments. The card was seized by the FBI in a search of Walker's house after his arrest, along with many other records that helped build the case against him and Whitworth.

Walker's testimony included some vignettes of the personal side of espionage.

He described an emotional meeting in Vienna where his Soviet contact introduced the contact's replacement. "He was being transferred, obviously, and we were more or less friends, and he was somewhat emotional as he went off to his new duties," Walker said.

He described how spying at times interfered with his social life. Walker said he had to turn down an invitation to travel up the California coast with a woman he met at a huge wedding bash Whitworth and his wife Brenda Reis threw in 1979 to celebrate their secret marriage a few years earlier.

"That would be a definite problem, carrying microfilm around while socializing with a strange lady," said Walker, who said he had just received a "delivery" from Whitworth.

At one point, Walker said, the Soviets told him that the KWR-37 broadcast system, for which Whitworth had allegedly been supplying the daily-changing codes, had "ceased to decrypt." That meant the Soviets could no longer figure out what the Navy was saying in its supposedly secret messages.

The Soviets told Walker not to pass on the bad news to Whitworth, he said, for fear of discouraging him, as he was just getting started in espionage.

But Walker said he decided that the two Navy men, with years of communications training between them, "should be able to figure out what was going wrong." He said Whitworth "reacted with surprise" when told of the trouble and pored over technical manuals for the machines to see if there had been any design changes. "None was detected," Walker said.

Walker's testimony pointed up the ease with which he and, he said, later Whitworth, were able to photograph the codes, or "keylists," that are supposed to be the most closely guarded military secrets.

While serving as the custodian of cryptographic keying material aboard the supply ship U.S.S. Niagara Falls, Walker said, he photographed the keylists, "tossed the film in my attache case" and "simply carried it off" the ship.

Walker testified that Whitworth told him "he had convinced his wife that he was working for the United States in a secret sort of a way," Walker said. "I thought that was a good idea. At least it explained some extra money around the house."

Walker did not fool his wife, Barbara Joy Crowley Walker, who realized what her husband was doing and, he said, insisted on joining him on one "dead drop" of documents in the Washington area.

Barbara Walker has been given immunity from prosecution in order to testify against her former husband, whom she turned in to the FBI in November 1984.

"You can't keep anything from your wife," Walker said. "Every married man knows that."