IMPROVING PROGRAMS THROUGH SOURCE CODE TRANSFORMATIONS - - PowerPoint PPT Presentation

improving programs through source code transformations
SMART_READER_LITE
LIVE PREVIEW

IMPROVING PROGRAMS THROUGH SOURCE CODE TRANSFORMATIONS - - PowerPoint PPT Presentation

IMPROVING PROGRAMS THROUGH SOURCE CODE TRANSFORMATIONS Disserta(on Proposal Jonathan Dorn April 19, 2016 Beyond Functional Correctness So9ware development


slide-1
SLIDE 1

IMPROVING ¡PROGRAMS ¡ THROUGH ¡SOURCE ¡CODE ¡ TRANSFORMATIONS ¡

Disserta(on ¡Proposal ¡ Jonathan ¡Dorn ¡ April ¡19, ¡2016 ¡

slide-2
SLIDE 2

Beyond ¡Functional ¡Correctness ¡

  • So9ware ¡development ¡involves ¡tradeoffs. ¡
  • “Fast, ¡good, ¡or ¡cheap. ¡Pick ¡any ¡two.” ¡
  • Time ¡vs. ¡memory. ¡
  • Maintainability ¡vs. ¡efficiency. ¡
  • … ¡

2 ¡

slide-3
SLIDE 3

3 ¡

slide-4
SLIDE 4

4 ¡

slide-5
SLIDE 5

5 ¡

slide-6
SLIDE 6

6 ¡

slide-7
SLIDE 7

Non-­‑Functional ¡Properties ¡

  • “How ¡good” ¡instead ¡of ¡“what” ¡[Paech ¡2004]. ¡
  • “More” ¡or ¡“less;” ¡“higher” ¡or ¡“lower.” ¡
  • Difficult ¡to ¡reason ¡about ¡(e.g., ¡security). ¡
  • Characterize ¡implementa(ons ¡by ¡how ¡much ¡of ¡

a ¡property ¡they ¡possess. ¡

7 ¡

slide-8
SLIDE 8

Non-­‑Functional ¡Tradeoffs ¡

Visual ¡Error ¡ Run3me ¡

8 ¡

slide-9
SLIDE 9

Non-­‑Functional ¡Tradeoffs ¡

Visual ¡Error ¡ Run3me ¡

9 ¡

slide-10
SLIDE 10

Quantifying ¡Non-­‑Functionality ¡

  • Different ¡metrics ¡for ¡different ¡proper(es. ¡
  • Image ¡quality: ¡RGB ¡distance ¡(e.g., ¡L2), ¡SSIM, ¡EMD. ¡
  • Run3me: ¡seconds, ¡speedup/slowdown. ¡
  • Energy ¡efficiency: ¡joules, ¡wa_s. ¡
  • Maintainability: ¡bug ¡fix ¡(me, ¡defect ¡density. ¡
  • Correctness: ¡% ¡error, ¡accuracy, ¡precision, ¡PSNR. ¡

10 ¡

slide-11
SLIDE 11

Local ¡Changes ¡

  • Small ¡changes ¡can ¡have ¡large ¡effects. ¡
  • E.g., ¡bubble_sort(a) ¡à ¡quick_sort(a). ¡
  • Op(on ¡of ¡fine-­‑grained ¡control. ¡
  • Program ¡lines, ¡statements, ¡AST ¡nodes. ¡

11 ¡

slide-12
SLIDE 12

Proposal ¡Thesis ¡

By ¡applying ¡local ¡so6ware ¡transforma8ons, ¡we ¡ can ¡select ¡be_er ¡tradeoffs ¡between ¡non-­‑ func8onal ¡proper8es ¡of ¡exis(ng ¡so9ware ¡ ar(facts. ¡

12 ¡

slide-13
SLIDE 13

The ¡rest ¡of ¡this ¡proposal ¡

  • Overview ¡of ¡the ¡proposed ¡research ¡thrusts ¡
  • Visual ¡error ¡and ¡run(me ¡performance ¡
  • Energy ¡usage ¡
  • Coding ¡style ¡
  • Proposed ¡research ¡(meline ¡
  • Conclusion ¡

13 ¡

slide-14
SLIDE 14

The ¡rest ¡of ¡this ¡proposal ¡

  • Overview ¡of ¡the ¡proposed ¡research ¡thrusts ¡
  • Visual ¡error ¡and ¡run(me ¡performance ¡
  • Energy ¡usage ¡
  • Coding ¡style ¡
  • Proposed ¡research ¡(meline ¡
  • Conclusion ¡

14 ¡

slide-15
SLIDE 15

Computer ¡Generated ¡Imagery ¡

  • 11% ¡of ¡all ¡(ckets ¡in ¡2015 ¡

went ¡to ¡computer ¡ animated ¡movies.* ¡

  • Does ¡not ¡include ¡live ¡

movies ¡with ¡CGI. ¡

  • Video ¡games ¡topped ¡

$90B ¡in ¡2015.** ¡

15 ¡ ¡* ¡h_p://www.boxofficemojo.com/ ¡ ¡** ¡h_p://www.gamesindustry.biz/ar(cles/2015-­‑04-­‑22-­‑gaming-­‑will-­‑hit-­‑usd91-­‑5-­‑billion-­‑this-­‑year-­‑newzoo ¡

slide-16
SLIDE 16

Visual ¡Error ¡and ¡Runtime ¡Performance ¡

Visual ¡Error ¡ Run3me ¡

16 ¡

Original ¡Program ¡ Exis(ng ¡Technique ¡ Desired ¡Program ¡

slide-17
SLIDE 17

Hypothesis ¡

  • We ¡can ¡apply ¡local ¡changes ¡to ¡the ¡abstract ¡

syntax ¡tree ¡of ¡a ¡graphics ¡program ¡to ¡produce ¡ an ¡approxima(on ¡that ¡is: ¡

  • Visually ¡faithful ¡to ¡the ¡original ¡and ¡
  • Efficient ¡to ¡compute. ¡
  • Evaluate ¡both ¡image ¡quality ¡and ¡run(me. ¡

17 ¡

slide-18
SLIDE 18

Simple ¡Example ¡

18 ¡

floor

  • +

p.x p.x 0.5 return (color) floor

slide-19
SLIDE 19

Simple ¡Example ¡

19 ¡

floor

  • +

p.x p.x 0.5 return (color) floor

slide-20
SLIDE 20

Simple ¡Example ¡

20 ¡

floor

  • +

p.x p.x 0.5 return (color) floor

Before ¡ A9er ¡

slide-21
SLIDE 21

Approach ¡

  • Transforma(on: ¡Replace ¡node ¡N ¡with ¡N’. ¡
  • Determine ¡replacements ¡offline ¡(manual). ¡
  • Gene(c ¡search ¡to ¡select ¡nodes ¡to ¡replace. ¡
  • Use ¡image ¡quality ¡as ¡fitness ¡func(on. ¡

21 ¡

slide-22
SLIDE 22

Experimental ¡Setup ¡

  • Benchmarks ¡chosen ¡from ¡previous ¡work. ¡
  • Record ¡run8me ¡and ¡image ¡quality. ¡
  • Three ¡data ¡points ¡for ¡each ¡benchmark: ¡
  • 1. Original ¡program. ¡
  • 2. Baseline ¡“slower ¡but ¡less ¡error” ¡approach. ¡
  • 3. Best ¡transformed ¡variant ¡from ¡our ¡search. ¡

22 ¡

slide-23
SLIDE 23

Runtime ¡Results ¡

0 ¡ 5 ¡ 10 ¡ 15 ¡ 20 ¡ Normalized ¡Run3me ¡ Baseline ¡ Our ¡Approach ¡

23 ¡

slide-24
SLIDE 24

Image ¡Quality ¡Results ¡

0 ¡ 0.5 ¡ 1 ¡ Normalized ¡Error ¡ Baseline ¡ Our ¡Approach ¡

24 ¡

slide-25
SLIDE 25

Summary ¡

  • We ¡can ¡apply ¡local ¡changes ¡to ¡produce ¡

programs ¡that: ¡

  • Are ¡significantly ¡faster ¡than ¡the ¡baseline ¡approach, ¡
  • Have ¡less ¡error ¡than ¡the ¡original ¡program, ¡and ¡
  • O9en ¡have ¡less ¡error ¡than ¡the ¡baseline. ¡

25 ¡

slide-26
SLIDE 26

Outline ¡

  • Overview ¡of ¡the ¡proposed ¡research ¡thrusts ¡
  • Visual ¡error ¡and ¡run(me ¡performance ¡
  • Energy ¡usage ¡
  • Coding ¡style ¡
  • Proposed ¡research ¡(meline ¡
  • Conclusion ¡

26 ¡

slide-27
SLIDE 27

Data ¡Center ¡Energy ¡Use ¡

0.8% ¡ 1.5% ¡ 2.0% ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 2000 ¡ 2005 ¡ 2010 ¡ Electricity ¡Use ¡ (billion ¡kWh/year) ¡ Infrastructure ¡ Communica(ons ¡ Storage ¡ High-­‑end ¡servers ¡ Mid-­‑range ¡servers ¡ Volume ¡servers ¡

27 ¡

Percentages ¡of ¡ US ¡electricity ¡use ¡ in ¡a ¡given ¡year ¡

Reproduced ¡from ¡J. ¡Koomey. ¡Growth ¡in ¡data ¡center ¡electricity ¡use ¡2005 ¡to ¡2010. ¡ Analy(cs ¡Press, ¡Oakland, ¡CA, ¡2011. ¡ ¡

slide-28
SLIDE 28

Genetic ¡Optimization ¡Algorithm ¡

  • Local ¡changes ¡to ¡

assembly ¡code. ¡

  • Tradeoff ¡between ¡

reduced ¡energy ¡and ¡ relaxed ¡seman8cs. ¡

  • Validated ¡with ¡test ¡suite. ¡

0 ¡ 25 ¡ 50 ¡ 75 ¡ 100 ¡ blackscholes ¡ bodytrack ¡ ferret ¡ fluidanimate ¡ freqmine ¡ swap(ons ¡ vips ¡ x264 ¡ average ¡ Energy ¡Reduc3on ¡(%) ¡

28 ¡

slide-29
SLIDE 29

Genetic ¡Optimization ¡Algorithm ¡

  • Local ¡changes ¡to ¡

assembly ¡code. ¡

  • Tradeoff ¡between ¡

reduced ¡energy ¡and ¡ relaxed ¡seman8cs. ¡

  • Validated ¡with ¡test ¡suite. ¡

0 ¡ 25 ¡ 50 ¡ 75 ¡ 100 ¡ blackscholes ¡ bodytrack ¡ ferret ¡ fluidanimate ¡ freqmine ¡ swap(ons ¡ vips ¡ x264 ¡ average ¡ Energy ¡Reduc3on ¡(%) ¡

29 ¡

slide-30
SLIDE 30

Scaling ¡to ¡Larger ¡Programs ¡

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 200000 ¡ 400000 ¡ 600000 ¡ 800000 ¡ 1000000 ¡ Energy ¡Reduc3on ¡(%) ¡ Lines ¡of ¡Code ¡(Assembly) ¡

30 ¡

slide-31
SLIDE 31

Hypothesis ¡

By ¡direc(ng ¡the ¡gene(c ¡search ¡more ¡effec(vely ¡ and ¡reducing ¡the ¡search ¡space, ¡we ¡can ¡achieve ¡ larger ¡energy ¡op(miza(ons ¡faster. ¡ Evaluate ¡both ¡magnitude ¡of ¡op(miza(on ¡and ¡ search ¡(me. ¡

31 ¡

slide-32
SLIDE 32

Intuition ¡

  • Op(miza(ons ¡on ¡different ¡paths ¡through ¡the ¡

program ¡are ¡likely ¡to ¡be ¡independent. ¡

  • Combine ¡op(miza(ons ¡from ¡separate ¡searches. ¡
  • Op(miza(ons ¡on ¡frequently ¡executed ¡paths ¡

are ¡likely ¡to ¡have ¡larger ¡impact. ¡

  • Profile ¡the ¡program ¡to ¡target ¡hot ¡paths. ¡

32 ¡

slide-33
SLIDE 33

Algorithm ¡Overview ¡

33 ¡

INPUT ¡ MUTATE ¡ EVALUATE ¡FITNESS ¡ OUTPUT ¡

Eject ¡ Report ¡

slide-34
SLIDE 34

Optimizing ¡Two ¡Workloads ¡

34 ¡

INPUT ¡ MUTATE ¡ EVALUATE ¡FITNESS ¡ OUTPUT ¡

Eject ¡ Report ¡

INPUT ¡ MUTATE ¡ EVALUATE ¡FITNESS ¡ OUTPUT ¡

Eject ¡ Report ¡

slide-35
SLIDE 35

Option ¡1: ¡Share ¡Variants ¡During ¡Search ¡

35 ¡

INPUT ¡ MUTATE ¡ EVALUATE ¡FITNESS ¡ OUTPUT ¡

Eject ¡ Report ¡

INPUT ¡ OUTPUT ¡

Eject ¡ Report ¡

MUTATE ¡ EVALUATE ¡FITNESS ¡

slide-36
SLIDE 36

INPUT ¡ MUTATE ¡ EVALUATE ¡FITNESS ¡

Eject ¡ Report ¡

Option ¡2: ¡Combine ¡Best ¡After ¡Search ¡

36 ¡

INPUT ¡ MUTATE ¡ EVALUATE ¡FITNESS ¡

Eject ¡ Report ¡

OUTPUT ¡ OUTPUT ¡

slide-37
SLIDE 37

Experimental ¡Setup ¡

Benchmarks ¡

  • Collect ¡HPC ¡and ¡data ¡

center ¡benchmarks. ¡

  • Collect ¡mul(ple ¡

workloads ¡for ¡each ¡

  • benchmark. ¡

Baseline: ¡GOA ¡search ¡

  • 1. Only ¡one ¡workload. ¡
  • 2. All ¡workloads ¡in ¡single ¡

fitness ¡func(on. ¡

37 ¡

slide-38
SLIDE 38

Metrics ¡for ¡Energy ¡Optimization ¡

  • Energy ¡measured ¡at ¡the ¡wall. ¡
  • Wall ¡8me ¡before ¡best ¡variant. ¡
  • Latest ¡best ¡variant ¡if ¡combining ¡a9er ¡search. ¡
  • Fitness ¡evalua8ons ¡before ¡best ¡variant. ¡
  • Success ¡if ¡searching ¡separately ¡produces ¡larger ¡

energy ¡reduc(on ¡across ¡all ¡workloads. ¡

38 ¡

slide-39
SLIDE 39

Preliminary ¡Results ¡

0% ¡ 10% ¡ 20% ¡ 30% ¡ 40% ¡ 50% ¡ GOA ¡ combined ¡ set ¡1 ¡ set ¡0 ¡ Energy ¡Improvement ¡

39 ¡

slide-40
SLIDE 40

Outline ¡

  • Overview ¡of ¡the ¡proposed ¡research ¡thrusts ¡
  • Visual ¡error ¡and ¡run(me ¡performance ¡
  • Energy ¡usage ¡
  • Coding ¡style ¡
  • Proposed ¡research ¡(meline ¡
  • Conclusion ¡

40 ¡

slide-41
SLIDE 41

Programmer ¡Time ¡

  • Programmer ¡salaries ¡in ¡

the ¡U.S. ¡exceed ¡$100B. ¡

  • Programmers ¡spend ¡

much ¡more ¡(me ¡reading ¡ code ¡than ¡wri(ng ¡it. ¡

41 ¡

Wri(ng ¡ Modifying ¡ Understanding ¡

Reproduced ¡from ¡P. ¡Hallam. ¡What ¡do ¡programmers ¡really ¡do ¡anyway? ¡(aka ¡part ¡2 ¡of ¡the ¡yards(ck ¡saga). ¡ h_p: ¡//blogs.msdn.com/b/peterhal/archive/2006/01/04/509302.aspx. ¡Accessed: ¡2016-­‑02-­‑01. ¡ ¡

slide-42
SLIDE 42

Stylish ¡Code ¡

  • Broad ¡consensus ¡for ¡standardized ¡coding ¡style. ¡
  • Persistent ¡disagreement ¡on ¡specifics. ¡
  • E.g., ¡tabs ¡vs. ¡spaces. ¡
  • “Every ¡major ¡open ¡source ¡project ¡has ¡its ¡own ¡style ¡

guide.” ¡– ¡Google’s ¡style ¡guide. ¡

42 ¡

slide-43
SLIDE 43

for (i=0; i<n; i++) { for (j=0; j<n; j++) { … temp = a[i]; a[i] = a[j]; a[j] = temp; … } }

Beacons ¡

  • Indicate ¡likely ¡structure ¡
  • r ¡func(onality. ¡
  • Seman(c ¡or ¡syntac(c. ¡
  • May ¡vary ¡
  • Between ¡programmers, ¡
  • And ¡over ¡(me. ¡

43 ¡

slide-44
SLIDE 44

for (i=0; i<n; i++) { for (j=0; j<n; j++) { … temp = a[i]; a[i] = a[j]; a[j] = temp; … } }

Beacons ¡

  • Indicate ¡likely ¡structure ¡
  • r ¡func(onality. ¡
  • Seman(c ¡or ¡syntac(c. ¡
  • May ¡vary ¡
  • Between ¡programmers ¡
  • And ¡over ¡(me. ¡

44 ¡

Possible ¡sort ¡ Implementa(on? ¡

slide-45
SLIDE 45

for (i=0; i<n; i++) { for (j=0; j<n; j++) { … temp = a[i]; a[i] = a[j]; a[j] = temp; … } }

Beacons ¡

  • Indicate ¡likely ¡structure ¡
  • r ¡func(onality. ¡
  • Seman(c ¡or ¡syntac(c. ¡
  • May ¡vary ¡
  • Between ¡programmers, ¡
  • And ¡over ¡(me. ¡

45 ¡

End ¡of ¡scope. ¡

slide-46
SLIDE 46

ClassiSication ¡of ¡Coding ¡Style ¡

  • Typographic ¡and ¡Structural ¡[Oman ¡1988]. ¡
  • Typographic: ¡whitespace, ¡line ¡length, ¡iden(fier ¡

length, ¡layout. ¡

  • Structural: ¡modularity, ¡level ¡of ¡nes(ng, ¡control ¡and ¡

informa(on ¡flow. ¡

46 ¡

slide-47
SLIDE 47

ClassiSication ¡of ¡Coding ¡Style ¡

  • Typographic ¡and ¡Structural ¡[Oman ¡1988]. ¡
  • Typographic: ¡whitespace, ¡line ¡length, ¡iden(fier ¡

length, ¡layout. ¡

  • Structural: ¡modularity, ¡level ¡of ¡nes(ng, ¡control ¡and ¡

informa(on ¡flow. ¡

47 ¡

slide-48
SLIDE 48

Hypothesis ¡

  • We ¡can ¡apply ¡local ¡changes ¡to ¡the ¡typographic ¡

elements ¡of ¡source ¡code ¡to ¡

  • Match ¡a ¡programmer’s ¡expected ¡style ¡and ¡
  • Improve ¡their ¡understanding ¡of ¡the ¡code. ¡
  • Evaluate ¡(me ¡and ¡accuracy ¡on ¡tests ¡of ¡
  • understanding. ¡

48 ¡

slide-49
SLIDE 49

Modeling ¡Typographic ¡Style ¡

  • N-­‑gram ¡language ¡model. ¡
  • Uses ¡previous ¡n-­‑1 ¡tokens ¡to ¡predict ¡next ¡token. ¡
  • Learn ¡probabili(es ¡from ¡exis(ng ¡code. ¡
  • NATURALIZE ¡framework ¡[Allamanis ¡2014]. ¡
  • Can ¡predict ¡or ¡suggest ¡whitespace. ¡

49 ¡

slide-50
SLIDE 50

Similarity ¡of ¡Typographic ¡Style ¡

  • Measure ¡similarity ¡of ¡N-­‑gram ¡models. ¡
  • N-­‑gram ¡models ¡are ¡probability ¡distribu(ons. ¡
  • Measure ¡similarity ¡of ¡style-­‑checker ¡rules. ¡
  • Allamanis ¡et ¡al. ¡generate ¡rules ¡from ¡n-­‑gram ¡models. ¡

50 ¡

slide-51
SLIDE 51

Experimental ¡Setup ¡

Benchmarks ¡

  • 1. Reformat ¡the ¡same ¡

code ¡in ¡different ¡ways. ¡

  • 2. Collect ¡similar ¡code ¡

from ¡different ¡authors ¡ (e.g., ¡textbook ¡ examples). ¡

Par(cipants ¡

  • Undergraduate ¡student ¡

volunteers ¡from ¡upper ¡ level ¡elec(ves. ¡

  • Amazon ¡Mechanical ¡Turk ¡

workers ¡who ¡pass ¡a ¡ screening ¡test. ¡

51 ¡

slide-52
SLIDE 52

Human ¡Study ¡

  • 1. Iden(fy ¡wri_en ¡style. ¡
  • Par(cipants ¡write ¡code ¡to ¡accomplish ¡simple ¡tasks. ¡
  • E.g., ¡check ¡that ¡a ¡list ¡is ¡sorted. ¡
  • 2. Perform ¡maintenance ¡tasks. ¡
  • Par(cipants ¡answer ¡ques(ons ¡about ¡code ¡examples. ¡
  • E.g., ¡what ¡is ¡the ¡value ¡of ¡x ¡on ¡line ¡5? ¡

52 ¡

slide-53
SLIDE 53

Metrics ¡for ¡Program ¡Understanding ¡

  • Collect ¡similarity ¡between ¡code ¡par(cipants ¡

wrote ¡and ¡the ¡code ¡samples. ¡

  • Collect ¡8me ¡and ¡accuracy ¡in ¡answering ¡

ques(ons. ¡

  • Measure ¡correla(on ¡between ¡similarity ¡and ¡

(me ¡and ¡between ¡similarity ¡and ¡accuracy. ¡

53 ¡

slide-54
SLIDE 54

Outline ¡

  • Overview ¡of ¡the ¡proposed ¡research ¡thrusts ¡
  • Visual ¡error ¡and ¡run(me ¡performance ¡
  • Energy ¡usage ¡
  • Coding ¡style ¡
  • Proposed ¡research ¡(meline ¡
  • Conclusion ¡

54 ¡

slide-55
SLIDE 55

Today& Gradua*on& Jan&'13& Jan&'14& Jan&'15& Jan&'16& Jan&'17& Jan&'18& Energy&Op*miza*on&(RT2)& Coding&Style&of&Tests&(RT3)& Coding&Style&in&Guava&(RT3)& Shader&Acceptability&(RT1)& Energy&Op*miza*on&at&Scale&(RT2)& Coding&Style&Acceptability&(RT3)& Research&Period& Publica*on&Lag&

Research ¡Timeline ¡

55 ¡

slide-56
SLIDE 56

Conclusion ¡

Enable ¡be_er ¡tradeoffs ¡between ¡non-­‑func(onal ¡ proper(es ¡through ¡local ¡so9ware ¡ transforma(ons. ¡

  • 1. Visual ¡error ¡and ¡run(me ¡performance. ¡
  • 2. Energy ¡usage. ¡
  • 3. Coding ¡style. ¡

56 ¡

slide-57
SLIDE 57

BACKUP ¡

57 ¡

slide-58
SLIDE 58

Does ¡Coding ¡Style ¡Matter? ¡

IF A>B THEN S := 1; IF (A=B) AND (C>D) THEN S := 2; IF (A=B) AND (C<=D) THEN S := 3; IF (A<B) AND (C>D) THEN S := 4; IF (A<B) AND (C=D) THEN S := 5; IF (A<B) AND (C<D) THEN S := 6; IF A > B THEN S := 1 ELSE IF A = B THEN IF C > D THEN S := 2 ELSE S := 3 ELSE IF C > D THEN S := 4 ELSE IF C = D THEN S := 5 ELSE S := 6;

58 ¡ Reproduced ¡from ¡P. ¡W. ¡Oman ¡and ¡C. ¡R. ¡Cook. ¡ A ¡paradigm ¡for ¡programming ¡style ¡research. ¡ACM ¡Sigplan ¡No=ces, ¡23(12):69–78, ¡1988. ¡ ¡

slide-59
SLIDE 59

Does ¡Coding ¡Style ¡Matter? ¡

IF A>B THEN S := 1; IF (A=B) AND (C>D) THEN S := 2; IF (A=B) AND (C<=D) THEN S := 3; IF (A<B) AND (C>D) THEN S := 4; IF (A<B) AND (C=D) THEN S := 5; IF (A<B) AND (C<D) THEN S := 6; IF A > B THEN S := 1 ELSE IF A = B THEN IF C > D THEN S := 2 ELSE S := 3 ELSE IF C > D THEN S := 4 ELSE IF C = D THEN S := 5 ELSE S := 6;

59 ¡ Reproduced ¡from ¡P. ¡W. ¡Oman ¡and ¡C. ¡R. ¡Cook. ¡ A ¡paradigm ¡for ¡programming ¡style ¡research. ¡ACM ¡Sigplan ¡No=ces, ¡23(12):69–78, ¡1988. ¡ ¡

  • Avg. ¡Score: ¡ ¡4.90 ¡
  • Avg. ¡Time: ¡1.93 ¡
  • Avg. ¡Score: ¡ ¡3.36 ¡
  • Avg. ¡Time: ¡2.87 ¡