“I think that for a news organization to just go on this type of random fishing expedition, there has to be a really good journalistic purpose,” said Bob Steele, a professor of journalism ethics at DePauw University. “There has to be some reason that you’re doing that, that you are testing something in particular based on some sort of evidence other than just, ‘school security is a problem in our country.’ ”

Covertly testing the public defense structure has essentially become a tradition for reporters. After the Sept. 11 attacks, several outlets tried to sneak banned items through airport security lines. After the Oklahoma City bombing in 1995, a Tampa television station carried out the ill-conceived stunt of parking a Ryder truck in front of a federal building and walking away. In 2011, a newspaper parked a car at a spot considered potentially vulnerable near the Port Authority bus terminal in New York City, to test the police response.

The episodes often do not end smoothly. The Tampa reporter was detained, questioned and scolded by federal agents before being released. In Fargo, N.D., a correspondent who entered a school clandestinely in December was investigated for trespassing but avoided charges when her station agreed to keep her away from school-related news coverage for 90 days.

But some journalists contend that the news value of covert reporting outweighs the potential downsides. The story that was broadcast during the “Today” show in December served as a warning to parents that they should become aware of what is going on in their children’s schools, said Alexandra Wallace, senior vice president of NBC News. In that news package, a reporter visited five schools in the New York area and was able to get into one without being stopped by any security guards or school staff.

“I don’t know how you see what the truth is if you don’t go in that way,” Ms. Wallace said, referring to the hidden camera technique. “The moment you show up with a big camera, things look a lot better.”

Ms. Wallace, who has two school-age children, says she and other parents regularly think about school safety precautions. Indeed, news outlets often portray themselves as valuable members of the community in framing their undercover reports. Jeff Rossen, who reported the “Today” show piece, opened by saying that his daughter was in elementary school, “so this really hits home for me.”

Al Tompkins, the senior faculty for broadcasting and online at the Poynter Institute, said that this approach missed the mark.