Contribute Media
A thank you to everyone who makes this possible: Read More

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

Description

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 a test-driven search engine for Python code.

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 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 (github) 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.

Improve this page