On a late February morning in the editing suite of Judd Apatow’s multilevel West Los Angeles headquarters, the writer-director and editor Brent White were playing back scenes from Apatow’s new comedy, “This Is 40.”

They had test-screened cuts of the movie the previous evening at a San Fernando Valley multiplex, running two versions in separate theaters and recording the audiences’ reactions throughout.

Now White was cuing up versions A and B of a scene in which Annie Mumolo, who co-wrote the Apatow-produced “Bridesmaids” and here plays the best friend of Leslie Mann’s lead character, Debbie, describes the aftereffects of losing all feeling in a certain lower region of her body.

In one version, Mumolo cites two examples of her numbness before a punch line that involves a shower head. In the other version, she offers more and more examples before reaching the payoff. As the editor played back the scenes synced up to the test screening laugh tracks, it was clear that the audience responded more enthusiastically to version B, the one that took more time to set up the gag.

“We can actually look at the joke when we showed it this week and when we showed it (at an earlier screening) and see if we’ve either made it work better or actually hurt the joke by surrounding it with different variations of lines and stuff like that,” White said.

But as Apatow progresses as a filmmaker, his increasingly personal works have grown less reliant on pileups of jokes and gags. “This Is 40,” which opens Friday and is the fourth movie he has written and directed, explores middle-age angst — over marriage, family, career, identity and sex appeal — through the eyes of Mann’s Debbie and Paul Rudd’s Pete, characters whom they’re reprising from Apatow’s 2007 hit comedy, “Knocked Up.”

“This Is 40” is being billed as “the sort of sequel to ‘Knocked Up’ ” (the earlier film’s stars, Seth Rogen and Katherine Heigl, are absent here; Apatow felt they’d be distracting), and the Apatow-Mann family echoes are unavoidable this time.

Mann, 40, has been married to the director for 15 years. They met on the set of “The Cable Guy” (1996), which he produced and in which she co-starred, and their daughters, Maude and Iris (now 14 and 8), once again play Pete and Debbie’s children, Sadie and Charlotte.

“Nothing in the movie happened, but it is based on emotional feelings that we have that we talk about all the time,” Apatow said. “I don’t own a record label, Leslie doesn’t own a store, but I think emotionally I do spend too much time in the bathroom, I do have kind of an overbearing Jewish family that makes you want to spend most of your life in the bathroom, so we connect to some of those issues.”

Mann, who accompanied Apatow to Chicago recently for a “This Is 40” screening, said her husband first mentioned the idea to her when they were on vacation, and they discussed it on and off for a couple of years. He said his impetus was to make a movie about this period in people’s lives — its never-ending rush of demands and anxieties — rather than specifically to continue the story of the “Knocked Up” characters.

“Then just one night, literally in the middle of the night, I just thought: Oh, it’s Pete and Debbie. I could make the whole movie about Pete and Debbie,” Apatow said.

Rudd, who has appeared in several Apatow-directed and produced comedies, was brought into the process early, as well.

“We’ll talk about facets to the character or conversations or aspects or storylines, things like that,” Rudd said last week by phone from New York. “Then Judd goes and writes it out, and then we play around with it when we shoot it, too.

“They are fictional characters,” Rudd said, “but there are aspects of their relationship in the marriage that are specific to, I think probably, Judd and Leslie. There are a couple of specific things that have made their way into these movies that are from my own life.”

With Mann and Apatow both using the word “crazy” to describe Pete and Debbie’s behavior at times, the movie is willing to make its leads unsympathetic in the quest for some greater truth, if not humor.

“I like when people don’t try so hard to obsess over likability,” Apatow said. “I wanted it to be balanced. I wanted Pete and Debbie to have an equal amount of good qualities and bad qualities.”