Slide 1

Slide 1 text

Kevin Murphy Enough Coverage To Bea t The Band

Slide 2

Slide 2 text

Kevin Murphy Enough Coverage To Bea t The Band

Slide 3

Slide 3 text

Nine Inch Nails CC BY-NC-SA 2.0

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Nine Inch Nails CC BY-NC-SA 2.0

Slide 6

Slide 6 text

kevinjmurphy.com concert = Concert.new(“Blue Ridge Ruby")

Slide 7

Slide 7 text

Coverage

Slide 8

Slide 8 text

@[email protected] kevinjmurphy.com

Slide 9

Slide 9 text

Test Coverage

Slide 10

Slide 10 text

kevinjmurphy.com setlist.add_song(TheLineBeginsToBlur.new)

Slide 11

Slide 11 text

kevinjmurphy.com setlist.add_song(TheLineBeginsToBlur.new) setlist.add_song(OneShotWayToGetThere.new)

Slide 12

Slide 12 text

kevinjmurphy.com setlist.add_song(TheLineBeginsToBlur.new) setlist.add_song(OneShotWayToGetThere.new) setlist.add_song(VariousMethodsOfEscape.new)

Slide 13

Slide 13 text

kevinjmurphy.com setlist.add_song(TheLineBeginsToBlur.new) setlist.add_song(OneShotWayToGetThere.new) setlist.add_song(VariousMethodsOfEscape.new) setlist.add_song(BranchesBones.new)

Slide 14

Slide 14 text

kevinjmurphy.com setlist.add_song(TheLineBeginsToBlur.new) setlist.add_song(OneShotWayToGetThere.new) setlist.add_song(VariousMethodsOfEscape.new) setlist.add_song(BranchesBones.new) concert.setlist = setlist

Slide 15

Slide 15 text

kevinjmurphy.com concert.perform

Slide 16

Slide 16 text

kevinjmurphy.com setlist.songs [ TheLineBeginsToBlur.new, OneShotWayToGetThere.new, VariousMethodsOfEscape.new, BranchesBones.new, ]

Slide 17

Slide 17 text

kevinjmurphy.com The Li ne Begi ns To Blur Nine Inch Nails CC BY-NC-SA 2.0

Slide 18

Slide 18 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def pluck(fret:) end Nine Inch Nails CC BY-NC-SA 2.0

Slide 19

Slide 19 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def pluck(fret:) if exhausted? break_string end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 20

Slide 20 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def pluck(fret:) if exhausted? break_string else @tension -= 1 play_note(fret) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 21

Slide 21 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def exhausted? @tension.negative? end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 22

Slide 22 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def exhausted? @tension.negative? || rand(1..1000) == 3 end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 23

Slide 23 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def break_string end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 24

Slide 24 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def break_string @broken = true end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 25

Slide 25 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def break_string @broken = true BrokenStringSound.new end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 26

Slide 26 text

kevinjmurphy.com The Li ne Begi ns To Blur # lib/tour_leg_1.rb 10.times do end

Slide 27

Slide 27 text

kevinjmurphy.com The Li ne Begi ns To Blur # lib/tour_leg_1.rb 10.times do concert.perform end

Slide 28

Slide 28 text

kevinjmurphy.com The Li ne Begi ns To Blur require "coverage"

Slide 29

Slide 29 text

kevinjmurphy.com The Li ne Begi ns To Blur require "coverage" Coverage.start(lines: true)

Slide 30

Slide 30 text

kevinjmurphy.com The Li ne Begi ns To Blur require "coverage" Coverage.start(lines: true) load "lib/tour_leg_1.rb"

Slide 31

Slide 31 text

kevinjmurphy.com The Li ne Begi ns To Blur require "coverage" Coverage.start(lines: true) load "lib/tour_leg_1.rb" result = Coverage.result

Slide 32

Slide 32 text

kevinjmurphy.com The Li ne Begi ns To Blur { "lib/tour_leg_1.rb"=> {:lines => […]}, … "…guitar/string.rb" => {:lines => [1, 1, 1, 1, 1, 1, nil,…]}, … }

Slide 33

Slide 33 text

kevinjmurphy.com The Li ne Begi ns To Blur { "…guitar/string.rb" => {:lines => [1, 1, 1, 1, 1, 1, nil,…]}, }

Slide 34

Slide 34 text

kevinjmurphy.com The Li ne Begi ns To Blur { "…guitar/string.rb" => {:lines => [1, 1, 1, 1, 1, 1, nil,…]}, } File

Slide 35

Slide 35 text

kevinjmurphy.com The Li ne Begi ns To Blur { "…guitar/string.rb" => {:lines => [1, 1, 1, 1, 1, 1, nil,…]}, } File Mode

Slide 36

Slide 36 text

kevinjmurphy.com The Li ne Begi ns To Blur { "…guitar/string.rb" => {:lines => [1, 1, 1, 1, 1, 1, nil,…]}, } File Mode Line 1 Count

Slide 37

Slide 37 text

kevinjmurphy.com The Li ne Begi ns To Blur { "…guitar/string.rb" => {:lines => [1, 1, 1, 1, 1, 1, nil,…]}, } File Mode Line 1 Count Irrelevant Line 7

Slide 38

Slide 38 text

kevinjmurphy.com The Li ne Begi ns To Blur class String attr_reader :tension attr_reader :tuning_note def initialize(number:, tuning_note:) end 4 5 6 7 8 Nine Inch Nails CC BY-NC-SA 2.0

Slide 39

Slide 39 text

kevinjmurphy.com The Li ne Begi ns To Blur string_lines = result["…guitar/string.rb"][:lines]

Slide 40

Slide 40 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def break_string @broken = true BrokenStringSound.new end end Nine Inch Nails CC BY-NC-SA 2.0 53 54 55 56

Slide 41

Slide 41 text

kevinjmurphy.com The Li ne Begi ns To Blur class String def break_string @broken = true BrokenStringSound.new end end Nine Inch Nails CC BY-NC-SA 2.0 53 54 55 56

Slide 42

Slide 42 text

kevinjmurphy.com The Li ne Begi ns To Blur string_lines = result["…guitar/string.rb"][:lines]

Slide 43

Slide 43 text

kevinjmurphy.com The Li ne Begi ns To Blur string_lines = result["…guitar/string.rb"][:lines] "Number of broken strings: #{string_lines[53]}"

Slide 44

Slide 44 text

kevinjmurphy.com The Li ne Begi ns To Blur string_lines = result["…guitar/string.rb"][:lines] "Number of broken strings: #{string_lines[53]}" => Number of broken strings: 16

Slide 45

Slide 45 text

Nine Inch Nails CC BY-NC-SA 2.0

Slide 46

Slide 46 text

kevinjmurphy.com setlist.songs [ TheLineBeginsToBlur.new, OneShotWayToGetThere.new, VariousMethodsOfEscape.new, BranchesBones.new, ]

Slide 47

Slide 47 text

kevinjmurphy.com One(Shot) Wa y To Get There Nine Inch Nails CC BY-NC-SA 2.0

Slide 48

Slide 48 text

kevinjmurphy.com One(Shot) Wa y To Get There Nine Inch Nails CC BY-NC-SA 2.0

Slide 49

Slide 49 text

kevinjmurphy.com One(Shot) Wa y To Get There Nine Inch Nails CC BY-NC-SA 2.0

Slide 50

Slide 50 text

kevinjmurphy.com One(Shot) Wa y To Get There Nine Inch Nails CC BY-NC-SA 2.0

Slide 51

Slide 51 text

kevinjmurphy.com One(Shot) Wa y To Get There Nine Inch Nails CC BY-NC-SA 2.0

Slide 52

Slide 52 text

kevinjmurphy.com One(Shot) Wa y To Get There Nine Inch Nails CC BY-NC-SA 2.0 drummer

Slide 53

Slide 53 text

kevinjmurphy.com One(Shot) Wa y To Get There class Patch attr_reader :sound attr_reader :effect attr_reader :filter attr_reader :oscillator end Nine Inch Nails CC BY-NC-SA 2.0

Slide 54

Slide 54 text

kevinjmurphy.com One(Shot) Wa y To Get There class Synthesizer def program(note) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 55

Slide 55 text

kevinjmurphy.com One(Shot) Wa y To Get There class Synthesizer def program(note) set_patch(note.synth_sound.patch) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 56

Slide 56 text

kevinjmurphy.com One(Shot) Wa y To Get There class Synthesizer def program(note) set_patch(note.synth_sound.patch) play_key( key: note.synth_sound.key, duration: note.duration, ) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 57

Slide 57 text

kevinjmurphy.com One(Shot) Wa y To Get There class MoogPatchMemory def read(location) case location … end end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 58

Slide 58 text

kevinjmurphy.com One(Shot) Wa y To Get There class MoogPatchMemory def read(location) case location … end end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 59

Slide 59 text

kevinjmurphy.com One(Shot) Wa y To Get There case location Nine Inch Nails CC BY-NC-SA 2.0

Slide 60

Slide 60 text

kevinjmurphy.com One(Shot) Wa y To Get There case location when :a1 @memory[0] Nine Inch Nails CC BY-NC-SA 2.0

Slide 61

Slide 61 text

kevinjmurphy.com One(Shot) Wa y To Get There case location when :a1 @memory[0] when :a2 @memory[1] Nine Inch Nails CC BY-NC-SA 2.0

Slide 62

Slide 62 text

kevinjmurphy.com One(Shot) Wa y To Get There case location when :a1 @memory[0] when :a2 @memory[1] when :b1 @memory[2] Nine Inch Nails CC BY-NC-SA 2.0

Slide 63

Slide 63 text

kevinjmurphy.com One(Shot) Wa y To Get There case location when :a1 @memory[0] when :a2 @memory[1] when :b1 @memory[2] when :b2 @memory[3] Nine Inch Nails CC BY-NC-SA 2.0

Slide 64

Slide 64 text

kevinjmurphy.com # lib/festival_setlist.rb moog = Synthesizer.new(brand: :moog) One(Shot) Wa y To Get There

Slide 65

Slide 65 text

kevinjmurphy.com # lib/festival_setlist.rb moog = Synthesizer.new(brand: :moog) moog.save_patch(location: :a1, patch: beep) One(Shot) Wa y To Get There

Slide 66

Slide 66 text

kevinjmurphy.com # lib/festival_setlist.rb moog = Synthesizer.new(brand: :moog) moog.save_patch(location: :a1, patch: beep) moog.save_patch(location: :a2, patch: boop) One(Shot) Wa y To Get There

Slide 67

Slide 67 text

kevinjmurphy.com # lib/festival_setlist.rb moog = Synthesizer.new(brand: :moog) moog.save_patch(location: :a1, patch: beep) moog.save_patch(location: :a2, patch: boop) moog.save_patch(location: :b1, patch: moog_buzz) One(Shot) Wa y To Get There

Slide 68

Slide 68 text

kevinjmurphy.com # lib/festival_setlist.rb moog = Synthesizer.new(brand: :moog) moog.save_patch(location: :a1, patch: beep) moog.save_patch(location: :a2, patch: boop) moog.save_patch(location: :b1, patch: moog_buzz) moog.save_patch(location: :b2, patch: whirr) One(Shot) Wa y To Get There

Slide 69

Slide 69 text

kevinjmurphy.com # lib/festival_setlist.rb concert.perform One(Shot) Wa y To Get There

Slide 70

Slide 70 text

kevinjmurphy.com require "coverage" One(Shot) Wa y To Get There

Slide 71

Slide 71 text

kevinjmurphy.com require "coverage" Coverage.start(oneshot_lines: true) One(Shot) Wa y To Get There

Slide 72

Slide 72 text

kevinjmurphy.com require "coverage" Coverage.start(oneshot_lines: true) load "lib/festival_setlist.rb" One(Shot) Wa y To Get There

Slide 73

Slide 73 text

kevinjmurphy.com require "coverage" Coverage.start(oneshot_lines: true) load "lib/festival_setlist.rb" result = Coverage.result One(Shot) Wa y To Get There

Slide 74

Slide 74 text

kevinjmurphy.com { "lib/festival_setlist.rb"=>{:oneshot_lines=>[1, 2, 3…]}, "moog_patch_memory.rb"=>{:oneshot_lines=>[1, 2, 3…]}, } One(Shot) Wa y To Get There

Slide 75

Slide 75 text

kevinjmurphy.com { "moog_patch_memory.rb"=>{:oneshot_lines=>[1, 2, 3…]}, } One(Shot) Wa y To Get There

Slide 76

Slide 76 text

kevinjmurphy.com { "moog_patch_memory.rb"=>{:oneshot_lines=>[1, 2, 3…]}, } File One(Shot) Wa y To Get There

Slide 77

Slide 77 text

kevinjmurphy.com { "moog_patch_memory.rb"=>{:oneshot_lines=>[1, 2, 3…]}, } File Mode One(Shot) Wa y To Get There

Slide 78

Slide 78 text

kevinjmurphy.com { "moog_patch_memory.rb"=>{:oneshot_lines=>[1, 2, 3…]}, } File Mode executed line numbers One(Shot) Wa y To Get There

Slide 79

Slide 79 text

kevinjmurphy.com moog = result["moog_patch_memory.rb"][:oneshot_lines] One(Shot) Wa y To Get There

Slide 80

Slide 80 text

kevinjmurphy.com moog = result["moog_patch_memory.rb"][:oneshot_lines] => [1, 2, 3, 4, 5, 7, 11, 15, 28, 41, 43, 8, 29, 31, 33, 35, 37, 12, 44, 46, 16, 18, 20, 24] One(Shot) Wa y To Get There

Slide 81

Slide 81 text

kevinjmurphy.com One(Shot) Wa y To Get There case location when :a1 @memory[0] when :a2 @memory[1] when :b1 @memory[2] when :b2 @memory[3] Nine Inch Nails CC BY-NC-SA 2.0 16 17 18 19 20 21 22 23 24

Slide 82

Slide 82 text

kevinjmurphy.com One(Shot) Wa y To Get There case location when :a1 @memory[0] when :a2 @memory[1] when :b1 @memory[2] when :b2 @memory[3] Nine Inch Nails CC BY-NC-SA 2.0 16 17 18 19 20 21 22 23 24

Slide 83

Slide 83 text

kevinjmurphy.com puts "Moog Keyboard" puts "==============" One(Shot) Wa y To Get There

Slide 84

Slide 84 text

kevinjmurphy.com puts "Moog Keyboard" puts "==============" puts "Location A1: #{moog.include?(18) ? 'Y' : 'N'}" One(Shot) Wa y To Get There

Slide 85

Slide 85 text

kevinjmurphy.com puts "Moog Keyboard" puts "==============" puts "Location A1: #{moog.include?(18) ? 'Y' : 'N'}" puts "Location A2: #{moog.include?(20) ? 'Y' : 'N'}" One(Shot) Wa y To Get There

Slide 86

Slide 86 text

kevinjmurphy.com puts "Moog Keyboard" puts "==============" puts "Location A1: #{moog.include?(18) ? 'Y' : 'N'}" puts "Location A2: #{moog.include?(20) ? 'Y' : 'N'}" puts "Location B1: #{moog.include?(22) ? 'Y' : 'N'}" One(Shot) Wa y To Get There

Slide 87

Slide 87 text

kevinjmurphy.com puts "Moog Keyboard" puts "==============" puts "Location A1: #{moog.include?(18) ? 'Y' : 'N'}" puts "Location A2: #{moog.include?(20) ? 'Y' : 'N'}" puts "Location B1: #{moog.include?(22) ? 'Y' : 'N'}" puts "Location B2: #{moog.include?(24) ? 'Y' : 'N'}" One(Shot) Wa y To Get There

Slide 88

Slide 88 text

kevinjmurphy.com Moog Keyboard ============= Location A1: Y Location A2: Y Location B1: N Location B2: Y One(Shot) Wa y To Get There

Slide 89

Slide 89 text

kevinjmurphy.com Moog Keyboard ============= Location A1: Y Location A2: Y Location B1: N Location B2: Y One(Shot) Wa y To Get There Nord Keyboard ============= Location A1: Y Location A2: N Location B1: N Location B2: N

Slide 90

Slide 90 text

kevinjmurphy.com Moog Keyboard ============= Location A1: Y Location A2: Y Location B1: Y Location B2: Y One(Shot) Wa y To Get There Nord Keyboard ============= Location A1: Y Location A2: N Location B1: N Location B2: N

Slide 91

Slide 91 text

kevinjmurphy.com Moog Keyboard ============= Location A1: Y Location A2: Y Location B1: Y Location B2: Y One(Shot) Wa y To Get There Nord Keyboard ============= Location A1: Y Location A2: N Location B1: N Location B2: N

Slide 92

Slide 92 text

Nine Inch Nails CC BY-NC-SA 2.0

Slide 93

Slide 93 text

kevinjmurphy.com setlist.songs [ TheLineBeginsToBlur.new, OneShotWayToGetThere.new, VariousMethodsOfEscape.new, BranchesBones.new, ]

Slide 94

Slide 94 text

kevinjmurphy.com V ari ous Methods Of Escape Nine Inch Nails CC BY-NC-SA 2.0

Slide 95

Slide 95 text

kevinjmurphy.com

Slide 96

Slide 96 text

kevinjmurphy.com V ari ous Methods Of Escape Nine Inch Nails CC BY-NC-SA 2.0

Slide 97

Slide 97 text

kevinjmurphy.com V ari ous Methods Of Escape Nine Inch Nails CC BY-NC-SA 2.0

Slide 98

Slide 98 text

kevinjmurphy.com V ari ous Methods Of Escape Nine Inch Nails CC BY-NC-SA 2.0

Slide 99

Slide 99 text

kevinjmurphy.com V ari ous Methods Of Escape Nine Inch Nails CC BY-NC-SA 2.0

Slide 100

Slide 100 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def trigger(note) end Nine Inch Nails CC BY-NC-SA 2.0

Slide 101

Slide 101 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def trigger(note) composition = note.lighting end Nine Inch Nails CC BY-NC-SA 2.0

Slide 102

Slide 102 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def trigger(note) composition = note.lighting @powered_lights[composition.light].trigger( color: composition.color, effect: composition.effect, ) end Nine Inch Nails CC BY-NC-SA 2.0

Slide 103

Slide 103 text

kevinjmurphy.com V ari ous Methods Of Escape class BeamProjector def trigger(color:, effect:) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 104

Slide 104 text

kevinjmurphy.com V ari ous Methods Of Escape class CanLight def trigger(color:, effect:) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 105

Slide 105 text

kevinjmurphy.com V ari ous Methods Of Escape class MovingLight def trigger(color:, effect:) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 106

Slide 106 text

kevinjmurphy.com V ari ous Methods Of Escape class Spotlight def trigger(color:, effect:) end end Nine Inch Nails CC BY-NC-SA 2.0

Slide 107

Slide 107 text

kevinjmurphy.com V ari ous Methods Of Escape # lib/lighting_inspection.rb controller = LightingController.new setlist.lighting = controller

Slide 108

Slide 108 text

kevinjmurphy.com V ari ous Methods Of Escape # lib/lighting_inspection.rb controller = LightingController.new setlist.lighting = controller concert.set_up

Slide 109

Slide 109 text

kevinjmurphy.com V ari ous Methods Of Escape # lib/lighting_inspection.rb controller = LightingController.new setlist.lighting = controller concert.set_up concert.perform

Slide 110

Slide 110 text

kevinjmurphy.com V ari ous Methods Of Escape # lib/lighting_inspection.rb controller = LightingController.new setlist.lighting = controller concert.set_up concert.perform concert.load_out

Slide 111

Slide 111 text

kevinjmurphy.com V ari ous Methods Of Escape require "coverage"

Slide 112

Slide 112 text

kevinjmurphy.com V ari ous Methods Of Escape require "coverage" Coverage.start(methods: true)

Slide 113

Slide 113 text

kevinjmurphy.com V ari ous Methods Of Escape require "coverage" Coverage.start(methods: true) load "lib/lighting_inspection.rb"

Slide 114

Slide 114 text

kevinjmurphy.com V ari ous Methods Of Escape require "coverage" Coverage.start(methods: true) load "lib/lighting_inspection.rb" result = Coverage.result

Slide 115

Slide 115 text

kevinjmurphy.com V ari ous Methods Of Escape "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, "beam_projector.rb"=> {:methods=>{[BeamProjector, :trigger, 4, 6, 6, 9]=>0}}, "can_light.rb"=> {:methods=>{[CanLight, :trigger, 4, 6, 6, 9]=>2}}, "moving_light.rb"=> {:methods=>{[MovingLight, :trigger, 4, 6, 6, 9]=>6}},

Slide 116

Slide 116 text

kevinjmurphy.com { "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, } V ari ous Methods Of Escape

Slide 117

Slide 117 text

kevinjmurphy.com { "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, } File V ari ous Methods Of Escape

Slide 118

Slide 118 text

kevinjmurphy.com { "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, } File Mode V ari ous Methods Of Escape

Slide 119

Slide 119 text

kevinjmurphy.com { "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, } File Mode V ari ous Methods Of Escape method

Slide 120

Slide 120 text

kevinjmurphy.com { "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, } File Mode V ari ous Methods Of Escape method count

Slide 121

Slide 121 text

kevinjmurphy.com { "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, } File Mode V ari ous Methods Of Escape method count

Slide 122

Slide 122 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape

Slide 123

Slide 123 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape count

Slide 124

Slide 124 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape class count

Slide 125

Slide 125 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape method class count

Slide 126

Slide 126 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape method class start line count

Slide 127

Slide 127 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape method class start line start column count

Slide 128

Slide 128 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape method class start line start column end line count

Slide 129

Slide 129 text

kevinjmurphy.com [Spotlight, :trigger, 4, 6, 6, 9] => 2 V ari ous Methods Of Escape method class start line start column end line end column count

Slide 130

Slide 130 text

kevinjmurphy.com V ari ous Methods Of Escape "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, "beam_projector.rb"=> {:methods=>{[BeamProjector, :trigger, 4, 6, 6, 9]=>0}}, "can_light.rb"=> {:methods=>{[CanLight, :trigger, 4, 6, 6, 9]=>2}}, "moving_light.rb"=> {:methods=>{[MovingLight, :trigger, 4, 6, 6, 9]=>6}},

Slide 131

Slide 131 text

kevinjmurphy.com V ari ous Methods Of Escape "spotlight.rb"=> {:methods=>{[Spotlight, :trigger, 4, 6, 6, 9]=>2}}, "beam_projector.rb"=> {:methods=>{[BeamProjector, :trigger, 4, 6, 6, 9]=>0}}, "can_light.rb"=> {:methods=>{[CanLight, :trigger, 4, 6, 6, 9]=>2}}, "moving_light.rb"=> {:methods=>{[MovingLight, :trigger, 4, 6, 6, 9]=>6}},

Slide 132

Slide 132 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def turn_on_lights @powered_lights[:beam_projector] = BeamProjector.new @powered_lights[:can] = CanLight.new @powered_lights[:moving_light] = MovingLight.new @powered_lights[:spotlight] = Spotlight.new end end

Slide 133

Slide 133 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def turn_on_lights @powered_lights[:beam_projector] = BeamProjector.new @powered_lights[:can] = CanLight.new @powered_lights[:moving_light] = MovingLight.new @powered_lights[:spotlight] = Spotlight.new end end

Slide 134

Slide 134 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def turn_on_lights @powered_lights[:beam_projector] = BeamProjector.new @powered_lights[:can] = CanLight.new @powered_lights[:moving_light] = MovingLight.new @powered_lights[:spotlight] = Spotlight.new end end

Slide 135

Slide 135 text

kevinjmurphy.com V ari ous Methods Of Escape class LightingController def turn_on_lights @powered_lights[:can] = CanLight.new @powered_lights[:moving_light] = MovingLight.new @powered_lights[:spotlight] = Spotlight.new end end

Slide 136

Slide 136 text

Nine Inch Nails CC BY-NC-SA 2.0

Slide 137

Slide 137 text

kevinjmurphy.com setlist.songs [ TheLineBeginsToBlur.new, OneShotWayToGetThere.new, VariousMethodsOfEscape.new, BranchesBones.new, ]

Slide 138

Slide 138 text

Nine Inch Nails CC BY-NC-SA 2.0

Slide 139

Slide 139 text

kevinjmurphy.com Nine Inch Nails CC BY-NC-SA 2.0 Nine Inch Nails CC BY-NC-SA 2.0 Nine Inch Nails CC BY-NC-SA 2.0 Nine Inch Nails CC BY-NC-SA 2.0 Nine Inch Nails CC BY-NC-SA 2.0

Slide 140

Slide 140 text

kevinjmurphy.com Branches /Bones # lib/rehearsal.rb song = BranchesBones.new

Slide 141

Slide 141 text

kevinjmurphy.com Branches /Bones # lib/rehearsal.rb song = BranchesBones.new song.performers = band

Slide 142

Slide 142 text

kevinjmurphy.com Branches /Bones # lib/rehearsal.rb song = BranchesBones.new song.performers = band song.play

Slide 143

Slide 143 text

kevinjmurphy.com Branches /Bones require "coverage"

Slide 144

Slide 144 text

kevinjmurphy.com Branches /Bones require "coverage" Coverage.start(:all)

Slide 145

Slide 145 text

kevinjmurphy.com Branches /Bones require "coverage" Coverage.start(:all) load "lib/rehearsal.rb"

Slide 146

Slide 146 text

kevinjmurphy.com Branches /Bones require "coverage" Coverage.start(:all) load "lib/rehearsal.rb" result = Coverage.result

Slide 147

Slide 147 text

kevinjmurphy.com Branches /Bones "branches_bones.rb"=>{ :lines=>[1, 1, 1, 1, 1, nil, nil, nil, nil, nil, 1, nil, 1, nil, 1, nil, nil, nil, 1, nil, 1, nil, nil, nil, 1, nil, 1, nil, nil, nil, nil, nil, 1, 2, nil, nil, 2, nil, nil, nil, nil, 2, nil, 2, 8, nil, nil, nil, nil, nil], :branches=>{[:if, 0, 34, 25, 34, 67]=>{[:then, 1, 34, 60, 34, 62]=>0, [:else, 2, 34, 65, 34, 67]=>2}, [:if, 3, 42, 18, 42, 99]=>{[:then, 4, 42, 41, 42, 75]=>0, [:else, 5, 42, 78, 42, 99]=>2}}, :methods=>{ [RubyCoverBand::Songs::BranchesBones, :chorus, 33, 6, 47, 9]=>2 [RubyCoverBand::Songs::BranchesBones, :outro, 25, 6, 29, 9]=>1, [RubyCoverBand::Songs::BranchesBones, :verse_2, 19, 6, 23, 9]=>1, [RubyCoverBand::Songs::BranchesBones, :verse_1, 13, 6, 17, 9]=>1, [RubyCoverBand::Songs::BranchesBones, :initialize, 4, 6, 9, 9]=>1}},

Slide 148

Slide 148 text

kevinjmurphy.com Branches /Bones "branches_bones.rb"=>{ :lines=>[1, 1, 1, 1, 1, nil, nil, nil, nil, nil, 1, nil, 1, nil, 1, nil, nil, nil, 1, nil, 1, nil, nil, nil, 1, nil, 1, nil, nil, nil, nil, nil, 1, 2, nil, nil, 2, nil, nil, nil, nil, 2, nil, 2, 8, nil, nil, nil, nil, nil], :branches=>{[:if, 0, 34, 25, 34, 67]=>{[:then, 1, 34, 60, 34, 62]=>0, [:else, 2, 34, 65, 34, 67]=>2}, [:if, 3, 42, 18, 42, 99]=>{[:then, 4, 42, 41, 42, 75]=>0, [:else, 5, 42, 78, 42, 99]=>2}}, :methods=>{ [RubyCoverBand::Songs::BranchesBones, :chorus, 33, 6, 47, 9]=>2 [RubyCoverBand::Songs::BranchesBones, :outro, 25, 6, 29, 9]=>1, [RubyCoverBand::Songs::BranchesBones, :verse_2, 19, 6, 23, 9]=>1, [RubyCoverBand::Songs::BranchesBones, :verse_1, 13, 6, 17, 9]=>1, [RubyCoverBand::Songs::BranchesBones, :initialize, 4, 6, 9, 9]=>1}},

Slide 149

Slide 149 text

kevinjmurphy.com Branches /Bones song_coverage = result["branches_bones.rb"] song_coverage.keys

Slide 150

Slide 150 text

kevinjmurphy.com Branches /Bones song_coverage = result["branches_bones.rb"] song_coverage.keys => [:lines, :methods, :branches]

Slide 151

Slide 151 text

kevinjmurphy.com Branches /Bones song_coverage[:lines].include?(0) => false

Slide 152

Slide 152 text

kevinjmurphy.com Branches /Bones song_coverage[:methods].values.include?(0) => false

Slide 153

Slide 153 text

kevinjmurphy.com Branches /Bones song_coverage[:branches] => {[:if, 0, 34, 25, 34, 67]=>{ [:then, 1, 34, 60, 34, 62]=>0, [:else, 2, 34, 65, 34, 67]=>2, }}

Slide 154

Slide 154 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } }

Slide 155

Slide 155 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } } File

Slide 156

Slide 156 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } } File mode

Slide 157

Slide 157 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } } File mode conditional

