April Fools 2014: The *Real* Test Driven Development (2014)

https://news.ycombinator.com/rss Hits: 4
Summary

Update: APRIL FOOLS! by Kaue Silveira Here at Google, we invest heavily in development productivity research. In fact, our TDD research group now occupies nearly an entire building of the Googleplex. The group has been working hard to minimize the development cycle time, and we’d like to share some of the amazing progress they’ve made. The Concept In the ways of old, it used to be that people wrote tests for their existing code. This was changed by TDD (Test-driven Development), where one would write the test first and then write the code to satisfy it. The TDD research group didn’t think this was enough and wanted to elevate the humble test to the next level. We are pleased to announce the Real TDD, our latest innovation in the Program Synthesis field, where you write only the tests and have the computer write the code for you! The following graph shows how the number of tests created by a small feature team grew since they started using this tool towards the end of 2013. Over the last 2 quarters, more than 89% of this team’s production code was written by the tool! See it in action: Test written by a Software Engineer: class LinkGeneratorTest(googletest.TestCase): def setUp(self): self.generator = link_generator.LinkGenerator() def testGetLinkFromIDs(self): expected = ('https://frontend.google.com/advancedSearchResults?' 's.op=ALL&s.r0.field=ID&s.r0.val=1288585+1310696+1346270+') actual = self.generator.GetLinkFromIDs(set((1346270, 1310696, 1288585))) self.assertEqual(expected, actual) Code created by our tool: import urllib class LinkGenerator(object): _URL = ( 'https://frontend.google.com/advancedSearchResults?' 's.op=ALL&s.r0.field=ID&s.r0.val=') def GetLinkFromIDs(self, ids): result = [] for id in sorted(ids): result.append('%s ' % id) return self._URL + urllib.quote_plus(''.join(result)) Note that the tool is smart enough to not generate the obvious implementation of returning a constant string, but instead it correctly abstracts and generalizes the relation ...

First seen: 2025-08-13 19:06

Last seen: 2025-08-13 22:07