a discussion on automatic programming

Post on 18-Dec-2014

385 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

"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

A Discussion onAutomatic Programming

Corey A. SpitzerBarCamp Omaha

August, 2008

Automatic Programming?

"What would you say... you do here?"

•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

Scaffolding

Model Driven Architecture

Documentation Generation

Documentation Generation

Round-trip Engineering

Natural Language Programming

Metafor

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.

My Recipe

public abstract class Function { handleActionFromUI(String action) {

 

  // run this function Collection returnCollection = performAction(action);

  return returnCollection; }

public abstract Collection performAction(String action);}

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);}

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);}

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);}

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);}

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);}

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{ ...}

But wait... There's more!

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

top related