Slide 158

Slide 158 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } } File mode conditional branch

Slide 159

Slide 159 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } } File mode conditional branch branch

Slide 160

Slide 160 text

kevinjmurphy.com Branches /Bones { "branches_bones.rb" => { :branches => {[:if, 0, 34, 25, 34, 67] => { [:then, 1, 34, 60, 34, 62] => 0, [:else, 2, 34, 65, 34, 67] => 2, }} } } File mode conditional branch branch

Slide 161

Slide 161 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0

Slide 162

Slide 162 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 count

Slide 163

Slide 163 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 branch count

Slide 164

Slide 164 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 branch count id

Slide 165

Slide 165 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 branch start line count id

Slide 166

Slide 166 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 branch start line start column count id

Slide 167

Slide 167 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 branch start line start column end line count id

Slide 168

Slide 168 text

kevinjmurphy.com Branches /Bones [:then, 1, 34, 60, 34, 62] => 0 branch start line start column end line end column count id

Slide 169

Slide 169 text

kevinjmurphy.com Branches /Bones class BranchesBones < Song def chorus(number) echo_intensity = number.positive? && number.even? ? 10 : 30 … Lyric.new(line: line, effect: :echo, effect_level: echo_intensity) 32 33 34 35 60 62

Slide 170

Slide 170 text

