GI++ == Focused Auto Programming? Robert Feldt Chalmers University - - PowerPoint PPT Presentation

gi focused auto programming
SMART_READER_LITE
LIVE PREVIEW

GI++ == Focused Auto Programming? Robert Feldt Chalmers University - - PowerPoint PPT Presentation

GI++ == Focused Auto Programming? Robert Feldt Chalmers University of Technology, Sweden at the COW-50, UCL, London, 2017-01-31 @drfeldt One view of SBSE: Ever-expanding Success! A contrarian view of SBSE: Not quite there yet A contrarian


slide-1
SLIDE 1

GI++ == Focused Auto Programming?

Robert Feldt

Chalmers University of Technology, Sweden

at the COW-50, UCL, London, 2017-01-31

@drfeldt

slide-2
SLIDE 2

One view of SBSE: Ever-expanding Success!

slide-3
SLIDE 3

A contrarian view of SBSE: Not quite there yet…

slide-4
SLIDE 4

A contrarian view of SBSE: Not quite there yet…

slide-5
SLIDE 5

A contrarian view of SBSE: Not quite there yet…

slide-6
SLIDE 6

A contrarian view of SBSE: Not quite there yet…

"Evolution is the natural way to program” - Tom Ray

slide-7
SLIDE 7

A contrarian view of SBSE: Not quite there yet…

"I would rather fly on a plane running software evolved by a program like this, than fly on a plane running software I wrote myself," says Hillis, programmer extraordinaire.

slide-8
SLIDE 8

Of course it all started much earlier (with Turing)… ;)

[Koza2010] in GPEM Anniversary issue

slide-9
SLIDE 9

Some common GP/SBSE “cop outs”

slide-10
SLIDE 10

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
slide-11
SLIDE 11

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
slide-12
SLIDE 12

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
slide-13
SLIDE 13

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
  • Focus on non-mainstream/obscure languages /

processing formalisms where humans (currently) have less experience

slide-14
SLIDE 14

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
  • Focus on non-mainstream/obscure languages /

processing formalisms where humans (currently) have less experience

  • Evolve test data rather than programs
slide-15
SLIDE 15

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
  • Focus on non-mainstream/obscure languages /

processing formalisms where humans (currently) have less experience

  • Evolve test data rather than programs
  • Evolve test cases and not programs
slide-16
SLIDE 16

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
  • Focus on non-mainstream/obscure languages /

processing formalisms where humans (currently) have less experience

  • Evolve test data rather than programs
  • Evolve test cases and not programs
  • Requiring lots and lots of example Input/Outputs
slide-17
SLIDE 17

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
  • Focus on non-mainstream/obscure languages /

processing formalisms where humans (currently) have less experience

  • Evolve test data rather than programs
  • Evolve test cases and not programs
  • Requiring lots and lots of example Input/Outputs
slide-18
SLIDE 18

Some common GP/SBSE “cop outs”

  • Tune only constants/numbers in fixed program
  • Delete/remix existing code
  • Focus on (minimal) interfaces between existing codes
  • Focus on non-mainstream/obscure languages /

processing formalisms where humans (currently) have less experience

  • Evolve test data rather than programs
  • Evolve test cases and not programs
  • Requiring lots and lots of example Input/Outputs

Clear goal, small search space, less/short structure

slide-19
SLIDE 19

A continuum of Automated Programming

slide-20
SLIDE 20

A continuum of Automated Programming

Complexity Time

slide-21
SLIDE 21

A continuum of Automated Programming

Complexity Time

GP

slide-22
SLIDE 22

A continuum of Automated Programming

Complexity Time

GP AP?

slide-23
SLIDE 23

A continuum of Automated Programming

Complexity Time

GP AP? AP!

slide-24
SLIDE 24

A continuum of Automated Programming

Complexity Time

GP AP? AP! GI!?

slide-25
SLIDE 25

A continuum of Automated Programming

Complexity Time

GP AP? AP! GI!?

Focused AP!?

slide-26
SLIDE 26

Focused Automated Programming

slide-27
SLIDE 27

Focused Automated Programming

  • I propose we should study FAP! aka…
