gr dev day presentation, march 21 2015

65
Automating Myself Out of a Job Tore Franzen GR Dev Day March 21, 2015

Upload: tore-franzen

Post on 16-Jul-2015

93 views

Category:

Software


3 download

TRANSCRIPT

Page 1: GR Dev Day Presentation, March 21 2015

Automating Myself Out of a JobTore Franzen

GR Dev Day

March 21, 2015

Page 2: GR Dev Day Presentation, March 21 2015

Real World Example

Page 3: GR Dev Day Presentation, March 21 2015

Why Automation?

*Warning: Graph not based on real data

Page 4: GR Dev Day Presentation, March 21 2015

Overview•Auto Code Generators

•Test Automation

•Continuous Integration/Deployment

•Automating Your Life

•Real World Cases

•Practical Advice

Page 5: GR Dev Day Presentation, March 21 2015

SCADESafety Critical Application Development Environment

Page 6: GR Dev Day Presentation, March 21 2015

C Code Generated from SCADE

Page 7: GR Dev Day Presentation, March 21 2015

Code OptimizationIt's just like compiler optimization!

Page 8: GR Dev Day Presentation, March 21 2015

Control Logic and State Machine Example

Page 9: GR Dev Day Presentation, March 21 2015

Control Logic and State Machine Example (If Block)

Page 10: GR Dev Day Presentation, March 21 2015

Control Logic and State Machine Example (State Machine)

Page 11: GR Dev Day Presentation, March 21 2015

Debugging with SCADE

Page 12: GR Dev Day Presentation, March 21 2015

Other SCADE Features• TCL API

• Simulation We don't need hardware to start prototyping and testing

• Model Coverage

• Design Verifier Prove that certain requirements are met

• Rapid Prototyper Wire IO to a GUI

Page 13: GR Dev Day Presentation, March 21 2015

UML To Code Generators

Page 14: GR Dev Day Presentation, March 21 2015

Winform Example

Page 15: GR Dev Day Presentation, March 21 2015

Template Tools

Page 16: GR Dev Day Presentation, March 21 2015

Whoa, Code Generators are Everywhere

Page 17: GR Dev Day Presentation, March 21 2015

Yes, They Are Everywhere•Win Forms/WPF (almost any drag and drop GUI creator)

•Entity Framework

•Matlab/Simulink

•Wolfram

• LabVIEW

•Template Processors

Page 18: GR Dev Day Presentation, March 21 2015

Pitfalls•Memory Management

•Less ControlNo OO in SCADE

Limited Interfaces

•Metrics

Page 19: GR Dev Day Presentation, March 21 2015

Continuous Integration/Deployment• Jenkins

• Team Foundation Server

• CruiseControl[.NET]

Page 20: GR Dev Day Presentation, March 21 2015

Testing Automation•Mock Frameworks

•VS UI Test Framework (Coded UI Test Project)

•Randoop Uses Fuzzing to generate unit tests

•PexCodeDigger

Page 21: GR Dev Day Presentation, March 21 2015

Pex/Code Digger

Page 22: GR Dev Day Presentation, March 21 2015

Testing with Specialized Hardware• Always try to find hardware that can do it for you (NI)

• Control Power

• If it doesn't exist, make it (or find someone who can)

• It is usually more expensive for someone to sit there flipping switches manually

Page 23: GR Dev Day Presentation, March 21 2015

Testing Remotely•Don't make your testers be next to the machine

•Don't make the tester hit more than one button

•Do allow time sharingOr write a program that does

•Do provide feedback

Page 24: GR Dev Day Presentation, March 21 2015

Other Automation Tools•Windows Task scheduler

•Batch File

•Visual Basic Script (VBS)

•Visual Basic for Applications (VBA)

•Windows Power Shell

•AutoIt

Page 25: GR Dev Day Presentation, March 21 2015

AutoIt

Page 26: GR Dev Day Presentation, March 21 2015

The Power of Automation

Page 27: GR Dev Day Presentation, March 21 2015

If This Then That (ifttt.com)

Page 28: GR Dev Day Presentation, March 21 2015

If This Then That (ifttt.com)

Page 29: GR Dev Day Presentation, March 21 2015

Tasker (Android App)

Page 30: GR Dev Day Presentation, March 21 2015

Yahoo Pipes

Page 31: GR Dev Day Presentation, March 21 2015

This is Why I Automate

Page 32: GR Dev Day Presentation, March 21 2015

Step By Step Guide

Page 33: GR Dev Day Presentation, March 21 2015

Enovia

Page 34: GR Dev Day Presentation, March 21 2015

What A Document Update Looks Like• Create a "Engineering Change Order" (ECO) Document

• Promote "Change Document" to "working"

• Create a Route/Signature loop

• Create an Engineering Order

• THEN the real work can begin

• Once finished, we kick off the Route

Page 35: GR Dev Day Presentation, March 21 2015

Where Do I Start?• Login

•Find the Document

•Change the view to "Change Management"

•Create and add the ECO

•And on and on and on....

Page 36: GR Dev Day Presentation, March 21 2015

Search and Select Document

Page 37: GR Dev Day Presentation, March 21 2015

Switch View in Document

Page 38: GR Dev Day Presentation, March 21 2015

Change Management View

Page 39: GR Dev Day Presentation, March 21 2015

Create Change Document

Page 40: GR Dev Day Presentation, March 21 2015

Selenium to the Rescue!Its not just for testing!

Page 41: GR Dev Day Presentation, March 21 2015