kevinjmurphy.com Branches /Bones class BranchesBones < Song def initialize notes = verse_1 + chorus(0) + verse_2 + chorus(1) + outro end def chorus(number) echo_intensity = number.positive? && number.even? ? 10 : 30 end

Slide 171

Slide 171 text

kevinjmurphy.com Branches /Bones class BranchesBones < Song def initialize notes = verse_1 + chorus(0) + verse_2 + chorus(1) + outro end def chorus(number) echo_intensity = number.positive? && number.even? ? 10 : 30 end

Slide 172

Slide 172 text

kevinjmurphy.com Branches /Bones class BranchesBones < Song def initialize notes = verse_1 + chorus(1) + verse_2 + chorus(2) + outro end def chorus(number) echo_intensity = number.positive? && number.even? ? 10 : 30 end

Slide 173

Slide 173 text

kevinjmurphy.com Branches /Bones song_coverage[:branches] => {[:if, 0, 34, 25, 34, 67]=>{ [:then, 1, 34, 60, 34, 62]=>1, [:else, 2, 34, 65, 34, 67]=>1, }}

Slide 174

Slide 174 text

kevinjmurphy.com Branches /Bones Nine Inch Nails CC BY-NC-SA 2.0

Slide 175

Slide 175 text

encore

Slide 176

