code-quality

Ping Pong Pair Programming

An ExtremeProgrammingPractice in which two engineers participate in one development effort at one workstation. Each member performs the action the other is not currently doing.

Ping Pong Pair Programming

Pair Programming

Pair Programming Pair programming is an extreme programming practice in which two engineers participate in one development effort at one workstation. Each member performs the action the other is not currently doing.

Ping Pong Pattern

This is an example flow for ping pong pair programming:

  • A writes a new test and sees that it fails.
  • B implements the code needed to pass the test.
  • B writes the next test and sees that it fails.
  • A implements the code needed to pass the test.

Ping Pong Pattern as tool to practice TDD

I think Ping Pong pair programming can be most effectively used to learn TDD. Main challenge faced by any developer while learning TDD is his need to re-orient the way he solves problem. For TDD one has to analyse what to test rather than how to fix the problem.

Applying ping pong pattern, one developer will write test cases and push it in one branch, his partner will pull that and test branch and write code to pass the test. Then the one who wrote test can verify/qa the feature.

That’s only half cycle of ping pong yet.
Full cycle will go like: each developer will write test for their partners. They switch the feature and write code to pass the test cases.

Developing in this way also helps everyone in the team have better overall understanding of the software.

Press Esc to return to the article
About the author

Prakash Poudel Sharma

Independent product manager & agentic engineering consultant

I'm an independent product manager, founder, and software builder based in Kathmandu. I help teams make product decisions and adopt agentic software development, drawing on over a decade of building software. I write about product thinking, engineering with AI, and hands-on experiments.

Keep reading

More on this

Join the conversation0 comments

What did you take away?

Thoughts, pushback, or a story of your own? Drop a reply below — I read every one.

Comments are powered by Disqus. By posting you agree to theirterms.

0:000:00