slide-28
SLIDE 28

Focused Automated Programming

  • I propose we should study FAP! aka…
  • Domain-specific Automated Programming (DAP)
slide-29
SLIDE 29

Focused Automated Programming

  • I propose we should study FAP! aka…
  • Domain-specific Automated Programming (DAP)
  • Task-specific Automated Programming (TAP)
slide-30
SLIDE 30

Focused Automated Programming

  • I propose we should study FAP! aka…
  • Domain-specific Automated Programming (DAP)
  • Task-specific Automated Programming (TAP)
  • Defined as: “Focused application of search and
  • ptimisation to create/adapt/tune (parts of) program

code during its development, setup and/or execution”

slide-31
SLIDE 31

Focused Automated Programming

  • I propose we should study FAP! aka…
  • Domain-specific Automated Programming (DAP)
  • Task-specific Automated Programming (TAP)
  • Defined as: “Focused application of search and
  • ptimisation to create/adapt/tune (parts of) program

code during its development, setup and/or execution”

  • Focused here essentially means “human-guided”, i.e.

it is a hybrid/interactive development philosophy

slide-32
SLIDE 32

Focused Automated Programming

  • I propose we should study FAP! aka…
  • Domain-specific Automated Programming (DAP)
  • Task-specific Automated Programming (TAP)
  • Defined as: “Focused application of search and
  • ptimisation to create/adapt/tune (parts of) program

code during its development, setup and/or execution”

  • Focused here essentially means “human-guided”, i.e.

it is a hybrid/interactive development philosophy

  • => we need ideas, intuition and methods/processes

for how to use search/optimisation more actively in the software development process

slide-33
SLIDE 33

Example: Web extraction library

slide-34
SLIDE 34

Example: Web extraction library

slide-35
SLIDE 35

Example: Web extraction library

{ “name”: “V Basili”, “citations”: 33501, “h-index”: 82 }

slide-36
SLIDE 36

Web extraction, traditional solution vs AdaptiLib

slide-37
SLIDE 37

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

slide-38
SLIDE 38

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

slide-39
SLIDE 39

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib

slide-40
SLIDE 40

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib Regex Lib

slide-41
SLIDE 41

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib Regex Lib

+

slide-42
SLIDE 42

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib Regex Lib

+

Custom code

slide-43
SLIDE 43

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib Regex Lib

+

Custom code AWE Lib

slide-44
SLIDE 44

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib Regex Lib

+

Custom code AWE Lib

+

slide-45
SLIDE 45

Web extraction, traditional solution vs AdaptiLib

WebGet Lib

+

XML Parser Lib Regex Lib

+

Custom code AWE Lib

+

Examples

slide-46
SLIDE 46

Adaptive Libraries

slide-47
SLIDE 47

Adaptive Libraries

  • A normal library (lib):
slide-48
SLIDE 48

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
slide-49
SLIDE 49

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
slide-50
SLIDE 50

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
slide-51
SLIDE 51

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
slide-52
SLIDE 52

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
  • But only 1 above is directly useable without a human
slide-53
SLIDE 53

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
  • But only 1 above is directly useable without a human
  • 2-4 requires a human to assemble solution based on text
slide-54
SLIDE 54

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
  • But only 1 above is directly useable without a human
  • 2-4 requires a human to assemble solution based on text
  • Adaptive libraries (AdaptiLibs):
slide-55
SLIDE 55

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
  • But only 1 above is directly useable without a human
  • 2-4 requires a human to assemble solution based on text
  • Adaptive libraries (AdaptiLibs):
  • 1. Still has basic “atoms” = functions to be called
slide-56
SLIDE 56

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
  • But only 1 above is directly useable without a human
  • 2-4 requires a human to assemble solution based on text
  • Adaptive libraries (AdaptiLibs):
  • 1. Still has basic “atoms” = functions to be called
  • (2a) But also executable examples that uses atoms to

perform specific, named sequences

slide-57
SLIDE 57