Selenium Setup

Page 42: GR Dev Day Presentation, March 21 2015

Low Level Functions

Page 43: GR Dev Day Presentation, March 21 2015

Low Level Functions

Page 44: GR Dev Day Presentation, March 21 2015

Navigating Frames

Page 45: GR Dev Day Presentation, March 21 2015

Turning Pages into Classes

Page 46: GR Dev Day Presentation, March 21 2015

Although Selenium Was Great, I Did Have Problems…

Page 47: GR Dev Day Presentation, March 21 2015

Things That Didn't Work So Well•Hovering

• IFrames (not Seleniums fault)

•Timeouts

•Personal reservations about using xpaths

Page 48: GR Dev Day Presentation, March 21 2015

This is How I Set it and....Forget it

Page 49: GR Dev Day Presentation, March 21 2015

WAS/IS Creation• Problem: Had to create a WAS/IS for every Problem Report (Change Request)

Page 50: GR Dev Day Presentation, March 21 2015

What to Do?•Open DOORS programmatically

•Run a DXL script to filter on PR and Print using WAS/IS view

•Upload PDF print out to PR System (MKS)

Page 51: GR Dev Day Presentation, March 21 2015

Open DOORS Programmatically

Page 52: GR Dev Day Presentation, March 21 2015

Print to PDF

Page 53: GR Dev Day Presentation, March 21 2015

Send to Change Request System

Page 54: GR Dev Day Presentation, March 21 2015

Practical Advice•Use the Right Tools for the Right Job

•New Languages

•OS Native

•Personal History

Page 55: GR Dev Day Presentation, March 21 2015

Practical Advice•Consider Configuration Debt

•100+ options

•Are you the only one that can run it?

•Without a batch/script file?

Page 56: GR Dev Day Presentation, March 21 2015

Practical Advice

•Embrace the CLI

•Customize

•Pass data using redirected pipes/IO, environment variables, shared memory or shared file

Page 57: GR Dev Day Presentation, March 21 2015

Practical Advice

•Don't go Shaving Yaks

•Keep the focus on what you're trying to automate

•Don't get lost in the forums

Page 58: GR Dev Day Presentation, March 21 2015

Practical Advice•Don't Ask for Permission, Just Do It

•Politics

•Share the wealth

Page 59: GR Dev Day Presentation, March 21 2015

Practical Advice•What to Look For...

•Someone connects the dots

•Something that has to be done on a recurring basis

•You find yourself saying "anyone can do this"

Page 60: GR Dev Day Presentation, March 21 2015

Bonus Productivity Tips• Shortcut (Hot Key) Frequently used items Ctrl + Alt + C => Calculator

Ctrl + Alt + S => Snipping Tool

Ctrl + Alt + I => Internet Explorer

• Get familiar with keyboard shortcuts within programs Visual Studio

Notepad++

Vim/Vi/Emacs

Microsoft Office Products

etc...

Page 61: GR Dev Day Presentation, March 21 2015
Page 62: GR Dev Day Presentation, March 21 2015

You Stay Lazy, Grand Rapids Programmers

Page 63: GR Dev Day Presentation, March 21 2015

Thank You•Questions?

•My NameTore Franzen

•Twitter@ToreFranzen

Page 64: GR Dev Day Presentation, March 21 2015

Further Reading•The Productive Programmer - Neal Ford

•The Pragmatic Programmer -Andrew Hunt & Dave Thomas

Page 65: GR Dev Day Presentation, March 21 2015

• Images retrieved from the following sources:

• http://www.engineersgotblued.com/wp-content/uploads/2014/03/rube-goldberg-machine-from-getty-images.jpg

• https://i.imgur.com/7j15tXU.jpg

• https://i.ytimg.com/vi/uqVqYFvzgoY/maxresdefault.jpg

• https://upload.wikimedia.org/wikipedia/commons/f/fa/Billy_Mays_Portrait_Cropped.jpg

• http://www.quickmeme.com/img/7a/7ac6c18b1bca53b88bbd8cd25a68a327396adce14cb999a7d7130cf76b07a4c6.jpg

• http://ockhamsbungalow.com/blog25/gnome.jpg

• http://thelistlove.com.gridhosted.co.uk/wp-content/uploads/2014/06/162.jpg

• http://www.seleniumhq.org/images/big-logo.png

• http://c3e308.medialib.glogster.com/media/4a/4a6332fa6761c5e093ffb54d036c69594d8d6e06e2c1890d857f23cc6f0e73f5/selenium-meds.jpg

• http://www.gameshowgarbage.com/Pictures/DAOTW/DAOTW%201-28-2012%20Pic%2013.png

• https://ionari.files.wordpress.com/2011/05/ionari365-0521.jpg?w=590&h=590

• https://s-media-cache-ak0.pinimg.com/236x/5b/d3/0e/5bd30e9ece87c56a7d263866ece0b3b2.jpg

• http://th05.deviantart.net/fs70/PRE/i/2011/186/2/2/bestest_friend_hugs_ftw_by_megbeth-d3l33q7.jpg

• https://xkcd.com/979/

• http://sonsonthepyre.com/wp-content/uploads/2014/01/Arnold-do-it-now.jpg

• http://selfdefense4newbies.com/wp-content/uploads/2014/08/WTF-binoculars.jpg

• https://i.imgur.com/FFmFzxJ.jpg

• http://www.coachoflove.com/wp-content/uploads/2013/05/ron-burgundy-2.jpg