STOP UNIT TESTIN G. * * Sort of… STOP UNIT TESTIN G * * Sort of… Alec Wojciechowski Senior Consultant ILM Professional Services

Slides:



Advertisements
Similar presentations
Global On Line Assessment (The GOLA Exams) Coping with Complex Questions Presented by Norman Leaver Learnatrade Ltd. ©Norman Leaver.
Advertisements

Detecting Bugs Using Assertions Ben Scribner. Defining the Problem  Bugs exist  Unexpected errors happen Hardware failures Loss of data Data may exist.
Lecture 19. Reduction: More Undecidable problems
Exceptions: when things go wrong. Various sources of error public static doSomething() { int i = 3.0; while(!done); { int i = false } ) Syntactic errors.
Silberschatz, Galvin and Gagne ©2007 Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Chapter 6 (a): Synchronization.
Chapter 7: Introduction to Debugging TECH Prof. Jeff Cheng.
Developing your Assessment Judy Cohen Curriculum Developer Unit for the Enhancement of Learning and Teaching.
Greenbelt Middle School
 When you are ready › The more comfortable you feel, the more likely it is they will feel uncomfortable.  Do not hurry to interact with the teacher.
Race Conditions Critical Sections Deker’s Algorithm.
Estimating Surface Area The art of math…. Estimating the Surface Area of 3-D Objects  You can’t always get an exact answer when looking for the surface.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Why Software.
PLANNING AND PREPARATION. Many experienced executives react in the opposite way. Before outsourcing, the organization develops the broad outlines of the.
MISSION: SAVE THE DUCKS Amy Whittaker Senior Associate Consultant, Advisory Services San Francisco Andrew Olsen Web Manager San Francisco Meg VanWagner.
(a.k.a. Time Management) Pharmacy Management Professor Matt Perri.
What turns a goal into a SMART GOAL ?. Here’s an important goal that many of us share: "Get in shape." How could we revise it to make it a SMART GOAL.
CZ Biz. Auto. System & Test-Driven Development Teoman Soygul (Sept 24, 2012).
TDD,BDD and Unit Testing in Ruby
Web Security Demystified Justin C. Klein Keane Sr. InfoSec Specialist University of Pennsylvania School of Arts and Sciences Information Security and Unix.
1 Agile is Dumb. 2 Look at Moodle List of Essays Get in groups of 4-5 Divide and read the readings in the category “agile is dumb” – About 20 minutes.
The Non-Designer’s Design Book
@benday #vslive Automated Build, Test & Deploy with TFS, ASP.NET, and SQL Server Benjamin
What turns a goal into a SMART GOAL ?. Here’s an important goal that many of us share: "Get in shape." How could we revise it to make it a SMART GOAL.
to Effective Conflict Resolution
1 Ch. 7 Recursion similar to iteration in that you repeatedly do a little bit of the task and then “loop” again and work on a smaller piece - eventually.
Positive Solutions for Families Session 1 Making a Connection! 1.
Welcome to my conference! February th grade Guadalupe.
Talk Back To Negative Thoughts
Minds and Computers 3.1 Preview Spin left motor Spin right motor Wait until the motors have spun two rotations Stop left motor Stop right motor What five.
BIT 115: Introduction To Programming Instructor: Jon Peck
Mock Objects in the Smalltalk World Dennis Schetinin.
Documentation. Your documentation must fit the needs of your audience. It’s always better to say one thing that is useful, as opposed to many things that.
Effort.vs. Software Product “Quality” Effort Product “Quality” Which curve? - linear? - logarithmic? - exponential?
Solution of. Linear Differential Equations The first special case of first order differential equations that we will look is the linear first order differential.
Steps to Success Communicating with Your Child’s School By Jenny Stonemeier and Wisconsin FACETS With information contributed by CADRE-Consortium for Appropriate.
What persuades you more: What someone says? Or The way they say it?
Getting the Interview: Make your Application Stand Out and Get Noticed Matthew Heiydt.
T Project Review WellIT I2 Iteration
Winter 2006CISC121 - Prof. McLeod1 Stuff No stuff today!
The Last Lecture CS 5010 Program Design Paradigms "Bootcamp" Lesson © Mitchell Wand, This work is licensed under a Creative Commons Attribution-NonCommercial.
Refactoring and Integration Testing or Strategy, introduced reliably by TDD The power of automated tests.
1.Your mobile phone is missing. What do you do? A Cry and feel sorry for yourself, convinced it’s gone for ever. ‘Why do these things always happen to.
© 2015 albert-learning.com How to talk to your boss How to talk to your boss!!
Items relating to each other should be grouped close together. When several items are in close proximity to each other, they become one visual unit rather.
EXAMINERS’ COMMENTS RAPHAEL’S LONG TURN GRAMMAR Accurate use of simple grammatical structures and also of some complex sentences: ‘they could also be preparing.
Journal 9/8/15 Is there anything in your life that you are 100% certain about? Anything you know for sure? Objective Tonight’s Homework To learn about.
Project 2080 Wisdom vs. Youth By Sly Guys. What has been an attempt at a Dystopia? Holocaust Rwanda Genocide Massacre of Nanking.
Dana Nau: CMSC 722, AI Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
October 9, 2006 Section 4: Why do an RIA Designing an RIA.
Successful Software Practice How to successfully work as a team to create software Chris Mendes, Chief Technology Officer Sirca Limited March 2012.
April 16, 2016 Kim Tillotson Fleming, CFA ® Chairman and CEO.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
10 Great Ways to Stop Procrastinating and Get More Done in Less Time Time Management Tips by Arman Sadeghi.
TDD Unit tests from a slightly different point of view Katie Dwyer.
Is The Internet Goood OR Badd By Brier, Natasha and Misty.
SAT Prep Lesson # 1 EQ: What do I need know about time management to be successful on the SAT?
^ About the.
Chapter 1 Introduction Content is king, but typography is the crown and design is the throne. Typography and design both help content maximize its.
Unit Testing & Test-Driven Development for Mere Mortals
An Introduction to VEX IQ Programming with Modkit
Using Your Filter.
This I Believe.
Based on the work of Stephen Covey
Unit Testing & Test-Driven Development for Mere Mortals
I CAN DECIDE…IT’S UP TO ME
Rule #1: Stop obsessing about quantifying progress
3.4.1 Sex: How people have sex/Having sex for the first time
Everybody needs a counselor sometimes! 咨询心理学 (Counseling Psychology)
Chapter 2: Building a System
Presentation transcript:

STOP UNIT TESTIN G

* * Sort of…

STOP UNIT TESTIN G * * Sort of… Alec Wojciechowski Senior Consultant ILM Professional (private) Also on LinkedIn

Who/What is this for? Challenging developer dogma Prioritizing developer’s (or QA’s!) time Catching the ‘real’ bugs vs. those that we assume might occur Cutting out unnecessary complexity from our applications Helping us understand our own code better

Who/What is this not for? An excuse not to do testing at all (Even unit testing!) TDD (maybe?) Crazy people who love to write tests

4 ways to abuse unit tests Test things that don’t need testing Test assumptions, not actualities Use tests as a crutch (unit tests as an anti-pattern) Test things that are low risk (sort of a repeat?)

Unit Testing Testing individual units of work. If our code is separated into atomic pieces that are sufficiently isolated from one another, we should be able to test the functionality of any single piece apart from any other, hence we get the term ‘unit test’

Test things that don’t need testing Testing individual units of work. If our code is separated into atomic pieces that are sufficiently isolated from one another, we should be able to test the functionality of any single piece apart from any other, hence we get the term ‘unit test’ CodeUnit Tests

YAAAaaaaaaayyyyy……???? NAILED IT. You’ve successfully unit tested your addition function, but there’s an empty feeling inside like you basically accomplished nothing. Life seems meaningless. IT’S NOT YOU – IT’S YOUR UNIT TEST

Another (Less Trivial) Example

Another (Less Trivial) Example (Cont.)

Wait…what did we test? Does our ASP.NET Web API controller work? Does our fake repository work? Will our tests pass? Have we seen this before?

An even less trivial example

So….what’s the point? Maybe we shouldn’t write tests for things that are pretty straight- forward. This seems fairly obvious? What about code coverage?

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” - Bill Gates

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” - Bill Gates “Measuring software quality by % code coverage is like measuring aircraft building progress by surfaces painted” - Me

Test assumptions, not actualities What assumptions about the input and output do we make as developers? We’re mind readers, right?

Has this happened to you? Your vendor provides the following (No schema!):

What could possibly go wrong?

So….what’s the point? Maybe unit tests aren’t the answer in this case…. Can we do better? ENTER…..Integration tests!

Wait, but… Aren’t integration tests “hard to do?”…

Unit tests can create an “anti-pattern” AKA – “Uhh, I’m not sure if this code works, but the unit tests pass, so……………..”

Consider the following…. (thanks IOCCC!)

What does that code do? Turns out it’s actually a game that generates output that is another progression of the game… What’s the point….?

Test things that are low risk As developers we sometimes forget that unit tests are about risk management, not about making the tiny little circles green. Think aviation.

What is risk management? Simply put, it’s an equation: RISK CHANCE * RISK IMPACT = TOTAL RISK

So when should when unit test? Possible Criteria: Solution is complex We can’t get any closer than our mocked up data This is mission critical stuff As a ‘proof’ to other developers?

Thank you! Any questions…. Comments?