Adaptive Libraries

  • A normal library (lib):
  • 1. has a number of functions that can be called
  • 2. to solve specific tasks
  • 3. has documentation to describe the functions
  • 4. and examples to understand API & how to put together
  • But only 1 above is directly useable without a human
  • 2-4 requires a human to assemble solution based on text
  • Adaptive libraries (AdaptiLibs):
  • 1. Still has basic “atoms” = functions to be called
  • (2a) But also executable examples that uses atoms to

perform specific, named sequences

  • (2b) And allow fuzzy mapping of user needs to tasks
slide-58
SLIDE 58

Example: Adaptive Web Extraction (AWE!) library, in practice

slide-59
SLIDE 59

Example: Adaptive Web Extraction (AWE!) library, in practice

examples = [ (“scholar.google.se/citations?user=B3C4aY8AAAAJ&hl=en”, {“name”: “V Basili”, “citations”: 33501, “h-index”: 82}), (“scholar.google.se/citations?user=Zj897NoAAAAJ&hl=en”, {“name”: “Lionel Briand”, “citations”: 21505, “h-index”: 69})]

slide-60
SLIDE 60

Example: Adaptive Web Extraction (AWE!) library, in practice

examples = [ (“scholar.google.se/citations?user=B3C4aY8AAAAJ&hl=en”, {“name”: “V Basili”, “citations”: 33501, “h-index”: 82}), (“scholar.google.se/citations?user=Zj897NoAAAAJ&hl=en”, {“name”: “Lionel Briand”, “citations”: 21505, “h-index”: 69})] gscholar_ex = create_extractor(examples)

slide-61
SLIDE 61

Example: Adaptive Web Extraction (AWE!) library, in practice

examples = [ (“scholar.google.se/citations?user=B3C4aY8AAAAJ&hl=en”, {“name”: “V Basili”, “citations”: 33501, “h-index”: 82}), (“scholar.google.se/citations?user=Zj897NoAAAAJ&hl=en”, {“name”: “Lionel Briand”, “citations”: 21505, “h-index”: 69})] gscholar_ex = create_extractor(examples) extract(gscholar_ex, “scholar.google.se/citations? user=CQDOm2gAAAAJ&hl=en”)

slide-62
SLIDE 62

Example: Adaptive Web Extraction (AWE!) library, in practice

examples = [ (“scholar.google.se/citations?user=B3C4aY8AAAAJ&hl=en”, {“name”: “V Basili”, “citations”: 33501, “h-index”: 82}), (“scholar.google.se/citations?user=Zj897NoAAAAJ&hl=en”, {“name”: “Lionel Briand”, “citations”: 21505, “h-index”: 69})] gscholar_ex = create_extractor(examples) extract(gscholar_ex, “scholar.google.se/citations? user=CQDOm2gAAAAJ&hl=en”) # returns: # {“name”: “Barbara Ann Kitchenham”, # “citations”: 63, # “h-index”: 154})]

slide-63
SLIDE 63

Big benefits with semantically similar task

{ “name”: “V Basili”, “citations”: 33501, “h-index”: 82 }

slide-64
SLIDE 64

Big benefits with semantically similar task

{ “name”: “V Basili”, “citations”: 33501, “h-index”: 82 }

slide-65
SLIDE 65

Big benefits with semantically similar task

{ “name”: “Victor R. Basili”, “citations”: 36839, “influential”: 322 }

Only change 2 I/O examples & re-adapt!

slide-66
SLIDE 66

GI would not help: Only semantic, not syntactic similarity

“...>Citations</a></td><td class="gsc_rsb_std">33501</ td><td class=“gsc_rsb_std”>9054</td>..." “...:{“hIndex”:51,”estimatedTotalCitationCount”:{“min": 31675,"value":36839,"max":42905,...”

slide-67
SLIDE 67

Design Rules for AdaptiLibs (so far…)

slide-68
SLIDE 68

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
slide-69
SLIDE 69

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
slide-70
SLIDE 70

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
slide-71
SLIDE 71

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
slide-72
SLIDE 72

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
slide-73
SLIDE 73

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

slide-74
SLIDE 74

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
slide-75
SLIDE 75

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
  • Feldt’s Law for Designing Lib incl. Search, consider in order:
slide-76
SLIDE 76

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
  • Feldt’s Law for Designing Lib incl. Search, consider in order:
  • 1. Deterministic / Exact (fastest, most efficient)
slide-77
SLIDE 77

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
  • Feldt’s Law for Designing Lib incl. Search, consider in order:
  • 1. Deterministic / Exact (fastest, most efficient)
  • 2. Heuristics / Approximations (order by applicability)
slide-78
SLIDE 78

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
  • Feldt’s Law for Designing Lib incl. Search, consider in order:
  • 1. Deterministic / Exact (fastest, most efficient)
  • 2. Heuristics / Approximations (order by applicability)
  • 3. Focused Search (part of solution only, then aggregate)
slide-79
SLIDE 79

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
  • Feldt’s Law for Designing Lib incl. Search, consider in order:
  • 1. Deterministic / Exact (fastest, most efficient)
  • 2. Heuristics / Approximations (order by applicability)
  • 3. Focused Search (part of solution only, then aggregate)
  • 4. Interact / Ask Developer (in adapt step)
slide-80
SLIDE 80

Design Rules for AdaptiLibs (so far…)

  • Start by defining basic “atomic” operations
  • Type conversion operations: parseToInt, parseToFloat
  • Data transformation: uppercase, lowercase, leadingcase
  • Basic data access: get_url
  • Matching: matchregexp, matchregexp_ignorecase
  • Go through concrete task from example & note how a

human solves it in as atomic steps as possible

  • Extend with atoms, and possibly (complex) atom seq.
  • Feldt’s Law for Designing Lib incl. Search, consider in order:
  • 1. Deterministic / Exact (fastest, most efficient)
  • 2. Heuristics / Approximations (order by applicability)
  • 3. Focused Search (part of solution only, then aggregate)
  • 4. Interact / Ask Developer (in adapt step)
  • 5. Full/free search (search from atoms & up, warn dev)
slide-81
SLIDE 81

Conclusions

slide-82
SLIDE 82

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

slide-83
SLIDE 83

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
slide-84
SLIDE 84

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
  • As techniques and processing power increase we will see

more practical AP

slide-85
SLIDE 85

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
  • As techniques and processing power increase we will see

more practical AP

  • But semantic similarity does not imply syntactic similarity

=> less opportunity for detailed code reuse

slide-86
SLIDE 86

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
  • As techniques and processing power increase we will see

more practical AP

  • But semantic similarity does not imply syntactic similarity

=> less opportunity for detailed code reuse

  • But we can also deliver practical AP now by hybridising it

with human intelligence and guidance

slide-87
SLIDE 87

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
  • As techniques and processing power increase we will see

more practical AP

  • But semantic similarity does not imply syntactic similarity

=> less opportunity for detailed code reuse

  • But we can also deliver practical AP now by hybridising it

with human intelligence and guidance

  • We are developing AdaptiLibs, general libraries that adapt to

I/O examples of users/developers

slide-88
SLIDE 88

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
  • As techniques and processing power increase we will see

more practical AP

  • But semantic similarity does not imply syntactic similarity

=> less opportunity for detailed code reuse

  • But we can also deliver practical AP now by hybridising it

with human intelligence and guidance

  • We are developing AdaptiLibs, general libraries that adapt to

I/O examples of users/developers

  • Combines task-driven design & experience of humans
slide-89
SLIDE 89

Conclusions

  • Despite many promises of GP & SBSE it has under

delivered on practical Automated Programming

  • Compared to other SBSE, GI comes closer to AP
  • As techniques and processing power increase we will see

more practical AP

  • But semantic similarity does not imply syntactic similarity

=> less opportunity for detailed code reuse

  • But we can also deliver practical AP now by hybridising it

with human intelligence and guidance

  • We are developing AdaptiLibs, general libraries that adapt to

I/O examples of users/developers

  • Combines task-driven design & experience of humans
  • with brute force and flexibility of search, only wh. needed
slide-90
SLIDE 90

Thank you!

robert.feldt@chalmers.se

@drfeldt

slide-91
SLIDE 91

But what about Bartoli et al?!

slide-92
SLIDE 92

But what about Bartoli et al?!