Go to content

Alessandro Amici - Test-driven code search and reuse coming to Python with pytest-nodev

Alessandro Amici - Test-driven code search and reuse coming to Python with pytest-nodev [EuroPython 2016] [22 July 2016] [Bilbao, Euskadi, Spain] (https://ep2016.europython.eu//conference/talks/test-driven-source-code-search-for-python-with-pytest-nodev) We will present the test-driven reuse (TDR) development strategy, a natural extension of test-driven development (TDD), and how to execute it with [pytest-nodev][1] a test-driven search engine for Python code. [1]: http://pytest-nodev.readthedocs.io/en/stable/quickstart.html Pytest-nodev and the other nodev tools that helps implement TDR for Python are rather new, in spite of that we will present several successful applications of the technique to more and more complex examples. ----- We will present the test-driven reuse (TDR) development strategy, a natural extension of test-driven development (TDD), and how to execute it with [pytest-nodev](http://pytest- nodev.readthedocs.io/en/stable/quickstart.html) an Open Source test- driven search engine for Python code. When developing new functionalities developers spend significant efforts searching for code to reuse, mainly via keyword-based searches, e.g. on StackOverflow and Google. Keyword-based search is effective in finding code that is explicitly designed and documented to be reused, e.g. libraries and frameworks, but typically fails to identify reusable functions and classes in the large corpus of auxiliary code of software projects. TDR aims to address the limits of keyword-based search with test- driven code search that focuses instead on code behaviour and semantics. Developing a new feature in TDR starts with the developer writing the tests that will validate candidate implementations of the desired functionality. Before writing any functional code the tests are run against all functions and classes of available projects. Any code passing the tests is presented to the developer as a candidate implementation for the target feature. [Pytest-nodev](https://github.com/nodev-io/pytest-nodev) and other nodev tools that help implement TDR for Python are newer than the JAVA counterparts, in spite of that we will present several applications of the technique to more and more complex examples.

July 17, 2016