a discussion on automatic programming
DESCRIPTION
TRANSCRIPT
![Page 1: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/1.jpg)
"Find a bug in a program, and fix it, and the program will work today. Show the program how to find and fix a bug, and the program will work forever."
-Oliver Selfridge
![Page 2: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/2.jpg)
A Discussion onAutomatic Programming
Corey A. SpitzerBarCamp Omaha
August, 2008
![Page 3: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/3.jpg)
Automatic Programming?
![Page 4: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/4.jpg)
"What would you say... you do here?"
![Page 5: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/5.jpg)
•Gather and document requirements•Design and document the solution•Code the framework, architecture, and/or scaffolding/plumbing•Set up storage, code data access layer (mundane persistence and CRUD stuff)•Code business logic•UI design and development•Refactor, refactor again, update docs•Debug, debug again•Tests (unit, integration, penetration, load, stress, usability, etc.)•Documentation•Deploy, get feedback•Monitor, support, perform maintenance
![Page 6: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/6.jpg)
Scaffolding
![Page 7: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/7.jpg)
Model Driven Architecture
![Page 8: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/8.jpg)
Documentation Generation
![Page 9: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/9.jpg)
Documentation Generation
![Page 10: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/10.jpg)
Round-trip Engineering
![Page 11: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/11.jpg)
Natural Language Programming
![Page 12: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/12.jpg)
Metafor
![Page 13: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/13.jpg)
osmosian.com's"Plain English"
To create the background:
Draw the screen's box with the white color.
Loop.
Pick a spot anywhere in the screen's box.
Pick a color between the lightest gray color and the white color.
Dab the color on the spot.
If a counter is past 80000, break.
If the counter is evenly divisible by 1000, refresh the screen.
Repeat.
Extract the background given the screen's box. \*dahd or Create the background from the screen. Or something.
To create a work given a URL:
Allocate memory for the work.
Put the URL into the work's URL.
To create some works given a buffer:
Destroy the works.
Put nil into the current work.
Slap a rider on the buffer.
![Page 14: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/14.jpg)
My Recipe
![Page 15: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/15.jpg)
public abstract class Function { handleActionFromUI(String action) {
// run this function Collection returnCollection = performAction(action);
return returnCollection; }
public abstract Collection performAction(String action);}
![Page 16: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/16.jpg)
public abstract class Function { handleActionFromUI(String action) { // create a unique test name
// run this function Collection returnCollection = performAction(action);
return returnCollection; }
public abstract Collection performAction(String action);}
![Page 17: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/17.jpg)
public abstract class Function { handleActionFromUI(String action) { // create a unique test name
// save the present environment and state
// run this function Collection returnCollection = performAction(action);
return returnCollection; }
public abstract Collection performAction(String action);}
![Page 18: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/18.jpg)
public abstract class Function { handleActionFromUI(String action) { // create a unique test name
// save the present environment and state
// generate code to load the present environment and state
// run this function Collection returnCollection = performAction(action);
return returnCollection; }
public abstract Collection performAction(String action);}
![Page 19: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/19.jpg)
public abstract class Function { handleActionFromUI(String action) { // create a unique test name
// save the present environment and state
// generate code to load the present environment and state // generate code to instantiate and run this function with // current inputs // run this function Collection returnCollection = performAction(action);
return returnCollection; }
public abstract Collection performAction(String action);}
![Page 20: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/20.jpg)
public abstract class Function { handleActionFromUI(String action) { // create a unique test name
// save the present environment and state
// generate code to load the present environment and state // generate code to instantiate and run this function with // current inputs // run this function Collection returnCollection = performAction(action);
// generate code to assert the output from running the test code // will be the same output as it is now return returnCollection; }
public abstract Collection performAction(String action);}
![Page 21: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/21.jpg)
public void testLoginController_login_cas_100{ loadState("login_cas_100.sql");
HashMap<String, String> output = runFunction("foo", "bar", 123);
assertEquals("blah", output.get("foo")); ...}
public void testMyController_doSomething_cas_100{ ...}
public void testMyController_doSomething_cas_101{ ...}
![Page 22: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/22.jpg)
But wait... There's more!
![Page 23: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/23.jpg)
![Page 24: A Discussion on Automatic Programming](https://reader034.vdocuments.net/reader034/viewer/2022051817/549320e0ac79593b2e8b478f/html5/thumbnails/24.jpg)
Sources and Useful LinksDoxygen
http://www.stack.nl/~dimitri/doxygen/
Object Management Grouphttp://www.omg.org/mda/
Code Generation Networkhttp://www.codegeneration.net
Ruby on Railshttp://www.rubyonrails.org
Djangohttp://www.djangoproject.com
Metafor Infohttp://ll4.csail.mit.edu/slides/metafor.pdf