Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A Discussion on Automatic Programming

729 views

Published on

Published in: Technology
  • Login to see the comments

  • Be the first to like this

A Discussion on Automatic Programming

  1. 1. "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
  2. 2. A Discussion on Automatic Programming Corey A. Spitzer BarCamp Omaha August, 2008
  3. 3. Automatic Programming?
  4. 4. "What would you say... you do here?"
  5. 5. •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
  6. 6. Scaffolding
  7. 7. Model Driven Architecture
  8. 8. Documentation Generation
  9. 9. Documentation Generation
  10. 10. Round-trip Engineering
  11. 11. Natural Language Programming
  12. 12. Metafor
  13. 13. To create the background: Draw the screen's box with the white color. osmosian.com's Loop. Pick a spot anywhere in the screen's box. "Plain English" 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.
  14. 14. My Recipe
  15. 15. public abstract class Function { handleActionFromUI(String action) { // run this function Collection returnCollection = performAction(action); return returnCollection; } public abstract Collection performAction(String action); }
  16. 16. 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); }
  17. 17. 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); }
  18. 18. 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); }
  19. 19. 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); }
  20. 20. 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); }
  21. 21. 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 { ... }
  22. 22. But wait... There's more!
  23. 23. Sources and Useful Links Doxygen http://www.stack.nl/~dimitri/doxygen/ Object Management Group http://www.omg.org/mda/ Code Generation Network http://www.codegeneration.net Ruby on Rails http://www.rubyonrails.org Django http://www.djangoproject.com Metafor Info http://ll4.csail.mit.edu/slides/metafor.pdf

×