Slide 176 text

kevinjmurphy.com { } coverage.summary

Slide 177

Slide 177 text

kevinjmurphy.com { lines: "how many times was each line executed?", } coverage.summary

Slide 178

Slide 178 text

kevinjmurphy.com { lines: "how many times was each line executed?", oneshot_lines: "which lines were executed?", } coverage.summary

Slide 179

Slide 179 text

kevinjmurphy.com { lines: "how many times was each line executed?", oneshot_lines: "which lines were executed?", methods: "how many times was each method executed?", } coverage.summary

Slide 180

Slide 180 text

kevinjmurphy.com { lines: "how many times was each line executed?", oneshot_lines: "which lines were executed?", methods: "how many times was each method executed?", branches: "how many times was each branch executed?", } coverage.summary

Slide 181

Slide 181 text

kevinjmurphy.com Supporti ng I nstruments SimpleCov Coverband Nine Inch Nails CC BY-NC-SA 2.0

Slide 182

Slide 182 text

kevinjmurphy.com kevinjmurphy.com/coverage newsletter.kevinjmurphy.com Nine Inch Nails CC BY-NC-SA 2.0 @[email protected]

Slide 183

Slide 183 text

kevinjmurphy.com kevinjmurphy.com/coverage newsletter.kevinjmurphy.com Nine Inch Nails CC BY-NC-SA 2.0 @[email protected]