PBUnit: A Live Programming Environment for Unit Testing
Live programming environments execute programmer-provided code examples and display runtime values, helping programmers understand their code. Unit testing reduces defects and improves the quality of code and tests, but also increases development time. Combining live programming with unit testing could retain the advantages of both approaches, while addressing some of their shortcomings. We present PBUnit, a live programming environment for Python that uses unit tests as code examples. PBUnit extends Projection Boxes (an existing live programming environment) to show test results, giving more timely feedback than traditional testing tools and assisting debugging. PBUnit’s syntax for defining unit tests is concise and easy to learn. Lastly, PBUnit’s exception handling, filtering, and cross-function capabilities help it scale to larger codebases with many unit tests. These characteristics facilitate our future work: a user study to determine whether live programming can benefit unit testing and test-driven development.